We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 68a88bb + 25a26c0 commit a3ece1cCopy full SHA for a3ece1c
qlib/rl/order_execution/simulator_simple.py
@@ -173,7 +173,9 @@ def __init__(
173
self.ticks_for_order = self._get_ticks_slice(self.order.start_time, self.order.end_time)
174
175
self.cur_time = self.ticks_for_order[0]
176
- self.twap_price = float(self.backtest_data.get_deal_price().loc[self.ticks_for_order].mean())
+ # NOTE: astype(float) is necessary in some systems.
177
+ # this will align the precision with `.to_numpy()` in `_split_exec_vol`
178
+ self.twap_price = float(self.backtest_data.get_deal_price().loc[self.ticks_for_order].astype(float).mean())
179
180
self.position = order.amount
181
0 commit comments