mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 20:03:41 +08:00
be8326baf2
Protect a case where data is written with a non-zero volume, but a 0/nan for the OHLC values. The slippage model was relying on a non-zero volume implying that there was a valid trade price for the corresponding bar. When there was a mismatch, a transaction with a nan value was created, which would in turn propagate the nan into portfolio value, which would then cause errors when the portfolio value was used to size orders during rebalancing. When data is fixed, can remove. (Also may want to add behavior to minute bar writer to ensure that 0 volumes always have corresponding nan ohlc.)