TrendScore EA
- Experts
- Version: 1.0
TrendScore EA turns multi-timeframe trend alignment into a single confidence score, then sizes every trade according to how strongly the market agrees with itself.
Overview
TrendScore EA is a trend-following Expert Advisor built around a simple idea: real trends show up on more than one horizon at once. The EA compares the current price to where it stood one day, one week, and one month ago on the attached timeframe, and combines the three readings into one composite score, weighted toward the longer horizons. Position size scales directly with the strength of that score, so the EA commits more capital when short, medium, and long-term direction agree, and less when they conflict. It is designed for Forex majors and metals such as XAUUSD, and adapts its sensitivity to the volatility of whatever symbol it is attached to.
How It Works
- On each new bar, the EA measures the price change between the current closed bar and the bars corresponding to one day, one week, and one month back.
- Each comparison only counts if the move exceeds an adaptive threshold based on the symbol's own Average True Range scaled to that horizon, filtering out noise that is not a genuine directional move.
- A qualifying move earns +1, +2, or +3 points depending on the horizon (day, week, month), and an opposing move subtracts the same amount, producing a composite score between -6 and +6.
- Trade size scales with the absolute value of the score relative to its maximum, so full agreement across all three horizons produces the largest position and partial agreement produces a proportionally smaller one.
- Position size is further adjusted by current volatility relative to its own recent average, reducing exposure when volatility is elevated and allowing more exposure when volatility is compressed.
- The position is closed when the score returns to zero or reverses sign, keeping management tied to the same trend logic used for entry.
Inputs
- Trend Score group: bars back for one day, one week, and one month; adaptive threshold multiplier for the dead zone
- Risk / Sizing group: maximum risk percent of equity at full score, ATR multiplier for stop loss distance, optional take profit multiple, ATR period, magic number
- Volatility Adjustment group: averaging period for the volatility baseline, minimum and maximum size multiplier bounds
- Optimizer Score group: minimum profit factor, maximum drawdown percent, minimum trade count, and weighting parameters for the scoring formula
- Dashboard group: toggle to show or hide the on-chart panel
Optimizer Scoring System
TrendScore EA includes a custom optimizer scoring function designed to resist curve-fitting. Instead of ranking results by raw net profit, it rewards a smooth, statistically consistent equity curve, penalizes drawdown depth and duration, penalizes results whose profit relies on a single outsized trade, and penalizes parameter sets whose performance diverges between the first and second half of the test. It also rewards a reasonable number of trades so that thin, unreliable samples are not favored over robust ones. When optimizing, set the Optimizer Criterion to Custom max so the built-in scoring function is used to rank results.
Recommended Setup
TrendScore EA is designed for the H1 timeframe on Forex majors and XAUUSD, though the bar-count inputs can be adjusted for other timeframes. Use a reliable low-latency broker connection and, for continuous unattended operation, a VPS close to the broker's server.
Screenshots
Recommended input sets are provided as .set files in the comments section below, available in every supported language.
Disclaimer
Past performance shown in backtests and screenshots does not guarantee future results. Test thoroughly on a demo account before committing real capital, and use position sizing appropriate to your own risk tolerance.
