khramkov / Backtrader-MQL5-API

Python Backtrader - Metaquotes MQL5 - API
GNU General Public License v3.0
247 stars 90 forks source link

backfill_from not working? #2

Open junaidnasir opened 4 years ago

junaidnasir commented 4 years ago

Hi, thanks for the package. I tried to run it with mt5 but to reduce the backfill time i tried running with backfill_from=data where data is a pandas feed. but it seems like backfill is not used and it gets everything from mt5.

# this works individually i.e if used with cerebro.adddata(backfill_data)
backfill_data = bt.feeds.PandasData(dataname=d2, datetime="datetime")
store = MTraderStore()
# this downloads all data from mt5 instead of using backfill_data
data = store.getdata(
    dataname="EURUSD",
    timeframe=bt.TimeFrame.Minutes,
    fromdate=start,
    compression=1,
    historical=True,
    backtfill_from=backfill_data,
)
cerebro.adddata(data)
cerebro.run()
cerebro.plot()