Profitable Moving Average Crossover

8 971
Hello friends,

I'm glad to introduce a powerful research and optimization tool that takes the classic moving average crossover concept to a new level. Instead of relying on guesswork or fixed MA types, it lets you objectively discover the most profitable moving average pair for any instrument and timeframe.

🛠 How It Works

Moving average crossovers are among the most popular trading systems. A buy signal occurs when a shorter (faster) moving average crosses above a longer (slower) one, and a sell signal when it crosses below. The system's responsiveness — and the number of generated signals — depend on the chosen MA lengths and types.

This script evaluates 61 moving average types (including Jurik, Kaufman, Ehlers, Apirine, and others) and backtests all possible crossover combinations either across the entire chart history or within a custom backtest window. It then plots continuous profit metric lines for each crossover type and displays the top 5 performers in a results table. Each MA type is color-coded, allowing quick visual identification of which systems have historically delivered the strongest results.

🔥 Key Features
  • Pine Script V6 — optimized for performance and stability
  • Tests 61 moving average types, from classic to adaptive designs
  • Custom Backtest Window — analyze the entire history or a specific date range
  • Continuous profit curves for every crossover type plotted on chart
  • Top 5 crossover systems displayed in a compact summary table
  • Color-coded MA identifiers for fast visual comparison
  • Supports custom parameters for advanced MAs (JMA, ALMA, McGinley Dynamic, Adaptive Laguerre Filter, etc.)
  • Works seamlessly across all assets and timeframes
NOTE: Results will vary across different tickers and timeframes. Seeing strong performance in one preview does not imply similar profitability elsewhere — this variability is normal due to differing market structures.

NOTE 2: You can experiment with the tool independently or request a full study, in which case I'll share a spreadsheet of all backtest results with you.

👋 Good luck and happy trading!

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.