Pine Script (TradingView)
Este e um exemplo de estrategia Pine Script do TradingView para o conceito desta pagina. Cole no Pine Editor do TradingView, adicione ao grafico e execute no Strategy Tester.
//@version=6
strategy("Fair Value Gap (FVG) Strategy", 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)