Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
Quadratic Trend Acceleration is a trend-ignition strategy for MetaTrader 5 that fits a second-order (quadratic) least-squares regression — a parabola — to recent price and reads its acceleration, the rate at which a trend is strengthening or fading. Most trend tools rely on a straight-line (linear) regression or a moving average, which can only tell you which way price is leaning. Quadratic Trend Acceleration goes one step further by measuring the curvature of price, so it aims to detect the precise moment a quiet, drifting market begins to bend into an accelerating move.
The core idea comes from calculus. A linear fit gives you velocity — the slope, or how fast price is moving. A quadratic fit adds the second derivative: the curvature, which behaves like acceleration. By fitting the equation y = a·x² + b·x + c to the last several closing prices, the strategy extracts two readings: the curvature (from the a coefficient) and the endpoint slope (velocity at the newest bar). Both are then divided by the Average True Range (ATR) — a common volatility measure — so the same thresholds behave consistently across different symbols and timeframes.
This is best understood as a learning tool for traders who want to study momentum and trend dynamics rather than a shortcut to results. It is designed for markets that transition from range-bound drift into directional acceleration, and it deliberately tries to avoid both flat chop and tired, decelerating late-trend moves. If you are interested in how regression math, volatility normalization, and signal timing fit together in an automated system, this strategy offers a clear, self-contained example to examine.
How It Works
The strategy processes one signal per newly closed bar on the chart's primary timeframe. On each closed bar it rebuilds the quadratic fit and evaluates whether a fresh acceleration "ignition" has occurred.
- The quadratic fit: The strategy performs a least-squares fit of a parabola to the last
RegPeriodclosing prices. The x-axis is centered so the math simplifies, and the newest bar sits at the right edge of the window. - Acceleration reading (AccelScore): From the fit's
acoefficient it computes how many ATRs the curve bends away from a straight line at the window's edge. This is a scale-free measure of acceleration — positive when price is curving upward, negative when curving downward. - Velocity reading (SlopeScore): It also computes the endpoint slope (the first derivative at the newest bar), divided by ATR, giving velocity expressed in "ATR per bar."
- Long entry signal: The strategy signals a buy when AccelScore freshly crosses above the
MinAccelthreshold (it was inside the band on the previous bar) and the endpoint velocity is already positive above theSlopeFloor. This combination is meant to isolate the moment upward curvature ignites while price is already leaning up. - Short entry signal: Symmetrically, it signals a sell when AccelScore freshly crosses below
-MinAcceland the endpoint velocity is negative below-SlopeFloor. - The "fresh cross" requirement: By requiring the acceleration to have been inside the band on the prior bar and outside it now, the strategy targets an ignition event rather than a persistent state. This is intended to filter out flat chop (where curvature hovers near zero) and decelerating moves (where curvature points against the prevailing velocity).
- Exit-and-reverse: If a position is already open and an opposite ignition fires, the strategy first closes the current position, then may open a new one in the opposite direction.
- Stop-loss logic: For a long, the stop is placed
SlAtrMult × ATRbelow entry; for a short, the same distance above entry. The stop scales with current volatility. - Take-profit logic: The target is placed
TpAtrMult × ATRaway from entry in the trade's direction. With the defaults, the target is wider than the stop, giving a reward-to-risk ratio greater than one on paper. - Spread filter: Before sending an order, the strategy skips the trade if the current spread is wider than
MaxSpreadPoints, which helps keep simulated fills realistic (set to 0 to disable).

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| RegPeriod | 20 | 8 | 60 | Number of closing prices fitted by the quadratic regression window. Larger values smooth the curve and react more slowly. |
| MinAccel | 0.30 | 0.05 | 2.0 | Curvature ignition threshold, measured in "ATRs of bend." Higher values demand a sharper acceleration before signalling. |
| SlopeFloor | 0.02 | 0.0 | 0.30 | Minimum endpoint velocity (ATR per bar) that must agree with the curvature direction for a signal to fire. |
| AtrPeriod | 14 | 7 | 30 | Lookback period for the ATR used to volatility-normalize the acceleration, slope, stop, and target. |
| SlAtrMult | 2.0 | 1.0 | 4.0 | Stop-loss distance as a multiple of ATR. |
| TpAtrMult | 3.0 | 1.0 | 6.0 | Take-profit distance as a multiple of ATR. |
| MaxSpreadPoints | 30 | 0 | 200 | Maximum allowed spread (in points) to accept a trade; 0 disables the filter. |
| Lots | 0.10 | 0.01 | 1.0 | Trade volume in lots. |

Recommended Chart Settings
This strategy was designed to run on a single symbol and timeframe using the chart's primary timeframe. A common starting point for studying acceleration-based systems is a liquid major forex pair such as EUR/USD on an intraday timeframe like the H1 (1-hour) chart, where trends and ranges alternate frequently enough to exercise the ignition logic. The ATR normalization is designed to make the thresholds portable, so you can also study its behavior on other majors or higher timeframes. Keep in mind that results will vary considerably across different symbols, timeframes, and market conditions, and no single configuration is optimal everywhere. Treat any setting as a starting point for your own testing rather than a fixed recommendation.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
What to Consider Before Using This EA
Quadratic Trend Acceleration has a clear conceptual strength: by measuring curvature rather than just slope, it attempts to catch trends as they ignite instead of chasing them after they are well established. The volatility normalization via ATR is a thoughtful design choice that helps the same thresholds behave more consistently across instruments, and the fresh-cross requirement is a genuine effort to avoid signalling on stale, persistent conditions.
That said, every approach has limitations. Curvature is inherently a second-order measurement, which makes it sensitive to noise — a single erratic bar can distort the parabola fit and produce a false ignition, especially with short RegPeriod values. Because the entry depends on a fresh cross, choppy markets that repeatedly poke across the acceleration band can generate whipsaw signals that are stopped out. Conversely, in strong, smooth trends the acceleration may ignite once and then never re-cross, meaning the strategy could sit out large portions of a move after an early exit. Fixed ATR-based stops and targets also do not adapt to changing trend structure once a position is open. As with any single-indicator system, performance can degrade sharply during low-volatility ranges, news-driven spikes, or regime shifts. Study it in a controlled environment before drawing conclusions.
Risk Management Tips
Sound risk management matters more than any single entry signal. Consider these general principles as you study this or any strategy:
- Position sizing: Size trades so a losing streak does not threaten your account. Many educational sources suggest risking no more than 1–2% of account equity per trade.
- Use a demo account first: Test the EA on a demo or backtest environment across varied market conditions before considering any live use, so you understand its behavior without financial exposure.
- Understand drawdown: Every strategy experiences losing periods. Review the depth and length of historical drawdowns so you know what a normal rough patch looks like and can stay disciplined.
- Respect the stop-loss: Avoid overriding or widening stops mid-trade — doing so undermines the risk framework the ATR multiples are meant to enforce.
- Diversify and avoid over-leverage: Concentrating risk in one symbol or using excessive leverage amplifies both volatility and the emotional pressure of trading.
- Keep records: Track your settings and outcomes so you can learn systematically rather than reacting to individual trades.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: QuadraticTrendAcceleration.ex5 (56 downloads)
- Source Code: QuadraticTrendAcceleration.mq5 (62 downloads)
- Documentation: QuadraticTrendAcceleration.pdf (57 downloads)