EA-12442 · Statistical Arbitrage

BackToTheFuture

This EA scrapes real-time stock quotes from Google Finance via WebRequest and compares them against historical prices from a configurable time offset. It opens buy/sell positions when the current price deviation from the historical reference exceeds a defined bar size threshold, aiming to exploit temporary mispricings between the external feed and the broker's price.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskDangerous
Rating★☆☆☆☆
TypeTrading EA
TimeframesM1, M5, M15
IndicatorsExternal Web Data
Authorjimbulux

Backtest results (H1, about 1 year)

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

Strategy analysis

The strategy concept is statistical arbitrage, scraping external stock quotes from Google Finance and comparing them against internally recorded historical prices to detect pricing deviations. Entry conditions: A buy is triggered when the current quote deviation exceeds HistoryPrice + BarSize, and a sell when it falls below HistoryPrice - BarSize, where HistoryPrice is the price from a configurable number of minutes ago. Exit conditions include fixed take-profit (TpPips) and stop-loss (SlPips), plus a time-based exit mechanism where positions are closed after a delay period derived from historical price timestamps. Position sizing uses fixed lots with no dynamic adjustment, and the Count parameter caps the maximum number of trades per session, resetting daily. Money management is essentially absent — the default SL is 5000 ticks while TP is only 10 ticks, creating an extremely asymmetric and dangerous risk-reward ratio.

Strengths

  • Innovative use of an external data source (Google Finance) for trade signals, offering a unique arbitrage concept
  • Includes a time-based automatic position closing mechanism to avoid excessive holding periods
  • Supports per-day-of-week trading control for flexible session management

Weaknesses

  • Extremely poor risk-reward ratio: 10 tick TP vs 5000 tick SL — one loss wipes out 500 wins
  • Depends on web scraping Google Finance which is outdated and unreliable, with no retry or fallback mechanism
  • FIFO function uses global variable j and dynamic arrays without bounds checking, posing memory management risks
  • Bug on line 121: sessionOpened is assigned to itself, so session state can never be correctly determined
  • No existing position check before opening new trades, risking duplicate positions in the same direction

Possible improvements

  • Fix the sessionOpened self-assignment bug and adjust the TP/SL ratio to a reasonable level (at least 1:2 or better)
  • Replace web scraping with a reliable API, add error retry and timeout handling, and implement position checks to prevent duplicate directional trades

Risk assessment

Overall risk: Dangerous

  • Severely imbalanced TP/SL ratio (1:500), a single loss can cause catastrophic account damage
  • Relies on deprecated Google Finance web scraping — data may be inaccurate or completely unavailable
  • No existing position check or protection against duplicate directional entries
  • Global variable state management is chaotic with array bounds overflow risk
  • sessionOpened logic bug may cause trades to open outside valid session hours

Evaluation scores

Code quality1.0
Strategy logic2.0
Risk management1.0
Robustness1.0
Innovation3.0
Documentation1.0
Overall1.5

Parameters

ParameterDefaultDescription
GoogleSymbolNameNYSE:CStock symbol on Google Finance
GoogleFinanceLinkhttp://www.google.com/finance?q=c&ei=SK5dVaGeKouvsAHzioDIDAGoogle Finance web link
BarSize0.25Price deviation threshold to trigger trade
GoogleFinanceHistoryMins60Historical price lookback time in minutes
Lots0.1Trade lot size
TpPips10Take profit in pips
SlPips5000Stop loss in pips
Count5Max open positions (-1 for unlimited)
FillingORDER_FILLING_RETURNOrder filling type
MondaytrueEnable trading on Monday
TuesdaytrueEnable trading on Tuesday
WednesdaytrueEnable trading on Wednesday
ThursdaytrueEnable trading on Thursday
FridaytrueEnable trading on Friday

Similar Statistical Arbitrage 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.