OPEN-SOURCE SCRIPT

3 SMA Crossover Signals - Improved SELL Timing

SELL Logic Adjustment: SELL Signal Logic: Uses the ta.crossunder(sma2, sma3) condition to detect SMA 2 to below SMA 3 crossovers early. Added the condition that SMA 1 > SMA 2 > SMA 3 to ensure all SMAs are in descending order: SMA 1 (highest) → SMA 2 → SMA 3 (lowest). Change: Condition ta.crossunder(sma2, sma1) removed to speed up signal detection, as it slowed down SELL signals. BUY Signal: No change, keep using: SMA 2 cuts SMA 3 from bottom to top. Sequence SMA 1 < SMA 2 > SMA 3. Result: BUY Signal: A green arrow appears below the candle when a BUY condition is detected. SELL Signal: A red arrow appears faster above the candle when a SELL condition is detected. How to Use: Copy this code into the Pine Script Editor in TradingView. Save and add to your chart. Signal: BUY Signal (green arrow): Appears when the SMA crosses upwards. SELL Signal (red arrow): Appears faster when the SMA crosses downwards.
Bands and ChannelsBreadth IndicatorsCycles

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer