My logic is explained below. Kindly let me know the code for he same

My logic is explained below. Kindly let me know the code for he same.

Buy on the previous day’s high. Stop loss for Nifty is 30 points. If it moves in the direction of the trade, then the stop loss moves to the previous day’s low or 30 pts which ever is lower. Similarly for Short positions as well.

Buy Expression: CLOSE>=REF(HIGH,1)

Sell Expression: CLOSE<=REF(LOW,1)

Its not possible to put constant values for Stoploss

1 Like

1 in the parameter means the previous candle right? So for this case, we need to have a daily chart?

Yes you are correct, 1 means previous days candle. And ya we need to load daily chart for the same.