Source code
v1.0.0//@version=6
// ICODERX Trading — MIT License. Educational example.
indicator("ICODERX EMA Crossover", overlay=true)
fastLength = input.int(9, "Fast EMA", minval=1)
slowLength = input.int(21, "Slow EMA", minval=2)
fast = ta.ema(close, fastLength)
slow = ta.ema(close, slowLength)
plot(fast, "Fast EMA", color=color.aqua)
plot(slow, "Slow EMA", color=color.orange)
longSignal = ta.crossover(fast, slow) and barstate.isconfirmed
plotshape(longSignal, title="Bullish cross", style=shape.triangleup, location=location.belowbar, color=color.lime, size=size.tiny)
alertcondition(longSignal, "Bullish cross", "Fast EMA crossed above slow EMA")
How it works
A transparent two-average trend indicator with alerts confirmed at candle close.
Install on TradingView
- Open a TradingView chart and select Pine Editor.
- Create a new indicator and replace its contents with the complete source below.
- Save and select Add to chart. For alerts, create an Alert and select the script condition where available.
Configuration and examples
Begin with the defaults to understand behavior, then adjust for your timeframe. Compare trending, declining and ranging periods. Evaluate signals after candles close.
Limitations
Indicators use historical inputs and lag price. Open-candle values change on every tick. This code places no orders, promises no profit and has no verified backtest performance. This Pine Script runs in TradingView Pine Editor, not on the internal chart.
License
MIT — learn, modify and share with the copyright notice.
References
FAQ
Is the source code free?
Yes. Examples use the MIT license and can be modified and shared with attribution.
Does this guarantee profit?
No. This is educational material. Independently validate assumptions, costs and risks.