-
Notifications
You must be signed in to change notification settings - Fork 2
Labels
bugSomething isn't workingSomething isn't working
Description
Description
I got a problem running python evaluation.py when use the data collected from Google Drive option. I notice a mismatch in date in `backtesting_parameter.json', but replacing it with the following setting (adapted from this config from the previous commit) did not work
{
"is_from_date_str": "2022-01-01 00:00:00",
"is_end_date_str": "2023-01-01 00:00:00",
"os_from_date_str": "2023-02-01 00:00:00",
"os_end_date_str": "2024-01-01 00:00:00",
"fee": "0.4",
"time": "15"
}
Both cases above yield the same issue:
Traceback (most recent call last):
File "/home/<path>/ProtoMarketMaker/evaluation.py", line 14, in <module>
bt.run(data, Decimal(BEST_CONFIG["step"]))
File "/home/<path>/ProtoMarketMaker/backtesting.py", line 251, in run
self.handle_force_sell(row["f2_price"] if moving_to_f2 else row["price"])
File "/home/<path>/ProtoMarketMaker/backtesting.py", line 107, in handle_force_sell
while self.get_maximum_placeable(price) < 0:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/<path>/ProtoMarketMaker/backtesting.py", line 123, in get_maximum_placeable
from_cash_to_tradeable_contracts(
File "/home/<path>/ProtoMarketMaker/utils.py", line 29, in from_cash_to_tradeable_contracts
return int(cash / (inst_price * multiplier * margin_rate))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert NaN to integer
Roll back to this commit and it worked well.
Environment
OS: Ubuntu 24.04
Python version: 3.12.3
Reproduce steps
- Clone this repo to local
- Download data from Google Drive
- Setup env as in
README - (Optional) Run every other steps in
README - Run `python evaluation.py
Notes: It worked fine with data collected from database
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working