Is there some ways to add and drop data dynamicly?
I backtest and trade futures ,because I want to backtest the real future contracts,so,now,I have to add more than 5000+ data,it lows the speed.
can I develop a function to add data just when the future contract have real data and begin to trade?
can I develop a function to drop data after the future contract having no data and expired?
Is there anynone having any idea?
Than you very much!
in this picture,I let the relathionship of some key classes in backtrader becoming more obvious.
in order to speed up,add the need data and drop unnecessary data,maybe a good way!
Jingsi last edited by
but if you want live trading, you have to deal with disconnection and reconnection and backfill the data properly
besides, 5000+ is not big, I am backtesting with more than 900k datas around 2min
you can have a look at pandafeed.py or chainer.py and implements your own datafeeds, it's very simple, especially for backtest, i think it's no more than load data in _load() but if you want live trading, you have to deal with disconnection and reconnection and backfill the data properly
ab_trader last edited by
@tianjixuetu this is english speaking community even (I am more than sure) English is a second language for majority of the users here. But they are making the effort and use it. Your post shows disrespect to other users, and your answer is not useful for community. Please use English.
@ab_trader I don't agree your opinion,but I try my best to use english.The reason which I use chinese,maybe @Jingsi is a chinese,who can speak chinese more accurately. just as two persons who speaks english,they have a trip to Japan,when they communicate,you let them use Japanese?