Gann High Low Indicator from TradingView
Rich (BB code):
# Gann High Low
# Converted by theelderwand
# Original https://in.tradingview.com/script/XNQSLIYb-Gann-High-Low/
input HPeriod= 13;
input LPeriod= 21;
def HLd = if close > SimpleMovingAvg(high, HPeriod)[1]
then 1
else (if close< SimpleMovingAvg(low, LPeriod)[1]
then -1
else 0);
def HLv = if HLd != 0 then HLd else 0;
plot HiLo = if HLv == -1
then SimpleMovingAvg(high, HPeriod)
else SimpleMovingAvg(low, LPeriod);
HiLo.AssignValueColor(if HLv==-1 then Color.Red else Color.Green);