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?
The Symbolic Entropy Regime Trend is a trend-following expert advisor that borrows a tool from information theory — Shannon entropy, a measure of how disordered or unpredictable a sequence of events is — and applies it to price action. Instead of relying on moving averages, oscillators, or chart patterns, the strategy treats each completed bar as a "symbol" emitted by the market. Every bar's volatility-normalized return is sorted into one of four categories (strong up, mild up, mild down, strong down), and the strategy then measures how evenly those symbols are spread across the recent window. A lopsided, clustered distribution signals order; an even, scattered distribution signals randomness.
The core hypothesis is that markets alternate between two states. In an ordered (low-entropy) regime, moves cluster into a few buckets, momentum tends to persist, and a net direction is visible. In a disordered (high-entropy) regime, symbols spread out evenly and price behaves closer to random noise. The Symbolic Entropy Regime Trend is designed to participate only during ordered, trending conditions and to stand aside when the market looks random. It is a directional, regime-filtered trend strategy rather than a scalper or a mean-reversion system.
As a learning tool, this EA is well suited to traders who want to explore an unconventional, first-principles approach to regime detection — one built entirely from log returns, standard deviation, and entropy rather than from off-the-shelf indicators. It is best viewed as a study in how quantitative filters can express the idea of "trade with the trend, but only when the trend is real." It is not a shortcut to profits, and it should be examined, tested, and understood before it is ever considered for a live account.
How It Works
The strategy evaluates the market once per completed bar. On each new bar it rebuilds its statistics from the most recent window of closes and then either manages an open position or looks for a new entry. Here is the logic in plain English:
- Log returns: For each bar in the window, the strategy computes the natural log return,
r = ln(Close / PreviousClose). This converts raw prices into comparable percentage-style moves. - Volatility normalization: It calculates the standard deviation (
sigma) of those returns and divides each return by it, producing a self-scaling "z" value. This lets the same thresholds work across quiet and volatile markets. - Drift (direction): The mean of the normalized returns becomes the Drift (D) — a simple measure of net direction. Positive drift means the window leaned upward; negative drift means it leaned downward.
- Symbolization: Each normalized return is placed into one of four buckets based on its sign and magnitude relative to the
StrongMoveThreshold(tau): strong down, mild down, mild up, strong up. - Order score: The strategy computes the Shannon entropy (H) of the four-bucket distribution and converts it into an Order score (O) = 1 − H / 2, which ranges from 0 (fully random) to 1 (fully concentrated).
The signals then follow directly from these two numbers:
- Long entry: the strategy signals a buy when the Order score is at or above
OrderThresholdand Drift is greater than+DriftMin. - Short entry: the strategy signals a sell when the Order score is at or above
OrderThresholdand Drift is less than−DriftMin. - Why both conditions matter: entropy is direction-blind, so a market that is orderly but simply alternating up-down-up-down can score high on Order while going nowhere. Requiring a minimum Drift filters out that "ordered chop" and keeps entries aligned with a genuine net direction.
Exits are handled three ways:
- Stop-loss: placed at
StopAtrMult × ATRaway from the entry price, where ATR is a manually computed average true range. - Take-profit: placed at
TpAtrMult × ATRaway from the entry price. With the defaults (stop 2×, target 3×), the intended reward-to-risk ratio is 1.5:1. - Regime-dissolution exit: if the Order score collapses below
ExitOrderThresholdwhile a trade is open, the strategy flattens the position immediately — the assumption being that the ordered regime that justified the trade has dissolved into randomness.
The EA never stacks trades: while any position for its magic number is open, it only manages that trade and will not add new entries.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Window | 40 | 20 | 120 | Number of completed bars used to build the symbol source and measure entropy and drift. |
| StrongMoveThreshold | 1.0 | 0.5 | 2.0 | The tau value (in standard deviations) that separates a "strong" move from a "mild" move when symbolizing returns. |
| OrderThreshold | 0.20 | 0.05 | 0.50 | Minimum Order score required to consider an entry; higher values demand a more clearly ordered regime. |
| DriftMin | 0.05 | 0.0 | 0.40 | Minimum absolute Drift required to enter; filters out ordered-but-directionless conditions. |
| ExitOrderThreshold | 0.10 | 0.0 | 0.40 | If the Order score falls below this while in a trade, the position is closed as the regime dissolves. |
| AtrPeriod | 14 | 5 | 40 | Number of bars used for the manual average-true-range calculation that sizes the stop and target. |
| StopAtrMult | 2.0 | 0.5 | 5.0 | Stop-loss distance as a multiple of ATR. |
| TpAtrMult | 3.0 | 1.0 | 8.0 | Take-profit distance as a multiple of ATR. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume in lots. |

Recommended Chart Settings
The Symbolic Entropy Regime Trend was designed to run on a single symbol and timeframe, evaluating one signal per completed bar. Because its thresholds are volatility-normalized, it can adapt to different instruments, but a liquid major forex pair (for example EUR/USD) on an intraday-to-swing timeframe such as H1 or H4 is a sensible starting point for study. These timeframes give the 40-bar default window enough history to produce a stable entropy estimate without reacting to every tick of noise.
Keep in mind that entropy and drift behave differently across asset classes and sessions. A window and threshold set that looks reasonable on one pair may need adjustment on another, and results will vary considerably across different market conditions. Treat any chart setting as a hypothesis to be tested, not 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
Strengths of the approach. The strategy is self-adapting by construction: volatility normalization means its thresholds are dimensionless, and ATR-based stops and targets scale automatically with the current range. Its dual filter — Order score plus Drift — is a genuine attempt to separate trending conditions from noise, and the regime-dissolution exit gives it a way to leave a trade when its original premise disappears rather than waiting passively for a stop. Because it uses no traditional indicators, it also avoids the crowding that comes with widely published methods.
Known limitations. Entropy is a statistical description of the recent past, and like any window-based measure it lags real turning points. A window that is too short produces noisy, unstable Order scores; a window that is too long may only recognize a trend after much of it has already happened. The four-bucket symbolization is a deliberate simplification and discards information about the size of moves within each bucket. The fixed reward-to-risk structure and fixed lot size mean the EA does not adapt position size to account equity or to the confidence of a signal.
Where it may underperform. Choppy, range-bound markets can occasionally produce high Order scores with small but persistent drift, leading to entries that get stopped out when the range reasserts itself. Sudden news-driven spikes can trigger the regime-dissolution exit prematurely or slip the stop. As with all trend systems, extended sideways periods tend to produce a string of small losses while the strategy waits for a durable regime. None of these behaviors is a flaw to be "fixed" — they are the natural cost of a filter that only participates part of the time.
Risk Management Tips
Regardless of how a strategy is built, disciplined risk management matters more than any single parameter. Consider the following general principles as you study this EA:
- Test on a demo account first. Run the strategy in the MT5 Strategy Tester and on a demo account across varied market conditions before risking real capital.
- Size positions conservatively. A common guideline is to risk no more than 1–2% of account equity per trade. The default fixed lot size does not do this for you, so calculate what a full ATR-based stop actually costs relative to your balance.
- Understand drawdown. Every strategy experiences losing streaks. Know the maximum drawdown you can tolerate emotionally and financially, and decide in advance when you would pause or stop the EA.
- Avoid over-optimization. Tuning parameters until a backtest looks ideal often produces a curve-fit that fails on new data. Prefer robust settings that work reasonably across a range of values.
- Diversify and stay engaged. Do not treat any automated system as a set-and-forget solution. Monitor its behavior, keep records, and be prepared to intervene.
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: SymbolicEntropyRegimeTrend.ex5 (0 downloads)
- Source Code: SymbolicEntropyRegimeTrend.mq5 (0 downloads)
- Documentation: SymbolicEntropyRegimeTrend.pdf (0 downloads)