OPEN-SOURCE SCRIPT

SMAcross-mvr

183
Overview

SMAcross-mvrNew is a flexible, non-repainting moving-average strategy designed for clarity, configurability, and reliable backtesting.
It supports multiple entry styles, optional layered exits, and full-capital position sizing, while remaining stable during chart zooming and dragging.

🚀 What’s New in v2
✅ Multiple Entry Modes

You can now choose how trades are entered:

Entry Mode A: Short SMA crosses Long SMA

Entry Mode B: Price crosses Long SMA

This allows both classic MA-crossover trading and trend-continuation pullback entries using the same strategy.

✅ Modular Exit System (Checkbox-Based)

Exit logic is now fully modular using independent checkboxes:

☑ Exit on opposite signal

☑ Exit when price closes beyond Short SMA

You may enable one, both, or neither.
If both are enabled, the strategy exits on whichever condition occurs first.

✅ Terminology Clarity

All labels, inputs, and alerts now use semantic naming:

Short SMA (formerly 13 SMA)

Long SMA (formerly 30 SMA)

This makes the strategy easier to understand and future-proof if SMA lengths are changed.

✅ Full-Capital Position Sizing

Each trade uses 100% of available equity, allowing performance to naturally compound over time during backtests.

✅ Optional Visual Enhancements

Optional cross price labels (can be toggled on/off)

Color-filled zone between Short and Long SMAs for quick trend recognition

Optional 200 SMA (off by default) for higher-timeframe context

✅ Alert-Ready (TV-Safe)

All alerts use static messages compatible with TradingView’s alert system, making the strategy suitable for:

Manual trade notifications

Webhook-based automation

Broker integrations

🔒 Design Principles

No repainting

No line continuations (TradingView-safe formatting)

Stable behavior when zooming or scrolling

Clear separation of entry logic, exit logic, and visuals

⚠️ Notes

This script is intended for educational and research purposes.
Always forward-test and apply proper risk management before live trading.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.