OPEN-SOURCE SCRIPT
Risk Management & Auto-Close (v6)

This strategy is a dual moving average crossover system designed for reliable backtesting and trade management. It opens trades on fast/slow MA crossovers and includes multiple built-in risk controls to ensure every trade is properly simulated in TradingView’s Strategy Tester.
Key Features:
📈 MA Crossover Logic: Choose between SMA, EMA, or WMA with adjustable fast/slow periods.
🔄 Auto Flip Positions: Automatically closes the opposite trade before opening a new one.
🎯 Risk Management: Optional take profit, stop loss, and trailing stop parameters.
⏳ Auto-Close: Forces trades to close after a set number of bars (avoids “open forever” trades).
🧪 Debug Tools: Labels, counters, and optional forced trades for testing and diagnostics.
📊 Status Table: Displays signals, trades, and net profit directly on the chart.
This makes it ideal for traders who want a clean backtest report, easy visualization of signals, and confidence that the strategy logic executes properly across different timeframes and instruments.
Key Features:
📈 MA Crossover Logic: Choose between SMA, EMA, or WMA with adjustable fast/slow periods.
🔄 Auto Flip Positions: Automatically closes the opposite trade before opening a new one.
🎯 Risk Management: Optional take profit, stop loss, and trailing stop parameters.
⏳ Auto-Close: Forces trades to close after a set number of bars (avoids “open forever” trades).
🧪 Debug Tools: Labels, counters, and optional forced trades for testing and diagnostics.
📊 Status Table: Displays signals, trades, and net profit directly on the chart.
This makes it ideal for traders who want a clean backtest report, easy visualization of signals, and confidence that the strategy logic executes properly across different timeframes and instruments.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
✨ Shared Success | Trusted Growth ✨
🚀 Profit Sharing 50/50 – Discipline & Transparency
📊 Free Signals: 👉 t.me/Forexcryptoaccountms
💼 Account Management: DM me or join the channel
🚀 Profit Sharing 50/50 – Discipline & Transparency
📊 Free Signals: 👉 t.me/Forexcryptoaccountms
💼 Account Management: DM me or join the channel
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
✨ Shared Success | Trusted Growth ✨
🚀 Profit Sharing 50/50 – Discipline & Transparency
📊 Free Signals: 👉 t.me/Forexcryptoaccountms
💼 Account Management: DM me or join the channel
🚀 Profit Sharing 50/50 – Discipline & Transparency
📊 Free Signals: 👉 t.me/Forexcryptoaccountms
💼 Account Management: DM me or join the channel
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.