After you add the STDEV zones then add this to the bottom of the script for labels
Code:
# === Oscillator Range Analysis ===
def isOverbought2 = GannOsc >= UpperLine2;
def isOverbought1 = GannOsc >= UpperLine1;
def isOversold2 = GannOsc <= LowerLine2;
def isOversold1 = GannOsc <= LowerLine1;
def oscZone =
if isOverbought2 then 2
else if isOverbought1 then 1
else if isOversold2 then -2
else if isOversold1 then -1
else 0;
def forecastSignal =
if upSignal and oscZone <= -1 then 1 # Strong Buy
else if downSignal and oscZone >= 1 then -1 # Strong Sell
else if upSignal then 2 # Buy Opportunity
else if downSignal then -2 # Sell Opportunity
else 0;
# === AddLabel Displays ===
AddLabel(yes,
if upSignal then "TREND: Bullish (UP)"
else if downSignal then "TREND: Bearish (DOWN)"
else "TREND: Neutral/Sideways",
if upSignal then Color.GREEN
else if downSignal then Color.RED
else Color.GRAY
);
AddLabel(yes,
"GANN STATE: " +
(if lastState == 1 then "Bull Zone"
else if lastState == -1 then "Bear Zone"
else "Neutral"),
if lastState == 1 then CreateColor(0, 255, 0)
else if lastState == -1 then CreateColor(255, 165, 0)
else Color.GRAY
);
AddLabel(yes,
"OSC Range: " +
(if oscZone == 2 then "Overbought (2σ)"
else if oscZone == 1 then "Overbought (1.5σ)"
else if oscZone == -1 then "Oversold (1.5σ)"
else if oscZone == -2 then "Oversold (2σ)"
else "In Range"),
if oscZone >= 1 then Color.RED
else if oscZone <= -1 then Color.GREEN
else Color.LIGHT_GRAY
);
AddLabel(yes,
"FORECAST: " +
(if forecastSignal == 1 then "Strong BUY Zone"
else if forecastSignal == -1 then "Strong SELL Zone"
else if forecastSignal == 2 then "Buying Opportunity"
else if forecastSignal == -2 then "Selling Opportunity"
else "Wait / Watch"),
if forecastSignal == 1 or forecastSignal == 2 then Color.GREEN
else if forecastSignal == -1 or forecastSignal == -2 then Color.RED
else Color.YELLOW
);