1. Label-Based Debugging
```pinescript
// Debug label showing multiple values
if barstate.islast
debugText = "RSI: " + str.tostring(rsiValue, "#.##") + "\n" + "MA: " + str.tostring(maValue, "#.##") + "\n" + "Signal: " + (buySignal ? "BUY" : "NEUTRAL")
label.new(bar_index, high * 1.05, debugText, style=label.style_label_down, color=color.yellow, textcolor=color.black)
```
2. Table-Based Monitor
```pinescript
// Real-time variable monitor table
var table debugTable = table.new(position.top_right, 2, 10, bgcolor=color.black, border_width=1)
if barstate.islast
table.cell(debugTable, 0, 0, "Variable", bgcolor=color.gray, text_color=color.white)
table.cell(debugTable, 1, 0, "Value", bgcolor=color.gray, text_color=color.white)
table.cell(debugTable, 0, 1, "Bar Index", text_color=color.white)
table.cell(debugTable, 1, 1, str.tostring(bar_index), text_color=color.yellow)
table.cell(debugTable, 0, 2, "Close Price", text_color=color.white)
table.cell(debugTable, 1, 2, str.tostring(close, "#.####"), text_color=color.yellow)
table.cell(debugTable, 0, 3, "Signal Active", text_color=color.white)
table.cell(debugTable, 1, 3, signalActive ? "YES" : "NO", text_color=signalActive ? color.green : color.red)
```
3. Historical Value Tracker
```pinescript
// Track historical values for debugging
var array histValues = array.new()
var array histBarIndex = array.new()
if condition
array.push(histValues, valueToTrack)
array.push(histBarIndex, bar_index)
if array.size(histValues) > 50 // Keep last 50 values
array.shift(histValues)
array.shift(histBarIndex)
// Display historical values
if barstate.islast and array.size(histValues) > 0
for i = 0 to math.min(array.size(histValues) - 1, 10)
label.new(array.get(histBarIndex, i), array.get(histValues, i), str.tostring(array.get(histValues, i)), style=label.style_circle, size=size.tiny)
```
4. Repainting Detector
```pinescript
// Detect potential repainting
var bool repaintDetected = false
var float previousValue = na
if not barstate.isrealtime
if not na(previousValue) and previousValue != value[1]
repaintDetected := true
previousValue := value
if barstate.islast and repaintDetected
label.new(bar_index, high * 1.1, "β οΈ REPAINTING DETECTED", style=label.style_label_down, color=color.red, textcolor=color.white)
```
5. Calculation Flow Tracer
```pinescript
// Trace calculation flow
var string calcFlow = ""
calcFlow := "Step 1: Input = " + str.tostring(input) + "\n"
intermediate1 = input * 2
calcFlow := calcFlow + "Step 2: x2 = " + str.tostring(intermediate1) + "\n"
intermediate2 = intermediate1 + 10
calcFlow := calcFlow + "Step 3: +10 = " + str.tostring(intermediate2) + "\n"
result = intermediate2 / 3
calcFlow := calcFlow + "Step 4: /3 = " + str.tostring(result)
if barstate.islast
label.new(bar_index - 10, high, calcFlow, style=label.style_label_left, size=size.small)
```