Can you code with Previous bar high and open

   Can you  please code me the below strategies : 

  Buy : Bar close > The high of immediate previous bar and Bar close > Bar open

   Sell : Bar close < The low of immediate previous bar and Bar close < Bar open.

Thanks,

Buy:

CLOSE > REF (HIGH, 1) AND CLOSE > OPEN

Sell:

CLOSE < REF (LOW, 1) AND CLOSE < OPEN
1 Like