Kismuz / btgym

Scalable, event-driven, deep-learning-friendly backtesting library
https://kismuz.github.io/btgym/
GNU Lesser General Public License v3.0
985 stars 260 forks source link

can btgym support different stocks data with the same date time range? #32

Closed vincetom1980 closed 6 years ago

vincetom1980 commented 6 years ago

hi Andrew,

Can this framework support use different stocks with the same date time range as input? can you give me an example?

I mean the input for the framework is:

input_file1: 20170901 133000;15345;15355;15340;15335;868 20170901 133100;15335;15340;15330;15330;346 20170901 133200;15330;15330;15305;15300;3088 20170901 133300;15305;15320;15320;15300;1290 20170901 133400;15315;15320;15305;15305;1154 20170901 133500;15310;15315;15315;15300;2882 20170901 133600;15310;15315;15315;15305;434 20170901 133700;15310;15315;15310;15305;506 20170901 133800;15310;15315;15310;15305;906 20170901 133900;15315;15315;15315;15310;308 20170901 134000;15310;15315;15315;15310;180 20170901 134100;15315;15315;15305;15305;418

input_file2: 20170901 133000;4003;4006;4005;4003;2816 20170901 133100;4005;4006;4004;4003;1500 20170901 133200;4004;4004;4001;4000;3306 20170901 133300;4000;4002;4002;3999;2476 20170901 133400;4001;4002;4001;4001;1036 20170901 133500;4001;4001;4000;4000;1758 20170901 133600;4000;4005;4004;3999;5274 20170901 133700;4004;4005;4005;4003;1322 20170901 133800;4004;4005;4005;4004;802 20170901 133900;4004;4006;4006;4004;3030 20170901 134000;4006;4007;4006;4005;2144 20170901 134100;4006;4007;4006;4005;1068 20170901 134200;4006;4006;4005;4004;354 20170901 134300;4005;4005;4004;4004;690 20170901 134400;4004;4005;4004;4004;594 20170901 134500;4005;4006;4005;4004;1904 20170901 134600;4005;4007;4006;4005;1962 20170901 134700;4006;4008;4008;4006;2412 20170901 134800;4008;4010;4009;4008;2226 20170901 134900;4010;4010;4009;4009;1240 20170901 135000;4009;4009;4008;4008;334 20170901 135100;4008;4008;4007;4007;750

Thank you!

Kismuz commented 6 years ago

@vincetom1980, if you mean feeding and trading both stocks simultaneously - it is not implemented yet. Else, if it is about setting up input feed for different instruments, please refer to discussions: #8, #13, #25. Shortly, it can be done with little efforts via common backtrader methods as framework is itself agnostic to data formats, but there is no built-in methods yet; this is one of future work directions.

vincetom1980 commented 6 years ago

yes,Andrew, I mean feeding and trading both stocks simultaneously, sorry for my english is not quite well. hope for that.

Kismuz commented 6 years ago

@vincetom1980, multiply instruments trading is an extremely interesting direction for future work as it can bring synergetic effects. E.g. it may be possible for RL agent to learn some factorised generative representations based on observation of multiply correlated assets. It is in a list, yet not have time to put my hands on it.