Closed LJingnan closed 3 months ago
At the start of the backtesting or right after a depth clear event, the market depth is empty, resulting in no bid or ask. In such cases, it returns INVALID_MIN
or INVALID_MAX
based on the side, defined as -sys.maxsize
or sys.maxsize
in marketdepth.py
. You can check this by using from hftbacktest.marketdepth import INVALID_MIN, INVALID_MAX
.
At the start of the backtesting or right after a depth clear event, the market depth is empty, resulting in no bid or ask. In such cases, it returns
INVALID_MIN
orINVALID_MAX
based on the side, defined as-sys.maxsize
orsys.maxsize
inmarketdepth.py
. You can check this by usingfrom hftbacktest.marketdepth import INVALID_MIN, INVALID_MAX
.
Would this affect backtesting,because I find out that my collecting program restart often.
Collecting program data doesn't have to do with backtesting. Connection loss often happens. It's recommended to handle invalid values to ensure that erroneous actions are not taken in backtesting.
Collecting program data doesn't have to do with backtesting. Connection loss often happens. It's recommended to handle invalid values to ensure that erroneous actions are not taken in backtesting.
I see, could you please give me some advise? When I encounter INVALID_MIN or INVALID_MAX then I clear all position and wait until a DEPTH_SNAPSHOT_EVENT? Is this logic ok?
Now I use the method: I split data on depth_clear event, and bacltest them one by one and collect them together at the end. Is this a good method?
I'd rather wait until both a valid bid and ask are received. Ultimately, the same situation will occur in live trading, so there's no use in applying methods that only work in backtesting.
I'd rather wait until both a valid bid and ask are received. Ultimately, the same situation will occur in live trading, so there's no use in applying methods that only work in backtesting.
I see, Thank You!
I download data using python, But I fould some bid_price where strange. Is it a collection error? Here is the data sample![image](https://github.com/nkaz001/collect-binancefutures/assets/43166853/0e3c71df-422e-4542-8f1f-7f25dd238dc6)