Correct the code please

SET A = REF(HIGH, 1)

SET B = REF(HIGH, 2)

SET C = REF(HIGH, 3)

SET D = REF(HIGH, 4)

SET E= REF(CLOSE, 5)

E > A AND E > B AND E > C AND E > D
please check and correct the algo on 15 minutes chart

You can directly use the REF() in the condition inserted of defining it in SET which makes it simple.

1 Like

Hi AlgoGeek, Here I’m requesting you to give me code for the strategy which is combination of MA20 and PSAR.
Conditions:

  • It has to generate Buy signal when MA 20 is up trend and the price is crossing PSAR. Trigger price and SL should be Rs. 1.5 from where the signal generated.
  • Same for sell. When MA 20 is down and the price crossing below PSAR, Sell signal should generate. Trigger and SL is same as mentioned above!

I’ve tried lot to coding for the same but all were wrong. Also I couldn’t add combined signals for back testing.
Kindly do the needful!!!

Thanx!
-Dhamu