Pine Script (TradingView)
This is a TradingView Pine Script strategy example for this page concept. Paste it into the TradingView Pine Editor, add it to your chart, and run it in the Strategy Tester.
//@version=6
strategy("Supply & Demand Zones", overlay=true)
emaFast = ta.ema(close, 20)
emaSlow = ta.ema(close, 50)
bullStructure = close > emaFast and emaFast > emaSlow
bearStructure = close < emaFast and emaFast < emaSlow
liquidityGrab = low < ta.lowest(low, 10)[1] and close > open
longSignal = bullStructure and liquidityGrab
exitSignal = bearStructure
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")
plot(emaFast, "Fast", color=color.aqua)
plot(emaSlow, "Slow", color=color.orange)