EA-33314 · Utility

Spread data collector

This EA collects and categorizes spread data into predefined buckets (0-10, 10-20, 20-30, 30-40, 40-50, 50+ points) on every tick. It prints yearly spread distribution statistics when the year changes and upon deinitialization, helping traders assess spread conditions over time.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryUtility
RiskSafe
Rating★★☆☆☆
TypeUtility tool
TimeframesM1, M5, M15, M30, H1, H4, D1
Indicators—
Authoralipoormomen.

Backtest results (H1, about 1 year)

Not backtested yet — this EA could not be converted automatically.

Strategy analysis

This EA is not a trading strategy but a pure data collection utility. It has no entry or exit conditions, executes no trades, and involves no position sizing or money management. Its core logic calculates the real-time spread on every tick by reading the current bid-ask difference (last_tick.ask - last_tick.bid) and increments one of six predefined bucket counters based on the spread value. When the year changes, the EA prints the previous year's spread distribution statistics and resets all counters to zero. Upon deinitialization (OnDeinit), it also outputs the current year's accumulated statistics. The primary purpose of this tool is to provide traders with spread distribution data across different years for a specific symbol, helping them assess liquidity quality and trading costs for that instrument.

Strengths

  • Simple and intuitive spread data collection for evaluating trading costs
  • Yearly segmented statistics allow observation of spread trends across years
  • Low resource consumption with only simple comparison operations on each tick

Weaknesses

  • Boundary condition bug: spread values exactly equal to 10, 20, 30, 40, or 50 are not counted in any bucket
  • Results only output via Print, no persistent storage—data is completely lost on EA restart
  • Spread buckets are hardcoded and non-configurable, cannot adapt to different symbol spread ranges
  • No file or database storage for statistics, limiting post-analysis capabilities
  • Missing SymbolInfoTick return value check, potentially using invalid tick data

Possible improvements

  • Fix boundary condition bug by using <= instead of < to ensure every spread value is correctly classified
  • Write statistics to CSV files instead of only Print output to ensure data persistence and further analysis
  • Make spread bucket thresholds configurable input parameters to adapt to different trading symbols

Risk assessment

Overall risk: Safe

  • This EA executes no trades, posing no financial risk
  • Missing SymbolInfoTick return value check may lead to reading invalid tick data

Evaluation scores

Code quality2.0
Strategy logic2.0
Risk management5.0
Robustness2.0
Innovation1.0
Documentation1.0
Overall2.2

Parameters

ParameterDefaultDescription
spread_Less_than_100Tick counter for spread below 10 points
spread_10_200Tick counter for spread between 10 and 20 points
spread_20_300Tick counter for spread between 20 and 30 points
spread_30_400Tick counter for spread between 30 and 40 points
spread_40_500Tick counter for spread between 40 and 50 points
spread_More_than_500Tick counter for spread above 50 points
con_year0Current year tracking variable for year change detection

Similar Utility EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.