ranaroussi / qtpylib

QTPyLib, Pythonic Algorithmic Trading
http://qtpylib.io
Apache License 2.0
2.16k stars 513 forks source link

Daily bar resolution working? #96

Open yliu31 opened 6 years ago

yliu31 commented 6 years ago

Hi Ran, Qtpy's event-driven architecture is more natural than Quantopian's schedule based architecture, and I hoped to be able to use it. But I have not been able to make the daily-bar work. Have you ever used it for daily-bar trading. Could you provide a demo example for me to try?

BTW, what do you use for multi-thread debugging? I have not been able to trace the code for bar-handling using Spyder due to multi-threading. Thanks very much. Yong

lionelyoung commented 5 years ago

Hi Yong, can you post your strategy code?

If I have to guess with no code, a checklist could be:

  1. Check your bar_window size, which may truncates the logic
  2. Check your blotter ports, and pass it in the parameters, if you are using non-standard ports

Other than that it's more guessing, posting your strategy.py would help

There is example code in the examples folder here, along with a backtesting workflow (if you want to load in data) here