Prop Firm Position Size For ThinkOrSwim

a1cturner

Well-known member
I was tired of failing prop firm auditions due to poor position size and stop loss placement and I should have learned how to correctly position myself otherwise years ago so here is a simple little label to help with that.

The default account size is $100,000 with a Maximum Daily Drawdown of 5%. The label assumes that you are willing to have 5 failing trades before you fail your audition. It also assumes a 3% loss per trade to define a "failing trade".

Hope this helps someone pass their audition.

fydEfwr.png


Code:
#Prop Firm Position Size Label
#Justin Turner

input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.05; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.03; #Based on Individual Preference
input RewardToRisk = 2; #Default R to R is 2:1

def MaximumDrawdownDollarsPerDay = TotalCapital * MaximumPercentDailyDrawdown; #Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaxDrawdownDollarsPerTrade = MaximumDrawdownDollarsPerDay / LosingTradesBeforeFail; #Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)

def DrawdownPerShare = (close * MaxPercentDrawdownPerTrade); #Dollar Loss per Share at Defined Maximum Drawdown per Trade
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare; #Dollar Loss per Trade / Drawdown per Share

AddLabel (yes, " Maximum Shares " + rounddown(MaxShares, 0) + " ", color.white);
AddLabel (yes, " Long Stop " + "$" + round((close - DrawdownPerShare), 2) + " ", color.green);
AddLabel (yes, " Long Take Profit " + "$" + round((close + (DrawdownPerShare * RewardtoRisk)), 2) + " ", color.green);
AddLabel (yes, " Short Stop " + "$" + round((close + DrawdownPerShare), 2) + " ", color.red);
AddLabel (yes, " Short Take Profit " + "$" + round((close - (DrawdownPerShare * RewardtoRisk)), 2) + " ", color.red);
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Liked your post and the label. Which prop firms have you auditioned? My partner and I are trading my own capital, though somewhat limited and somewhat successfully. Thinking of prop firm resources to bootstrap education/mentoring/higher capital/etc. Suggestions APPRECIATED! Further discussion welcomed.
 
Liked your post and the label. Which prop firms have you auditioned? My partner and I are trading my own capital, though somewhat limited and somewhat successfully. Thinking of prop firm resources to bootstrap education/mentoring/higher capital/etc. Suggestions APPRECIATED! Further discussion welcomed.
I’ve only auditioned with Surge Trader after much research. Very few rules and accounts up to 1 million with 10:1 margin.
 
Added some plots... good luck to everyone
HHHHHHHHH.jpg

Code:
#Prop Firm Position Size Label
#Justin Turner
#@theBearFib
declare upper;
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Inputs     ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
input period = aggregationPeriod.MIN;
input lineLength = 50;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.001; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.001; #Based on Individual Preference
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Definitions     ════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
def src = open;
def time = (period / 60) * .001;
def lastBar = HighestAll(if !IsNaN(src) then BarNumber() else 0);
def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(src), 0, barNumber));

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDailyDrawdownDollars = TotalCapital * MaximumPercentDailyDrawdown;

#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDailyDrawdownDollars / LosingTradesBeforeFail;

#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (src * MaxPercentDrawdownPerTrade);

 #Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Colors    ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
DefineGlobalColor("LongStop", CreateColor(65,105,225));
DefineGlobalColor("ShortStop", CreateColor(255,0,0));
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Long Plots     ═════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
plot LongStop = Round((src - DrawdownPerShare), 2);
LongStop.hide();

def LongStop1=  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength
                            then LongStop[-lineLength]  else LongStop1[1];

plot LongStop2 = LongStop1;
LongStop2.SetDefaultColor(GlobalColor("LongStop"));
LongStop2.SetLineWeight(2);
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Short Plots    ═════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
plot ShortStop = Round((src + DrawdownPerShare), 2);
ShortStop.hide();

def ShortStop1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength
                            then ShortStop[-lineLength]  else ShortStop1[1];

plot ShortStop2 = ShortStop1;
ShortStop2.SetDefaultColor(GlobalColor("ShortStop"));
ShortStop2.SetLineWeight(2);
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    LABELS    ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
AddLabel (yes, " Maximum Shares " + RoundDown(MaxShares, 0) + " ", Color.WHITE);
AddLabel (yes, " Long Stop " + "$" + Round((src - DrawdownPerShare), 2) + " ", GlobalColor("LongStop"));
AddLabel (yes, " Short Stop " + "$" + Round((src + DrawdownPerShare), 2) + " ", GlobalColor("ShortStop"));
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    The Real End    ════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
 
Added some plots... good luck to everyone
View attachment 18747
Code:
#Prop Firm Position Size Label
#Justin Turner
#@theBearFib
declare upper;
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Inputs     ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
input period = aggregationPeriod.MIN;
input lineLength = 50;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.001; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.001; #Based on Individual Preference
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Definitions     ════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
def src = open;
def time = (period / 60) * .001;
def lastBar = HighestAll(if !IsNaN(src) then BarNumber() else 0);
def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(src), 0, barNumber));

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDailyDrawdownDollars = TotalCapital * MaximumPercentDailyDrawdown;

#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDailyDrawdownDollars / LosingTradesBeforeFail;

#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (src * MaxPercentDrawdownPerTrade);

 #Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Colors    ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
DefineGlobalColor("LongStop", CreateColor(65,105,225));
DefineGlobalColor("ShortStop", CreateColor(255,0,0));
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Long Plots     ═════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
plot LongStop = Round((src - DrawdownPerShare), 2);
LongStop.hide();

def LongStop1=  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength
                            then LongStop[-lineLength]  else LongStop1[1];

plot LongStop2 = LongStop1;
LongStop2.SetDefaultColor(GlobalColor("LongStop"));
LongStop2.SetLineWeight(2);
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    Short Plots    ═════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
plot ShortStop = Round((src + DrawdownPerShare), 2);
ShortStop.hide();

def ShortStop1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength
                            then ShortStop[-lineLength]  else ShortStop1[1];

plot ShortStop2 = ShortStop1;
ShortStop2.SetDefaultColor(GlobalColor("ShortStop"));
ShortStop2.SetLineWeight(2);
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    LABELS    ═══════════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
AddLabel (yes, " Maximum Shares " + RoundDown(MaxShares, 0) + " ", Color.WHITE);
AddLabel (yes, " Long Stop " + "$" + Round((src - DrawdownPerShare), 2) + " ", GlobalColor("LongStop"));
AddLabel (yes, " Short Stop " + "$" + Round((src + DrawdownPerShare), 2) + " ", GlobalColor("ShortStop"));
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#══════════════════════════════════════════════════════    The Real End    ════════════════════════════════════════════════════════════════
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
I did change the code today to add in a take profit label at the top. It’s based on 1:2 Risk:Reward. You could probably also plot that 🤷🏻‍♂️
 
I did change the code today to add in a take profit label at the top. It’s based on 1:2 Risk:Reward. You could probably also plot that 🤷🏻‍♂️
like this?
you have to choose the direction you are trading first... i felt it took out some of the clutter..

1684947061618.png

Code:
#Prop Firm Position Size Label
#Justin Turner
#@theBearFib
declare upper;
#==================================================================================================================================================
#==============================================================     Inputs     ====================================================================
#==================================================================================================================================================
input UseChartTime  = no;   # "Use Chart timeframe or Aggregation?"
input res = AggregationPeriod.MIN;
input lineLength = 50;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.05; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.001; #Based on Individual Preference
input RewardToRisk = 1.25; #Default R to R is 2:1

input ShowShort = no;
input ShowLong  = yes;
#==================================================================================================================================================
#==============================================================    Definitions     ================================================================
#==================================================================================================================================================
def TFLow;
def TFHigh;
def TFClose;
def TFOpen;

if UseChartTime
then {
    TFLow   = low;
    TFHigh  = high;
    TFClose = close;
    TFOpen  = open;
} else {
    TFLow   = low   (period = res);
    TFHigh  = high  (period = res);
    TFClose = close (period = res);
    TFOpen = open (period = res);
}

def time = (TFOpen / 60) * .001;
def lastBar = HighestAll(if !IsNaN(TFOpen) then BarNumber() else 0);
def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(TFOpen), 0, barNumber));

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDailyDrawdownDollars = TotalCapital * MaximumPercentDailyDrawdown; 

#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDailyDrawdownDollars / LosingTradesBeforeFail; 

#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (TFOpen * MaxPercentDrawdownPerTrade); 

#Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;
#==================================================================================================================================================
#==============================================================     Colors    =====================================================================
#==================================================================================================================================================
DefineGlobalColor("LongTakeProfit", CreateColor(50, 255, 0));
DefineGlobalColor("LongStop", CreateColor(255, 0, 0));

DefineGlobalColor("ShortStop", CreateColor(255, 0, 0));
DefineGlobalColor("ShortTakeProfit", CreateColor(50, 255, 0));
#==================================================================================================================================================
#==============================================================     Long Plots     ================================================================
#==================================================================================================================================================
plot LongStop = Round((TFOpen - DrawdownPerShare), 2);
LongStop.Hide();

def LongStop1 =  if barNumber == lineLength 
                    then Double.NaN 
                        else if barNumber == barCount - lineLength 
                            then LongStop[-lineLength]  
                                else LongStop1[1];

plot LongStop2 = LongStop1;
LongStop2.SetDefaultColor(GlobalColor("LongStop"));
LongStop2.SetLineWeight(2);
LongStop2.SetStyle(Curve.SHORT_DASH);
LongStop2.SetHiding(!ShowLong);
#==================================================================================================================================================
plot LongTakeProfit = Round((TFOpen + (DrawdownPerShare * RewardToRisk)), 2);
LongTakeProfit.Hide();

def LongTakeProfit1 =  if barNumber == lineLength 
                    then Double.NaN 
                        else if barNumber == barCount - lineLength 
                            then LongTakeProfit[-lineLength]  
                                else LongTakeProfit1[1];

plot LongTakeProfita = LongTakeProfit1;
LongTakeProfita.SetDefaultColor(GlobalColor("LongTakeProfit"));
LongTakeProfita.SetLineWeight(2);
LongTakeProfita.SetHiding(!ShowLong);
#==================================================================================================================================================
#==============================================================    Short Plots    =================================================================
#==================================================================================================================================================
plot ShortStop = Round((TFOpen + DrawdownPerShare), 2);
ShortStop.Hide();

def ShortStop1 =  if barNumber == lineLength 
                    then Double.NaN 
                        else if barNumber == barCount - lineLength 
                            then ShortStop[-lineLength]  
                                else ShortStop1[1];

plot ShortStop2 = ShortStop1;
ShortStop2.SetDefaultColor(GlobalColor("ShortStop"));
ShortStop2.SetLineWeight(2);
ShortStop2.SetStyle(Curve.SHORT_DASH);
ShortStop2.SetHiding(!ShowShort);
#==================================================================================================================================================
plot ShortTakeProfit = Round((TFOpen - (DrawdownPerShare * RewardToRisk)), 2);
ShortTakeProfit.Hide();

def ShortTakeProfit1 =  if barNumber == lineLength 
                    then Double.NaN 
                        else if barNumber == barCount - lineLength 
                            then ShortTakeProfit[-lineLength]  
                                else ShortTakeProfit1[1];

plot ShortTakeProfita = ShortTakeProfit1;
ShortTakeProfita.SetDefaultColor(GlobalColor("ShortTakeProfit"));
ShortTakeProfita.SetLineWeight(2);
ShortTakeProfita.SetHiding(!ShowShort);
#==================================================================================================================================================
#==============================================================     LABELS    =============================================================================
#==================================================================================================================================================
AddLabel (yes, " Maximum Shares " + RoundDown(MaxShares, 0) + " ", Color.WHITE);

AddLabel (Showlong, " Long Stop " + "$" + Round((TFOpen - DrawdownPerShare), 2) + " ", GlobalColor("LongStop"));
AddLabel (ShowLong, " Long Take Profit " + "$" + Round((TFOpen + (DrawdownPerShare * RewardToRisk)), 2) + " ", GlobalColor("LongTakeProfit"));

AddLabel (ShowShort, " Short Stop " + "$" + Round((TFOpen + DrawdownPerShare), 2) + " ", GlobalColor("ShortStop"));
AddLabel (ShowShort, " Short Take Profit " + "$" + Round((TFOpen - (DrawdownPerShare * RewardToRisk)), 2) + " ", GlobalColor("ShortStop"));

#==================================================================================================================================================
#==============================================================   The Real End ====================================================================
#==================================================================================================================================================
 
like this?
you have to choose the direction you are trading first... i felt it took out some of the clutter..

View attachment 18755
Code:
#Prop Firm Position Size Label
#Justin Turner
#@theBearFib
declare upper;
#==================================================================================================================================================
#==============================================================     Inputs     ====================================================================
#==================================================================================================================================================
input UseChartTime  = no;   # "Use Chart timeframe or Aggregation?"
input res = AggregationPeriod.MIN;
input lineLength = 50;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.05; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.001; #Based on Individual Preference
input RewardToRisk = 1.25; #Default R to R is 2:1

input ShowShort = no;
input ShowLong  = yes;
#==================================================================================================================================================
#==============================================================    Definitions     ================================================================
#==================================================================================================================================================
def TFLow;
def TFHigh;
def TFClose;
def TFOpen;

if UseChartTime
then {
    TFLow   = low;
    TFHigh  = high;
    TFClose = close;
    TFOpen  = open;
} else {
    TFLow   = low   (period = res);
    TFHigh  = high  (period = res);
    TFClose = close (period = res);
    TFOpen = open (period = res);
}

def time = (TFOpen / 60) * .001;
def lastBar = HighestAll(if !IsNaN(TFOpen) then BarNumber() else 0);
def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(TFOpen), 0, barNumber));

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDailyDrawdownDollars = TotalCapital * MaximumPercentDailyDrawdown;

#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDailyDrawdownDollars / LosingTradesBeforeFail;

#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (TFOpen * MaxPercentDrawdownPerTrade);

#Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;
#==================================================================================================================================================
#==============================================================     Colors    =====================================================================
#==================================================================================================================================================
DefineGlobalColor("LongTakeProfit", CreateColor(50, 255, 0));
DefineGlobalColor("LongStop", CreateColor(255, 0, 0));

DefineGlobalColor("ShortStop", CreateColor(255, 0, 0));
DefineGlobalColor("ShortTakeProfit", CreateColor(50, 255, 0));
#==================================================================================================================================================
#==============================================================     Long Plots     ================================================================
#==================================================================================================================================================
plot LongStop = Round((TFOpen - DrawdownPerShare), 2);
LongStop.Hide();

def LongStop1 =  if barNumber == lineLength
                    then Double.NaN
                        else if barNumber == barCount - lineLength
                            then LongStop[-lineLength] 
                                else LongStop1[1];

plot LongStop2 = LongStop1;
LongStop2.SetDefaultColor(GlobalColor("LongStop"));
LongStop2.SetLineWeight(2);
LongStop2.SetStyle(Curve.SHORT_DASH);
LongStop2.SetHiding(!ShowLong);
#==================================================================================================================================================
plot LongTakeProfit = Round((TFOpen + (DrawdownPerShare * RewardToRisk)), 2);
LongTakeProfit.Hide();

def LongTakeProfit1 =  if barNumber == lineLength
                    then Double.NaN
                        else if barNumber == barCount - lineLength
                            then LongTakeProfit[-lineLength] 
                                else LongTakeProfit1[1];

plot LongTakeProfita = LongTakeProfit1;
LongTakeProfita.SetDefaultColor(GlobalColor("LongTakeProfit"));
LongTakeProfita.SetLineWeight(2);
LongTakeProfita.SetHiding(!ShowLong);
#==================================================================================================================================================
#==============================================================    Short Plots    =================================================================
#==================================================================================================================================================
plot ShortStop = Round((TFOpen + DrawdownPerShare), 2);
ShortStop.Hide();

def ShortStop1 =  if barNumber == lineLength
                    then Double.NaN
                        else if barNumber == barCount - lineLength
                            then ShortStop[-lineLength] 
                                else ShortStop1[1];

plot ShortStop2 = ShortStop1;
ShortStop2.SetDefaultColor(GlobalColor("ShortStop"));
ShortStop2.SetLineWeight(2);
ShortStop2.SetStyle(Curve.SHORT_DASH);
ShortStop2.SetHiding(!ShowShort);
#==================================================================================================================================================
plot ShortTakeProfit = Round((TFOpen - (DrawdownPerShare * RewardToRisk)), 2);
ShortTakeProfit.Hide();

def ShortTakeProfit1 =  if barNumber == lineLength
                    then Double.NaN
                        else if barNumber == barCount - lineLength
                            then ShortTakeProfit[-lineLength] 
                                else ShortTakeProfit1[1];

plot ShortTakeProfita = ShortTakeProfit1;
ShortTakeProfita.SetDefaultColor(GlobalColor("ShortTakeProfit"));
ShortTakeProfita.SetLineWeight(2);
ShortTakeProfita.SetHiding(!ShowShort);
#==================================================================================================================================================
#==============================================================     LABELS    =============================================================================
#==================================================================================================================================================
AddLabel (yes, " Maximum Shares " + RoundDown(MaxShares, 0) + " ", Color.WHITE);

AddLabel (Showlong, " Long Stop " + "$" + Round((TFOpen - DrawdownPerShare), 2) + " ", GlobalColor("LongStop"));
AddLabel (ShowLong, " Long Take Profit " + "$" + Round((TFOpen + (DrawdownPerShare * RewardToRisk)), 2) + " ", GlobalColor("LongTakeProfit"));

AddLabel (ShowShort, " Short Stop " + "$" + Round((TFOpen + DrawdownPerShare), 2) + " ", GlobalColor("ShortStop"));
AddLabel (ShowShort, " Short Take Profit " + "$" + Round((TFOpen - (DrawdownPerShare * RewardToRisk)), 2) + " ", GlobalColor("ShortStop"));

#==================================================================================================================================================
#==============================================================   The Real End ====================================================================
#==================================================================================================================================================
@optionsbear what is the line at the bottom when you scroll to the far left of your chart? It's on every chart as long as you have one of the plot lines turned on.
 
@halcyonguy i have a few questions for you.

Why is the code in post 6 not dynamic like in post 1? When I first wrote the code in post 1 the labels would update in real time. After adding the plots, the labels and the plots will not update unless I change tickers and change back.

Why is there a plot in the bottom left corner of the chart when zoomed out all the way and with “show studies” turned on? This isn’t a huge deal as it goes away if you turn off “show studies” but it would obviously be better if it wasn’t there.

twUNJGe.png


Code:
#Prop Firm Position Size Label
#Justin Turner #@theBearFib

declare upper;

input lineLength = 100;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.05; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.03; #Based on Individual Preference
input RewardToRisk = 2; #Default R to R is 2:1

def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(close), 0, barNumber));

input bubblemover = 3;
def b  = bubblemover;
def b1 = b + 1;

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDrawdownDollarsPerDay = TotalCapital * MaximumPercentDailyDrawdown;
#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDrawdownDollarsPerDay / LosingTradesBeforeFail;
#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (close * MaxPercentDrawdownPerTrade);
#Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;

def LongStop = Round((close - DrawdownPerShare), 2);
def LongStop1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength then LongStop[-lineLength] else LongStop1[1];
plot LongStop2 = LongStop1;
LongStop2.SetDefaultColor(createcolor(197, 225, 165));
LongStop2.setpaintingstrategy(paintingstrategy.dashes);
LongStop2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), LongStop2[b], "Stop", createcolor(197, 225, 165), yes);

def LongTakeProfit = Round((close + (DrawdownPerShare * RewardToRisk)), 2);
def LongTakeProfit1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength then LongTakeProfit[-lineLength] else LongTakeProfit1[1];
plot LongTakeProfit2 = LongTakeProfit1;
LongTakeProfit2.SetDefaultColor(createcolor(197, 225, 165));
LongTakeProfit2.setpaintingstrategy(paintingstrategy.dashes);
LongTakeProfit2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), LongTakeProfit2[b], "TakeProfit", createcolor(197, 225, 165), yes);

def ShortStop = Round((close + DrawdownPerShare), 2);
def ShortStop1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength then ShortStop[-lineLength] else ShortStop1[1];
plot ShortStop2 = ShortStop1;
ShortStop2.SetDefaultColor(createcolor(255, 138, 128));
ShortStop2.setpaintingstrategy(paintingstrategy.dashes);
ShortStop2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), ShortStop2[b], "Stop", createcolor(255, 138, 128), yes);

def ShortTakeProfit = Round((close - (DrawdownPerShare * RewardToRisk)), 2);
def ShortTakeProfit1 =  if barNumber == lineLength then Double.NaN else if barNumber == barCount - lineLength then ShortTakeProfit[-lineLength] else ShortTakeProfit1[1];
plot ShortTakeProfit2 = ShortTakeProfit1;
ShortTakeProfit2.SetDefaultColor(createcolor(255, 138, 128));
ShortTakeProfit2.setpaintingstrategy(paintingstrategy.dashes);
ShortTakeProfit2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), ShortTakeProfit2[b], "TakeProfit", createcolor(255, 138, 128), yes);

AddLabel (yes, " Maximum Shares " + rounddown(MaxShares, 0) + " ", color.white);
AddLabel (yes, " Long Stop " + "$" + LongStop + " ", color.green);
AddLabel (yes, " Long Take Profit " + "$" + LongTakeProfit + " ", color.green);
AddLabel (yes, " Short Stop " + "$" + ShortStop + " ", color.red);
AddLabel (yes, " Short Take Profit " + "$" + ShortTakeProfit + " ", color.red);

Thanks for your help!
 
Last edited:
@halcyonguy @MerryDay I fixed the plot on the bottom left issue but the plots and labels still don't update (not dynamic). Any idea? See post #10 for further clarification.

Code:
#Prop Firm Position Size Label
#Justin Turner #@theBearFib

declare upper;

input LineLength = 100;
input TotalCapital = 100000; #Does Not Include Margin
input MaximumPercentDailyDrawdown = 0.05; #Based on Prop Firm Rules
input LosingTradesBeforeFail = 5; #Based on Individual Preference
input MaxPercentDrawdownPerTrade = 0.03; #Based on Individual Preference
input RewardToRisk = 2; #Default R to R is 2:1

input BubbleMover = 3;
def b  = BubbleMover;
def b1 = b + 1;

def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(close), 0, barNumber));

#Maximum Total Daily Dollar Loss Before Failure (ex. $5,000)
def MaximumDrawdownDollarsPerDay = TotalCapital * MaximumPercentDailyDrawdown;
#Maximum Dollar Loss per Trade Based on Individual Preference (ex $1,000)
def MaxDrawdownDollarsPerTrade = MaximumDrawdownDollarsPerDay / LosingTradesBeforeFail;
#Dollar Loss per Share at Defined Maximum Drawdown per Trade
def DrawdownPerShare = (close * MaxPercentDrawdownPerTrade);
#Dollar Loss per Trade / Drawdown per Share
def MaxShares = MaxDrawdownDollarsPerTrade / DrawdownPerShare;

def LongStop = Round((close - DrawdownPerShare), 2);
def LongStop1 = if !IsNaN(close) and IsNaN(close[-1]) then LongStop else LongStop1[1];
plot LongStop2 = if IsNaN(close[-LineLength]) and !isnan(close[LineLength]) then LongStop1[-LineLEngth] else Double.NaN;
LongStop2.SetDefaultColor(createcolor(197, 225, 165));
LongStop2.setpaintingstrategy(paintingstrategy.dashes);
LongStop2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), LongStop2[b], "Stop", createcolor(197, 225, 165), yes);

def LongTakeProfit = Round((close + (DrawdownPerShare * RewardToRisk)), 2);
def LongTakeProfit1 = if !IsNaN(close) and IsNaN(close[-1]) then LongTakeProfit else LongTakeProfit1[1];
plot LongTakeProfit2 = if IsNaN(close[-LineLength]) and !isnan(close[LineLength]) then LongTakeProfit1[-LineLEngth] else Double.NaN;
LongTakeProfit2.SetDefaultColor(createcolor(197, 225, 165));
LongTakeProfit2.setpaintingstrategy(paintingstrategy.dashes);
LongTakeProfit2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), LongTakeProfit2[b], "TakeProfit", createcolor(197, 225, 165), yes);

def ShortStop = Round((close + DrawdownPerShare), 2);
def ShortStop1 = if !IsNaN(close) and IsNaN(close[-1]) then ShortStop else ShortStop1[1];
plot ShortStop2 = if IsNaN(close[-LineLength]) and !isnan(close[LineLength]) then ShortStop1[-LineLEngth] else Double.NaN;
ShortStop2.SetDefaultColor(createcolor(255, 138, 128));
ShortStop2.setpaintingstrategy(paintingstrategy.dashes);
ShortStop2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), ShortStop2[b], "Stop", createcolor(255, 138, 128), yes);

def ShortTakeProfit = Round((close - (DrawdownPerShare * RewardToRisk)), 2);
def ShortTakeProfit1 = if !IsNaN(close) and IsNaN(close[-1]) then ShortTakeProfit else ShortTakeProfit1[1];
plot ShortTakeProfit2 = if IsNaN(close[-LineLength]) and !isnan(close[LineLength]) then ShortTakeProfit1[-LineLEngth] else Double.NaN;
ShortTakeProfit2.SetDefaultColor(createcolor(255, 138, 128));
ShortTakeProfit2.setpaintingstrategy(paintingstrategy.dashes);
ShortTakeProfit2.HideBubble();
addchartbubble(IsNaN(close[b]) and !IsNaN(close[b1]), ShortTakeProfit2[b], "TakeProfit", createcolor(255, 138, 128), yes);

AddLabel (yes, " Maximum Shares " + rounddown(MaxShares, 0) + " ", color.white);
AddLabel (yes, " Long Stop " + "$" + LongStop + " ", color.green);
AddLabel (yes, " Long Take Profit " + "$" + LongTakeProfit + " ", color.green);
AddLabel (yes, " Short Stop " + "$" + ShortStop + " ", color.red);
AddLabel (yes, " Short Take Profit " + "$" + ShortTakeProfit + " ", color.red);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
341 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top