True range code for exit or profit booking

i use a strategy known as simple strategy it uses MACD and RSI i have code for that strategy

i need code for exit (or)profit booking using ATR(True Range)

i use ATR(True Range) for booking profit.

  1. i use ATR value plus the entry price for long
    example ATR value of nifty future is “35” and my entry is at 8050 my profit booking would be 8050+35=8085

and for stop loss
2. i use half of the ATR value minus entry
example ATR value of nifty future is ‘35’ and my stop would 35/2=17.5 minus my entry price 8050-17.5=8032.5
can anybody give me code for exit long script and exit short script

i dont know whether stoploss rule will be code able or n’t but i assume profit target can be coded so can anybody give me code for profit booking that would be great

thank u,

YES, You can use price alert for this as per below syntax

TR(CLOSE)>8050