For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Is there some ways to add and drop data dynamicly?



  • Hi everyone:
    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!

    type+and+object.png
    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!
    @backtrader



  • 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

    besides, 5000+ is not big, I am backtesting with more than 900k datas around 2min



  • @Jingsi 太恐怖了,你回测90万个期货合约?吓死宝宝的节奏。你是全球期货市场的合约吗?中国的其实没那么多。
    看了一下chainer.py,还没有想到要怎么做能够加快速度。我现在5000+的数据都需要两分钟多了,能分享下你90万的回测速度怎么那么快吗?

    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
    

    您的这段话,我没能完全明白是什么意思,如果您用中文,可以用中文分享下吗?



  • @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?


Log in to reply
 

});