Free tool
Generate TradingView Pine Script from a template.
Pick one of eight strategy templates, tune the parameters, and copy paste-ready Pine v5 into TradingView. Nothing is saved on our side - everything runs in your browser. Want to save drafts, run compile checks, ingest backtest reports, and get AI-assisted critique? Those live inside the paid AI Lab.
Fast/slow EMA crossover with ATR-backed stop and risk-reward target.
Fit: Works on liquid futures, indices, and major FX. Best on 15m-1h timeframes during clear trending sessions.
Generated Pine is a paste-ready draft, not compiler-verified. Validate it in TradingView before using live.
Demo limits: visual condition composer, save, compile checks, version history, and backtest ingestion are paid features.See pricing.
1//@version=52// Generated Pine is a paste-ready draft, not compiler-verified. Validate it in TradingView before using live.3strategy("Delta-X EMA Trend Follow", overlay=true, initial_capital=100000, commission_type=strategy.commission.percent, commission_value=0.01, pyramiding=0)45// Built with Delta-X Visual Builder. Target: ES / 5m.6fastLength = input.int(9, "Fast / primary length", minval=1, maxval=500)7slowLength = input.int(21, "Slow / filter length", minval=1, maxval=500)8stopLossPct = input.float(1, "Stop loss %", minval=0.05, maxval=20, step=0.05)9takeProfitPct = input.float(2, "Take profit %", minval=0.05, maxval=100, step=0.05)10longEnabled = input.bool(true, "Enable long entries")11shortEnabled = input.bool(true, "Enable short entries")1213fast = ta.ema(close, fastLength)14slow = ta.ema(close, slowLength)15plot(fast, "Fast EMA", color=color.new(color.lime, 0), linewidth=2)16plot(slow, "Slow EMA", color=color.new(color.orange, 0), linewidth=2)17longSignal = ta.crossover(fast, slow)18shortSignal = ta.crossunder(fast, slow)1920activeLongSignal = longEnabled and longSignal21activeShortSignal = shortEnabled and shortSignal2223longStop = close * (1 - stopLossPct / 100)24longTarget = close * (1 + takeProfitPct / 100)25shortStop = close * (1 + stopLossPct / 100)26shortTarget = close * (1 - takeProfitPct / 100)2728if activeLongSignal29 strategy.entry("DZ Long", strategy.long)30 strategy.exit("DZ Long Exit", "DZ Long", stop=longStop, limit=longTarget)3132if activeShortSignal33 strategy.entry("DZ Short", strategy.short)34 strategy.exit("DZ Short Exit", "DZ Short", stop=shortStop, limit=shortTarget)3536alertcondition(activeLongSignal, "delta-x-ema-trend-follow-long", "Delta-X EMA Trend Follow long setup on {{ticker}} {{interval}}")37alertcondition(activeShortSignal, "delta-x-ema-trend-follow-short", "Delta-X EMA Trend Follow short setup on {{ticker}} {{interval}}")3839plotshape(activeLongSignal, title="Long Signal", style=shape.triangleup, location=location.belowbar, color=color.lime, size=size.tiny)40plotshape(activeShortSignal, title="Short Signal", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.tiny)