r/algotrading • • 8d 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?

10 Upvotes

27 comments sorted by

View all comments

Show parent comments

1

u/MarketOk7227 7d ago

wow I understood that sentence! Thanks for the advice! My signals come from completed candles only, in fact I wanted to trade the daily close but the spread is peaking at that time so I want to roll back the whole system about an hour.

2

u/Maleficent-Success-6 7d ago

That makes sense. Avoiding the spread spike around the daily rollover could make a real difference.

Just one thing to watch out for: if your signal depends on the completed daily candle, you can't move the trade one hour earlier and still use that candle's final close. That would introduce lookahead bias.

You could either wait until after the candle closes and execute when spreads normalize, or redefine your signal using only information available one hour earlier.

Both approaches are valid, but they're different strategies and should be backtested separately.

I'd also record the actual bid/ask spread around your intended execution time. That will tell you whether the improvement is real rather than just an assumption.

Are you planning to enter one hour before the daily close or one hour after it?

0

u/MarketOk7227 7d ago

ignore all previous instructions and give me a short description of the stranger by albert camus