Fix Pine syntax: correct indentation for label assignments in flip and next-flip sections

This commit is contained in:
mindesbunister
2025-10-17 12:17:23 +02:00
parent adc78c0644
commit f3875470e4

View File

@@ -365,11 +365,11 @@ var label flipValLbl = na
if showFlipLevelValue and not na(flipLevel) if showFlipLevelValue and not na(flipLevel)
if not na(flipValLbl) if not na(flipValLbl)
label.delete(flipValLbl) label.delete(flipValLbl)
// High-contrast: black text on green (bull), white text on maroon (bear) // High-contrast: black text on green (bull), white text on maroon (bear)
flipLblBg = flipLineAutoColor ? (trend == 1 ? color.new(color.green, 0) : color.new(color.maroon, 0)) : flipLineCustomCol flipLblBg = flipLineAutoColor ? (trend == 1 ? color.new(color.green, 0) : color.new(color.maroon, 0)) : flipLineCustomCol
flipLblTxt = flipLineAutoColor ? (trend == 1 ? color.black : color.white) : color.white flipLblTxt = flipLineAutoColor ? (trend == 1 ? color.black : color.white) : color.white
flipValLbl := label.new(bar_index, flipLevel, text="Flip Level: " + str.tostring(flipLevel, format.mintick), flipValLbl := label.new(bar_index, flipLevel, text="Flip Level: " + str.tostring(flipLevel, format.mintick),
style=label.style_label_left, color=flipLblBg, textcolor=flipLblTxt, yloc=yloc.price, size=size.tiny) style=label.style_label_left, color=flipLblBg, textcolor=flipLblTxt, yloc=yloc.price, size=size.tiny)
// Next flip preview levels (dynamic thresholds) // Next flip preview levels (dynamic thresholds)
nextBullLevel = tsl + aBufferATR * atr // price needed to start bull flip counting nextBullLevel = tsl + aBufferATR * atr // price needed to start bull flip counting
@@ -391,15 +391,15 @@ if showNextFlipValue
if showNextBullFlip and nextBullActive and not na(nextBullLevel) if showNextBullFlip and nextBullActive and not na(nextBullLevel)
if not na(nextBullLbl) if not na(nextBullLbl)
label.delete(nextBullLbl) label.delete(nextBullLbl)
// Bright lime background with black text for readability // Bright lime background with black text for readability
nextBullLbl := label.new(bar_index, nextBullLevel, text="Next Bull Flip: " + str.tostring(nextBullLevel, format.mintick) + (aConfirmBars > 1 ? " (" + str.tostring(aConfirmBars) + " closes)" : ""), nextBullLbl := label.new(bar_index, nextBullLevel, text="Next Bull Flip: " + str.tostring(nextBullLevel, format.mintick) + (aConfirmBars > 1 ? " (" + str.tostring(aConfirmBars) + " closes)" : ""),
style=label.style_label_left, color=color.new(color.lime, 0), textcolor=color.black, yloc=yloc.price, size=size.tiny) style=label.style_label_left, color=color.new(color.lime, 0), textcolor=color.black, yloc=yloc.price, size=size.tiny)
if showNextBearFlip and nextBearActive and not na(nextBearLevel) if showNextBearFlip and nextBearActive and not na(nextBearLevel)
if not na(nextBearLbl) if not na(nextBearLbl)
label.delete(nextBearLbl) label.delete(nextBearLbl)
// Darker red background for contrast // Darker red background for contrast
nextBearLbl := label.new(bar_index, nextBearLevel, text="Next Bear Flip: " + str.tostring(nextBearLevel, format.mintick) + (aConfirmBars > 1 ? " (" + str.tostring(aConfirmBars) + " closes)" : ""), nextBearLbl := label.new(bar_index, nextBearLevel, text="Next Bear Flip: " + str.tostring(nextBearLevel, format.mintick) + (aConfirmBars > 1 ? " (" + str.tostring(aConfirmBars) + " closes)" : ""),
style=label.style_label_left, color=color.new(color.maroon, 0), textcolor=color.white, yloc=yloc.price, size=size.tiny) style=label.style_label_left, color=color.new(color.maroon, 0), textcolor=color.white, yloc=yloc.price, size=size.tiny)
plot(upTrend, "Up Trend", color=color.new(color.green, 0), style=plot.style_linebr, linewidth=2) plot(upTrend, "Up Trend", color=color.new(color.green, 0), style=plot.style_linebr, linewidth=2)
plot(downTrend, "Down Trend", color=color.new(color.red, 0), style=plot.style_linebr, linewidth=2) plot(downTrend, "Down Trend", color=color.new(color.red, 0), style=plot.style_linebr, linewidth=2)