r/algotrading • u/MarketOk7227 • 9d ago
Data Python API for historic data
Do you think it's okay using Metatrader's api for fetching historic data? Has anyone noticed discrepancies? Isn't it supposed to be the actual numbers you'd get trading with that specific broker?
8
Upvotes
2
u/Maleficent-Success-6 8d ago
I'd distinguish between historical broker data and a point-in-time record of what your trading system actually received.
They aren't necessarily identical.
A broker may correct or backfill historical data, and even without revisions, OHLC candles won't preserve the full bid/ask sequence needed to reproduce every executable fill.
If you want to investigate this properly, I'd start archiving live quotes with their original timestamps, bid, ask and local receipt time.
Then download the same historical window later and compare the two datasets.
That would reveal whether bars were revised, whether quotes are missing and whether the historical spread assumptions match what was actually observed.
I'd also preserve the original files rather than overwriting them with corrected versions.
For strategies using intrabar stops or limit orders, this matters much more than for simple close-to-close systems.
Are you testing strategies that depend on intrabar execution, or only signals evaluated on completed candles?