The document defines two functions - isHigherHigh() and isLowerLow() - to identify bullish and bearish candlestick patterns respectively. It then uses these functions to color the current and previous two bars purple for bullish patterns and yellow for bearish patterns if they meet the criteria.
The document defines two functions - isHigherHigh() and isLowerLow() - to identify bullish and bearish candlestick patterns respectively. It then uses these functions to color the current and previous two bars purple for bullish patterns and yellow for bearish patterns if they meet the criteria.
The document defines two functions - isHigherHigh() and isLowerLow() - to identify bullish and bearish candlestick patterns respectively. It then uses these functions to color the current and previous two bars purple for bullish patterns and yellow for bearish patterns if they meet the criteria.
isHigherHigh() => high>high[1] and high[1]>high[2] and close>close[1] and
close[1]>close[2] and close>open and close[1]>open[1] and close[2]>open[2] and low>open[1] and low[1]>open[2] and (open+low)<(open+close) barcolor(isHigherHigh()? #673ab7 :na) barcolor(isHigherHigh()?#673ab7 :na, -1) barcolor((isHigherHigh() and close>open)? #673ab7 :na, -2)
isLowerLow() => low<low[1] and low[1]<low[2] and close<close[1] and
close[1]<close[2] and close<open and close[1]<open[1] and close[2]<open[2] and high<open[1] and high[1]<open[2]
barcolor(isLowerLow()? yellow :na)
barcolor(isLowerLow()? yellow :na, -1) barcolor((isLowerLow() and close<open)? yellow :na, -2)