Simple intraday trading strategy. Code Needed to Back test on trading system

Hello Fellas,

Could you help me providing the code for the below trading strategy.

I use 3 min charts and use 2 studies (RSI volume with 10 periods’ parameter and True Range). plz look at the attached image and I have plotted my signals for entry and exit.


Scenario 1: SIMPLE LONG TRADE:

I am basically looking for previous 3 bars (Candle sticks) for making my position.

Entry for BUY will be if the following cases are true on both conditions

A - Out of any 3 bars, FIRST bar's closing value is lower than SECOND bar's closing value AND THIRD bar's low value is ABOVE the AVERAGE of SECOND bar's HIGH and LOW value

B. RSI's indicator's closing value of THIRD bar is BETWEEN 40 TO 80 (not in OVER BROUGHT ZONE)

If the above TWO cases are TRUE then BUYING ENTRY will be the OPENING value of FOURTH bar.

EXIT entry or signal for the above trade will be;

THIRD bar's CLOSING value of TRUE RANGE indicator + CLOSING value of THIRD bar.

Scenario 2: SIMPLE LONG TRADE:

Similarly for SELLING i need the reverse above logic.

Entry for SELL will be if the following cases are true on both conditions

A - Out of any 3 bars, FIRST bar's closing value is higher than SECOND bar's closing value AND THIRD bar's high value is ABOVE the AVERAGE of SECOND bar's HIGH and LOW value

B. RSI's indicator's closing value of THIRD bar is BETWEEN 60 TO 20 (NOT IN OVER SOLD ZONE)

If the above TWO cases are TRUE then SELLING ENTRY will be the OPENING value of FOURTH bar.

EXIT entry or signal for the above trade will be;

CLOSING value of THIRD bar - THIRD bar's CLOSING value of TRUE RANGE indicator.

As per the above condition

Buy Script:

REF(CLOSE,3)< REF(CLOSE,2) AND REF(LOW,1) > (REF(HIGH,2)/REF(LOW,2))/2 AND RSI(CLOSE,10)>40 AND RSI(CLOSE,10)<80

Exit Buy:

TR(CLOSE)

Sell Script:

REF(CLOSE,3)> REF(CLOSE,2) AND REF(HIGH,1) > (REF(HIGH,2)/REF(LOW,2))/2 AND RSI(CLOSE,10)>20 AND RSI(CLOSE,10)<60

Exit Sell:

TR(CLOSE)

this is interesting. is there any online guide or resource (preferably free) that teaches scripting like what you have posted.

you can check tradescript help guide under help menu in zerodha pi

Thank you very much.