//@version=6
// SPDX-License-Identifier: MIT
// © 2026 Bader Alrashdi — https://github.com/bader61888/saudi-pine-toolkit
indicator("Wyckoff Spring Upthrust", shorttitle="WySpring", overlay=true)
import bader61888/SaudiTA/1 as sta
rangeLen = input.int(20, "Range Length", minval=5)
volLen = input.int(20, "Volume SMA Length", minval=2)
volMult = input.float(1.2, "Volume Multiplier", minval=0.1, step=0.1)
onlySession = input.bool(false, "Only during Tadawul session")
[spring, upthrust] = sta.wyckoffSpringUpthrust(rangeLen, volLen, volMult)
bool ok = onlySession ? sta.inTadawulSession() : true
plotshape(spring and ok, "Spring", shape.labelup, location.belowbar, color.green, text="S", textcolor=color.white, size=size.tiny)
plotshape(upthrust and ok, "Upthrust", shape.labeldown, location.abovebar, color.red, text="UT", textcolor=color.white, size=size.tiny)
alertcondition(spring and ok, "Spring", "Wyckoff spring detected")
alertcondition(upthrust and ok, "Upthrust", "Wyckoff upthrust detected")