I'm trying to write a code that points an arrow when there's a green candle between two red candles and a red candle between two green candles. Below is a screenshot example.
Here's what I have so far:
def Red_Bar = open > close;
def Green_Bar = close > open;
def Bullish_Order_Block = Red_Bar[3] is true && Green_Bar[2] is true && Red_Bar[1] is true;
Plot Bullish_OB = if Bullish_Order_Block is true then high[1] else double.nan;
Thank you in advance!
Here's what I have so far:
def Red_Bar = open > close;
def Green_Bar = close > open;
def Bullish_Order_Block = Red_Bar[3] is true && Green_Bar[2] is true && Red_Bar[1] is true;
Plot Bullish_OB = if Bullish_Order_Block is true then high[1] else double.nan;
Thank you in advance!