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
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
Parameters
| Parameter | Default | Description |
|---|---|---|
GoogleSymbolName | NYSE:C | Stock symbol on Google Finance |
GoogleFinanceLink | http://www.google.com/finance?q=c&ei=SK5dVaGeKouvsAHzioDIDA | Google Finance web link |
BarSize | 0.25 | Price deviation threshold to trigger trade |
GoogleFinanceHistoryMins | 60 | Historical price lookback time in minutes |
Lots | 0.1 | Trade lot size |
TpPips | 10 | Take profit in pips |
SlPips | 5000 | Stop loss in pips |
Count | 5 | Max open positions (-1 for unlimited) |
Filling | ORDER_FILLING_RETURN | Order filling type |
Monday | true | Enable trading on Monday |
Tuesday | true | Enable trading on Tuesday |
Wednesday | true | Enable trading on Wednesday |
Thursday | true | Enable trading on Thursday |
Friday | true | Enable trading on Friday |
Similar Statistical Arbitrage EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.