mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 14:29:26 +08:00
0fd78cd54a
Previously the last sale price was not correctly being set on positions when the transaction arrived before the trade event. The last sale price was defaulted to zero and never updated. This resulted in one holding stocks that were bough >>0 and now had value 0 from the perspective of returns. The returns would display correctly again when the next trade of that security happened. For most securities trading is frequent enough that there's no issue, but for some illiquid ones it took hours to fix itself. Updated test_perf_tracking:TestPerformanceTracker.test_minute_tracker This test was based on assuming that last_sale_price was zero, allowing the sharpe ratio to be calculated. The sharpe ratio can no longer be calculated for this specific tested scenario and the test has been changed accordingly.