Kismuz / btgym

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

Custom datafeeed with custom BT strategy? #109

Closed ogenev closed 4 years ago

ogenev commented 5 years ago

Hello, what is the simplest way to add custom datafeed (bid/ask prices, bid/ask spread) instead of the standard OHLC bars and then use custom Backtrader strategy based on that?

ogenev commented 5 years ago

Should I just need to do:

  1. edit BTGymBaseData parsing_params
  2. edit BTgymRandomDataDomain parsing_params
  3. override set_datalines and define strategy in BTgymBaseStrategy

Thanks!

Kismuz commented 5 years ago

@ogenev , yes exactly except that 1-2 are actually the same since you only need to change RandomDataDomain (or any other user-level domain class) parsing parameters; those changes will be propagated to base class. See also: #45, #8, #13

ogenev commented 5 years ago

Thank you! I'm a bit confused how to use set_datalines() method, can you please give an example with custom datalines, instead of olhc bars?

Kismuz commented 4 years ago

Closed due to long inactivity period.