Fixed Price Risk/Reward & Targets

K2chungus

New member
VIP
Help Needed With Fixed Price Risk/Reward Level SLs & Targets Set At Entry Candle and Strategy Orders

Note:
I have not added in Buy To Close and Sell To Close EOD orders yet for trades that do not meet SL or Targets as can be seen, wanted to address the more glaring issues of the SL and Target line extensions first.

Hello everyone, I've been lurking here for a while and as an amateur coder at best I've benefited so much from the expertise and knowledge of those in this community for which I wanted to first of all say thank you for.

I am currently in the final stages of dev on a multi-strategy system that I plan on posting on this site once I'm finished as my contribution; and therefor am converting a study into a strategy for the first time to efficiently fine tune and finalize the signals and this is where I have run into trouble.

I created this system around R level targets which are dependent on the entry that is signaled and specific conditions that are met. As such in order for the backtest to be effective and accurate I need both the R level(s) and SL that are determined at the entry candle to extend until either the target exit level or the stop loss levels are reached.

The stop losses are measured by the size of the signal candle from the close of that candle or an ATR multiple depending on the signal and specific conditions (not included in the attached code but is in the study version with all of the other signals), position size is automatically calculated based on the maximum loss input in relation to the stop loss price and displayed in the signal bubble.

Issue Example 1 (5/26, 12:25PM):

3sFG76G.png


You can see here that the lines do extend from the R and SL levels set by the entry candle size from entry candle close but they fail to reach far enough for the target line to be reached. The trade then carries over to the next short signal 2 days after..... bad.

So really the issue is just that the lines are inconsistent and I lack the knowledge to make them consistently extend until they are crossed.

Another example, this one the lines extending super far (7/17 3:20PM):

KWgoEeQ.png



While this specific problem is okay for this signal because it goes off pretty rarely, some go off 2-4 times a day and so them triggering from lines that continue on from a past trade that occurred that day of the same strategy is problematic.

As with any system, what really makes it work is the trade management and risk management and once the problem of extending the lines forward in time has been solved I am also hoping to create orders for my different conditional safety trims, early exits, trims for profit (some strategies exit half at 1R to lock profit and then leave runners that go until certain conditions are met etc) so the final backtesting results I will include when I post the final system here will have results as accurate to the system's performance live as possible.

Link to dev grid with full dev version of system: https://tos.mx/kgVKZGb

Code for the specific signal I have been using to convert the study into a strategy:

Code:
input MaxLoss = 1500;
input rtarget = 1.5;
input R_Lane1_Active = yes;

def CS = high - low;

def TickSize = TickSize(GetSymbol());
def TickValue = TickValue(GetSymbol());

def length_rlevel = 50;

###########################____________________ R Lane 1 ____________________###########################

#RSI OB/OS >= 30 , BB Behind Proximity <= 10 , BB Behind Direction >=.6 & <=1.26 , Stoch Change > 1
def length_rlevel = 50;

#______________ Long ______________#
#signal
def l_Rlane1 = if TimeCheck2 and
l_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OB >= 30 and
bb_lp <= 10 and
(bb_ld >= .6 and bb_ld <= 1.26) and
Bullish_Stoch_Change_Valid == 1 then 1 else 0;

plot l_Rlane1_es = if l_Rlane1 == 1 then low else DOUBLE.NAN;
l_Rlane1_es.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
l_Rlane1_es.AssignValueColor(Color.CYAN);
l_Rlane1_es.SetLineWeight(3);

#stop loss
plot l_Rlane1_sl = if l_Rlane1 == 1 then open[-1] - CS else Double.NaN;
l_Rlane1_sl.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_sl.AssignValueColor(Color.WHITE);
l_Rlane1_sl.SetLineWeight(1);

# target
plot l_Rlane1_t = if l_Rlane1 == 1 then open[-1] + (CS * rtarget) else Double.NaN;
l_Rlane1_t.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_t.AssignValueColor(Color.WHITE);
l_Rlane1_t.SetLineWeight(1);

#bubble
def l_Rlane1_MaxSize = Round(MaxLoss / (((close - l_Rlane1_sl) / TickSize) * TickValue), 1);
AddChartBubble(l_Rlane1, l_Rlane1_sl - (ATR * .75), "RL1 // " + l_Rlane1_MaxSize, GlobalColor("Bullish Bubble"));

# Entry Order
AddOrder(OrderType.BUY_TO_OPEN, l_Rlane1 == 1, open[-1], l_Rlane1_maxsize, Color.CYAN, Color.CYAN, "L Rlane1 // " + rtarget);

def l_Rlane1_count =
if IsNaN(l_Rlane1) and
!IsNaN(l_Rlane1[1]) then 1 else
l_Rlane1_count[1] + 1;

# Target Exit
plot l_Rlane1_t_ext = if IsNaN(l_Rlane1) then GetValue(l_Rlane1_t, l_Rlane1_count) else GetValue(l_Rlane1_t, l_Rlane1_count);
l_Rlane1_t_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_t_ext.AssignValueColor(Color.WHITE);
l_Rlane1_t_ext.SetLineWeight(1);

def l_Rlane1_targetmet = if high >= l_Rlane1_t_ext then 1 else 0;
#def l_Rlane1_targetmet2 = if (high >= l_Rlane1_t_ext) then (l_Rlane1_t_ext) else (Highest(high[1], length_rlevel));

AddOrder(OrderType.SELL_TO_CLOSE, l_Rlane1_targetmet, l_Rlane1_t_ext, l_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "L Rlane1 // " + rtarget);

# SL Exit
plot l_Rlane1_sl_ext = if IsNaN(l_Rlane1) then GetValue(l_Rlane1_sl, l_Rlane1_count) else GetValue(l_Rlane1_sl, l_Rlane1_count);
l_Rlane1_sl_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_sl_ext.AssignValueColor(Color.WHITE);
l_Rlane1_sl_ext.SetLineWeight(1);

def l_Rlane1_slmet = if low <= l_Rlane1_sl_ext then 1 else 0;
#def l_Rlane1_slmet2 = if (low <= l_Rlane1_sl_ext) then (l_Rlane1_sl_ext) else (Lowest(low[1], length_rlevel));

AddOrder(OrderType.SELL_TO_CLOSE, l_Rlane1_slmet, l_Rlane1_sl_ext, l_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "L Rlane1 // SL");


#______________ Short  ______________#
#signal
def s_Rlane1 = if TimeCheck2 and
s_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OS >= 30 and
bb_up <= 10 and
(bb_ud >= .6 and bb_ud <= 1.26) and
Bearish_Stoch_Change_Valid == 1 then 1 else 0;

plot s_Rlane1_es = if s_Rlane1 == 1 then high else DOUBLE.NAN;
s_Rlane1_es.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
s_Rlane1_es.AssignValueColor(Color.CYAN);
s_Rlane1_es.SetLineWeight(3);

#stop loss
plot s_Rlane1_sl = if s_Rlane1 == 1 then open[-1] + CS else Double.NaN;
s_Rlane1_sl.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_sl.AssignValueColor(Color.WHITE);
s_Rlane1_sl.SetLineWeight(1);

# target
plot s_Rlane1_t = if s_Rlane1 == 1 then open[-1] - (CS * rtarget) else Double.NaN;
s_Rlane1_t.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_t.AssignValueColor(Color.WHITE);
s_Rlane1_t.SetLineWeight(1);

#bubble
def s_Rlane1_maxsize = Round(MaxLoss / (((s_Rlane1_sl - close) / TickSize) * TickValue), 1);
AddChartBubble(s_Rlane1, s_Rlane1_sl + (ATR * .1), "RL1 // " + s_Rlane1_maxsize, GlobalColor("Bearish Bubble"));

# Entry Order
AddOrder(OrderType.Sell_TO_OPEN, s_Rlane1 == 1, open[-1], s_Rlane1_maxsize, Color.CYAN, Color.CYAN, "S Rlane1 // " + rtarget);

def s_Rlane1_count =
if IsNaN(s_Rlane1) and
!IsNaN(s_Rlane1[1]) then 1
else s_Rlane1_count[1] + 1;


# Target Exit
plot s_Rlane1_t_ext = if IsNaN(s_Rlane1) then GetValue(s_Rlane1_t, s_Rlane1_count) else GetValue(s_Rlane1_t, s_Rlane1_count);
s_Rlane1_t_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_t_ext.AssignValueColor(Color.WHITE);
s_Rlane1_t_ext.SetLineWeight(1);

def s_Rlane1_targetmet = if low <= s_Rlane1_t_ext then 1 else 0;
#def s_Rlane1_targetmet2 = if (low <= s_Rlane1_t_ext) then (s_Rlane1_t_ext) else (Lowest(low[1], length_rlevel));

AddOrder(OrderType.Buy_TO_CLOSE, s_Rlane1_targetmet, s_Rlane1_t_ext, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // " + rtarget);


# SL Exit
plot s_Rlane1_sl_ext = if IsNaN(s_Rlane1) then GetValue(s_Rlane1_sl, s_Rlane1_count) else GetValue(s_Rlane1_sl, s_Rlane1_count);
s_Rlane1_sl_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_sl_ext.AssignValueColor(Color.WHITE);
s_Rlane1_sl_ext.SetLineWeight(1);

def s_Rlane1_slmet = if high >= s_Rlane1_sl_ext then 1 else 0;
#def s_Rlane1_slmet2 = if (high >= s_Rlane1_sl_ext) then (s_Rlane1_sl_ext) else (Highest(high[1], length_rlevel));

AddOrder(OrderType.Buy_TO_CLOSE, s_Rlane1_slmet, s_Rlane1_sl_ext, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // SL");
 

Attachments

  • Screenshot 2023-09-15 at 13.06.29.png
    Screenshot 2023-09-15 at 13.06.29.png
    20 KB · Views: 176
  • Screenshot 2023-09-15 at 13.07.00.png
    Screenshot 2023-09-15 at 13.07.00.png
    38 KB · Views: 182
Last edited by a moderator:
Solution
@K2chungus
Fixed the short side for you.
I'll let you fix the long side.
8ULJtWP.png

Ruby:
#______________ Short  ______________#
#signal
def s_Rlane1 = if TimeCheck2 and
s_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OS >= 30 and
bb_up <= 10 and
(bb_ud >= .6 and bb_ud <= 1.26) and
Bearish_Stoch_Change_Valid == 1 then 1 else 0;

def s_Rlane_sl;
def s_Rlane_t;

if high >= s_Rlane_sl[1] {
s_Rlane_sl = double.nan;
s_Rlane_t = double.nan;

} else if low <= s_Rlane_t[1] {
s_Rlane_sl = double.nan;
s_Rlane_t = double.nan;

} else if s_Rlane1 == 1 {
s_Rlane_sl = open[-1] + CS;
s_Rlane_t = open[-1] - (CS * rtarget);

} else {
s_Rlane_sl = s_Rlane_sl[1];
s_Rlane_t = s_Rlane_t[1];
}

plot s_Rlane1_es = s_Rlane1...
@K2chungus
Fixed the short side for you.
I'll let you fix the long side.
8ULJtWP.png

Ruby:
#______________ Short  ______________#
#signal
def s_Rlane1 = if TimeCheck2 and
s_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OS >= 30 and
bb_up <= 10 and
(bb_ud >= .6 and bb_ud <= 1.26) and
Bearish_Stoch_Change_Valid == 1 then 1 else 0;

def s_Rlane_sl;
def s_Rlane_t;

if high >= s_Rlane_sl[1] {
s_Rlane_sl = double.nan;
s_Rlane_t = double.nan;

} else if low <= s_Rlane_t[1] {
s_Rlane_sl = double.nan;
s_Rlane_t = double.nan;

} else if s_Rlane1 == 1 {
s_Rlane_sl = open[-1] + CS;
s_Rlane_t = open[-1] - (CS * rtarget);

} else {
s_Rlane_sl = s_Rlane_sl[1];
s_Rlane_t = s_Rlane_t[1];
}

plot s_Rlane1_es = s_Rlane1;
s_Rlane1_es.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
s_Rlane1_es.AssignValueColor(Color.CYAN);
s_Rlane1_es.SetLineWeight(3);

#stop loss
plot s_Rlane1_sl = s_Rlane_sl;
s_Rlane1_sl.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_sl.AssignValueColor(Color.WHITE);
s_Rlane1_sl.SetLineWeight(1);

# target
plot s_Rlane1_t = s_Rlane_t;
s_Rlane1_t.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_t.AssignValueColor(Color.WHITE);
s_Rlane1_t.SetLineWeight(1);

#bubble
def s_Rlane1_maxsize = Round(MaxLoss / (((s_Rlane1_sl - close) / TickSize) * TickValue), 1);
AddChartBubble(s_Rlane1, s_Rlane1_sl + (ATR * .1), "RL1 // " + s_Rlane1_maxsize, GlobalColor("Bearish Bubble"));

AddOrder(OrderType.Sell_TO_OPEN, s_Rlane1, open[-1], s_Rlane1_maxsize,Color.CYAN, Color.CYAN, "S Rlane1 // " + rtarget);
##########################################################################################################################
#The negative offsets on the following line are to account for TOS plotting a bar late. Exit orders occur when target or
#stop loss are hit, not on open after.
AddOrder(OrderType.Buy_TO_CLOSE, low[-1] <= s_Rlane_t, s_Rlane_t, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // " + rtarget);
AddOrder(OrderType.Buy_TO_CLOSE, high[-1] >= s_Rlane_sl, s_Rlane_sl, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // SL");
##########################################################################################################################
 
Solution
Help Needed With Fixed Price Risk/Reward Level SLs & Targets Set At Entry Candle and Strategy Orders



Hello everyone, I've been lurking here for a while and as an amateur coder at best I've benefited so much from the expertise and knowledge of those in this community for which I wanted to first of all say thank you for.

I am currently in the final stages of dev on a multi-strategy system that I plan on posting on this site once I'm finished as my contribution; and therefor am converting a study into a strategy for the first time to efficiently fine tune and finalize the signals and this is where I have run into trouble.

I created this system around R level targets which are dependent on the entry that is signaled and specific conditions that are met. As such in order for the backtest to be effective and accurate I need both the R level(s) and SL that are determined at the entry candle to extend until either the target exit level or the stop loss levels are reached.

The stop losses are measured by the size of the signal candle from the close of that candle or an ATR multiple depending on the signal and specific conditions (not included in the attached code but is in the study version with all of the other signals), position size is automatically calculated based on the maximum loss input in relation to the stop loss price and displayed in the signal bubble.

Issue Example 1 (5/26, 12:25PM):

3sFG76G.png


You can see here that the lines do extend from the R and SL levels set by the entry candle size from entry candle close but they fail to reach far enough for the target line to be reached. The trade then carries over to the next short signal 2 days after..... bad.

So really the issue is just that the lines are inconsistent and I lack the knowledge to make them consistently extend until they are crossed.

Another example, this one the lines extending super far (7/17 3:20PM):

KWgoEeQ.png



While this specific problem is okay for this signal because it goes off pretty rarely, some go off 2-4 times a day and so them triggering from lines that continue on from a past trade that occurred that day of the same strategy is problematic.

As with any system, what really makes it work is the trade management and risk management and once the problem of extending the lines forward in time has been solved I am also hoping to create orders for my different conditional safety trims, early exits, trims for profit (some strategies exit half at 1R to lock profit and then leave runners that go until certain conditions are met etc) so the final backtesting results I will include when I post the final system here will have results as accurate to the system's performance live as possible.

Link to dev grid with full dev version of system: https://tos.mx/kgVKZGb

Code for the specific signal I have been using to convert the study into a strategy:

Code:
input MaxLoss = 1500;
input rtarget = 1.5;
input R_Lane1_Active = yes;

def CS = high - low;

def TickSize = TickSize(GetSymbol());
def TickValue = TickValue(GetSymbol());

def length_rlevel = 50;

###########################____________________ R Lane 1 ____________________###########################

#RSI OB/OS >= 30 , BB Behind Proximity <= 10 , BB Behind Direction >=.6 & <=1.26 , Stoch Change > 1
def length_rlevel = 50;

#______________ Long ______________#
#signal
def l_Rlane1 = if TimeCheck2 and
l_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OB >= 30 and
bb_lp <= 10 and
(bb_ld >= .6 and bb_ld <= 1.26) and
Bullish_Stoch_Change_Valid == 1 then 1 else 0;

plot l_Rlane1_es = if l_Rlane1 == 1 then low else DOUBLE.NAN;
l_Rlane1_es.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
l_Rlane1_es.AssignValueColor(Color.CYAN);
l_Rlane1_es.SetLineWeight(3);

#stop loss
plot l_Rlane1_sl = if l_Rlane1 == 1 then open[-1] - CS else Double.NaN;
l_Rlane1_sl.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_sl.AssignValueColor(Color.WHITE);
l_Rlane1_sl.SetLineWeight(1);

# target
plot l_Rlane1_t = if l_Rlane1 == 1 then open[-1] + (CS * rtarget) else Double.NaN;
l_Rlane1_t.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_t.AssignValueColor(Color.WHITE);
l_Rlane1_t.SetLineWeight(1);

#bubble
def l_Rlane1_MaxSize = Round(MaxLoss / (((close - l_Rlane1_sl) / TickSize) * TickValue), 1);
AddChartBubble(l_Rlane1, l_Rlane1_sl - (ATR * .75), "RL1 // " + l_Rlane1_MaxSize, GlobalColor("Bullish Bubble"));

# Entry Order
AddOrder(OrderType.BUY_TO_OPEN, l_Rlane1 == 1, open[-1], l_Rlane1_maxsize, Color.CYAN, Color.CYAN, "L Rlane1 // " + rtarget);

def l_Rlane1_count =
if IsNaN(l_Rlane1) and
!IsNaN(l_Rlane1[1]) then 1 else
l_Rlane1_count[1] + 1;

# Target Exit
plot l_Rlane1_t_ext = if IsNaN(l_Rlane1) then GetValue(l_Rlane1_t, l_Rlane1_count) else GetValue(l_Rlane1_t, l_Rlane1_count);
l_Rlane1_t_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_t_ext.AssignValueColor(Color.WHITE);
l_Rlane1_t_ext.SetLineWeight(1);

def l_Rlane1_targetmet = if high >= l_Rlane1_t_ext then 1 else 0;
#def l_Rlane1_targetmet2 = if (high >= l_Rlane1_t_ext) then (l_Rlane1_t_ext) else (Highest(high[1], length_rlevel));

AddOrder(OrderType.SELL_TO_CLOSE, l_Rlane1_targetmet, l_Rlane1_t_ext, l_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "L Rlane1 // " + rtarget);

# SL Exit
plot l_Rlane1_sl_ext = if IsNaN(l_Rlane1) then GetValue(l_Rlane1_sl, l_Rlane1_count) else GetValue(l_Rlane1_sl, l_Rlane1_count);
l_Rlane1_sl_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
l_Rlane1_sl_ext.AssignValueColor(Color.WHITE);
l_Rlane1_sl_ext.SetLineWeight(1);

def l_Rlane1_slmet = if low <= l_Rlane1_sl_ext then 1 else 0;
#def l_Rlane1_slmet2 = if (low <= l_Rlane1_sl_ext) then (l_Rlane1_sl_ext) else (Lowest(low[1], length_rlevel));

AddOrder(OrderType.SELL_TO_CLOSE, l_Rlane1_slmet, l_Rlane1_sl_ext, l_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "L Rlane1 // SL");


#______________ Short  ______________#
#signal
def s_Rlane1 = if TimeCheck2 and
s_r_lane == 1 and
R_Lane1_Active == yes and
RSI_OS >= 30 and
bb_up <= 10 and
(bb_ud >= .6 and bb_ud <= 1.26) and
Bearish_Stoch_Change_Valid == 1 then 1 else 0;

plot s_Rlane1_es = if s_Rlane1 == 1 then high else DOUBLE.NAN;
s_Rlane1_es.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
s_Rlane1_es.AssignValueColor(Color.CYAN);
s_Rlane1_es.SetLineWeight(3);

#stop loss
plot s_Rlane1_sl = if s_Rlane1 == 1 then open[-1] + CS else Double.NaN;
s_Rlane1_sl.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_sl.AssignValueColor(Color.WHITE);
s_Rlane1_sl.SetLineWeight(1);

# target
plot s_Rlane1_t = if s_Rlane1 == 1 then open[-1] - (CS * rtarget) else Double.NaN;
s_Rlane1_t.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_t.AssignValueColor(Color.WHITE);
s_Rlane1_t.SetLineWeight(1);

#bubble
def s_Rlane1_maxsize = Round(MaxLoss / (((s_Rlane1_sl - close) / TickSize) * TickValue), 1);
AddChartBubble(s_Rlane1, s_Rlane1_sl + (ATR * .1), "RL1 // " + s_Rlane1_maxsize, GlobalColor("Bearish Bubble"));

# Entry Order
AddOrder(OrderType.Sell_TO_OPEN, s_Rlane1 == 1, open[-1], s_Rlane1_maxsize, Color.CYAN, Color.CYAN, "S Rlane1 // " + rtarget);

def s_Rlane1_count =
if IsNaN(s_Rlane1) and
!IsNaN(s_Rlane1[1]) then 1
else s_Rlane1_count[1] + 1;


# Target Exit
plot s_Rlane1_t_ext = if IsNaN(s_Rlane1) then GetValue(s_Rlane1_t, s_Rlane1_count) else GetValue(s_Rlane1_t, s_Rlane1_count);
s_Rlane1_t_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_t_ext.AssignValueColor(Color.WHITE);
s_Rlane1_t_ext.SetLineWeight(1);

def s_Rlane1_targetmet = if low <= s_Rlane1_t_ext then 1 else 0;
#def s_Rlane1_targetmet2 = if (low <= s_Rlane1_t_ext) then (s_Rlane1_t_ext) else (Lowest(low[1], length_rlevel));

AddOrder(OrderType.Buy_TO_CLOSE, s_Rlane1_targetmet, s_Rlane1_t_ext, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // " + rtarget);


# SL Exit
plot s_Rlane1_sl_ext = if IsNaN(s_Rlane1) then GetValue(s_Rlane1_sl, s_Rlane1_count) else GetValue(s_Rlane1_sl, s_Rlane1_count);
s_Rlane1_sl_ext.SetPaintingStrategy(PaintingStrategy.DASHES);
s_Rlane1_sl_ext.AssignValueColor(Color.WHITE);
s_Rlane1_sl_ext.SetLineWeight(1);

def s_Rlane1_slmet = if high >= s_Rlane1_sl_ext then 1 else 0;
#def s_Rlane1_slmet2 = if (high >= s_Rlane1_sl_ext) then (s_Rlane1_sl_ext) else (Highest(high[1], length_rlevel));

AddOrder(OrderType.Buy_TO_CLOSE, s_Rlane1_slmet, s_Rlane1_sl_ext, s_Rlane1_maxsize, Color.MAGENTA, Color.MAGENTA, "S Rlane1 // SL");
hi @K2chungus
Any progress on your multi strategy system?
Please post it.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
488 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