How can I turn this into entry areas in the settings so I can change the %s to what ever I want at any time in the settings pop up?.
I think many others would like this as well to make it more easy to use.
So I can change each of the % areas in the setting area that it dose not have right now for each of the %s.
5% Stop, 5% Target, 10% Target, 15% Target
Here is the code that was posted into this group here .
https://usethinkscript.com/threads/...owned-equities-in-thinkorswim.7089/post-67202
See screen grab at bottom it shows the settings area dose not have the % areas to set in it. I would like them to be added in so they can be changed as needed easy.
I think many others would like this as well to make it more easy to use.
So I can change each of the % areas in the setting area that it dose not have right now for each of the %s.
5% Stop, 5% Target, 10% Target, 15% Target
Here is the code that was posted into this group here .
https://usethinkscript.com/threads/...owned-equities-in-thinkorswim.7089/post-67202
See screen grab at bottom it shows the settings area dose not have the % areas to set in it. I would like them to be added in so they can be changed as needed easy.
Code:
# Average Actual Entry
# Mobius
# 01.01.2018
# Removed portions of Mobius' code, added quantity and replaced Mobius' P/L
# calculation with GetOpenPL().
# Color-coded label, edited study look/colors for personal preference
input use_line_limits = yes;#Yes, plots line from/to; No, plot line across entire chart
input linefrom = 100;#Hint linefrom: limits how far line plots in candle area
input lineto = 12;#Hint lineto: limits how far into expansion the line will plot
def PL = GetOpenPL();
def c = if isNaN(close[-1]) then close else c[1];
def Entry = if isNaN(GetAveragePrice()) then Entry[1] else GetAveragePrice();
def LastEntryBar = if Entry != Entry[1] then barNumber() else LastEntryBar[1];
plot Entry_ = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0
then highestAll(if isNaN(close[-1]) then Entry else double.nan) else double.nan;
Entry_.SetStyle(Curve.SHORT_DASH);
Entry_.SetLineWeight(3);
Entry_.SetDefaultColor(color.BLUE);
Entry_.HideBubble();
Entry_.HideTitle();
AddLabel(1," P/L: " + AsDollars(PL) +" ",
if PL == 0 then color.cyan
else if PL > 0 then color.green
else color.red);
plot "5% Stop" = if Entry_ then Entry_ - .05*Entry else double.nan;
"5% Stop".SetDefaultColor(color.red);
plot "5% Target" = if Entry_ then Entry_ + .05*Entry else double.nan;
"5% Target".SetDefaultColor(color.green);
plot "10% Target" = if Entry_ then Entry_ + .10*Entry else double.nan;
"10% Target".SetDefaultColor(color.Yellow);
plot "15% Target" = if Entry_ then Entry_ + .15*Entry else double.nan;
"15% Target".SetDefaultColor(color.Magenta);
plot "20% Target" = if Entry_ then Entry_ + .20*Entry else double.nan;
"20% Target".SetDefaultColor(color.red);
# end code
Last edited by a moderator: