OPEN-SOURCE SCRIPT

EMA Crossover Backtest [BarScripts]

This indicator lets you backtest an EMA crossover strategy with built-in risk management and trade tracking. It simulates long and short trades based on EMA crossovers, allowing you to fine-tune entry conditions, stop-loss placement, and reward/risk settings.

🔹 How It Works:
Long Entry: Fast EMA crosses above Slow EMA, and price closes above Fast EMA.
Short Entry: Fast EMA crosses below Slow EMA, and price closes below Fast EMA.
Stop Loss: Set based on previous bars or a fixed amount.
Take Profit: Adjustable reward/risk ratio.
Higher Timeframe Confluence: Confirms trades based on a larger timeframe.
Trade Hours Filter: Limits trades to specific time windows.

🔹 Key Features:
✅ Shows Entry & Exit Points with visual trade lines.
✅ Customizable EMA Lengths to fit any strategy.
✅ P&L Tracking & Statistics to measure performance.
✅ Position Sizing Options: Fixed position, fixed risk, or percentage of balance.
✅ Commissions Tracking (based on total trades, not contracts).

Use this tool to fine-tune your EMA crossover strategy and see how it performs over time! 🚀

💬 Let me know your feedback—suggest improvements, report issues, or request new features!

免責聲明