I NEED CODE FOR MY CONCEPT ON PI SCANNER & EA

Good day,

It would be helpful if u can provide code for below concept,

time frame : one hour candle

  1. four candle before current candle high should be higher that thrid candle
  2. fouth candle low is lower than third candle high.
  3. second candle high should be less than fourth candle high.
  4. second candle high should be greater than third candle high.
  5. second candle low should be higher that third candle low
  6. first candle (present candle) high should be less than second candle high
  7. first candle low should be more than second candle low

if above condition meets the buy above high of current candle or sell below low of current candle.

can u pls code it for me…

i hv done following code for buy n sell but not working correctly…

REF(H,4) > REF(H,3) AND REF(L,4) > REF(L,3) AND REF(H,2) < REF(H,4) AND REF(L,2) > REF(L,3) AND REF(L,2) < REF(H,3) AND REF(L,2) < (REF(L,1) AND REF (H,2) > REF(H,1) AND H > REF(H,1)

kindly do the needful …