Hi there. In each loop (calling _load()), maybe more than one trade is appended in the "for trade in trades" block, but only one trade is popped, ie. trade = self.trades.popleft(). Will this cause delay? Will this datafeed be much slower than the real world?
Posts made by xiaoliangbuaa
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
help on oandav20
Hi there, I am trying to test https://github.com/ftomassetti/backtrader-oandav20. But, I am new to Oanda. The curl example on the Oanda website can work:
curl -H "Authorization: Bearer 51f5c1ef90f273e64641c88a5d611fa9-dff160a3727b5fd16634964895c6fc99" https://api-fxpractice.oanda.com/v3/accounts
However, when running oandav20test.py with the parameters "--account Bearer --token 51f5c1ef90f273e64641c88a5d611fa9-dff160a3727b5fd16634964895c6fc99 --data0 GBP_USD", the following error is obtained:
Datetime, Open, High, Low, Close, Volume, OpenInterest, SMA
***** STORE NOTIF: GET https://api-fxpractice.oanda.com:443/v3/accounts/Bearer/instruments?instruments=GBP_USD expected status 200, got 400 (Bad Request)
***** DATA NOTIF: NOTSUBSCRIBED
Anyone can help? Thanks in advance.
Help with oandatest.py
I am new to backtrader. I try to run oandatest.py and get the following error:
Traceback (most recent call last):
File "/Users/tanjuju/PycharmProjects/backtrader-master/lxl/my_oanda_test.py", line 44, in <module>
oandastore = bt.stores.OandaStore(token=apikey, account=acc, practice=True)
AttributeError: module 'backtrader.stores' has no attribute 'OandaStore'
So, I delete all .pyc files in the module stores and rerun. The same error occurs. I have no idea where is the problem. Anyone can help?