mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 16:30:30 +08:00
962347318d
In preparation for the incoming changes which no longer push every bar through the tradesimulation, remove the adjustment of the period's cash on every pricing change of a held futures asset. Instead hold the last sale price for each held future either: - At the end of each peformance period update the last sale prices of all held futures, so that the pnl for the next period uses values derived from the cash difference between the end of the two periods. - When a transaction is processed for the Future, so that the correct amount is applied to each cash adjustment. (i.e. the cash adjustment is reset on every change of amount of the Future being held, so that multiple size and prices do not need to be tracked for the same asset.) Also, remove now unused dict of payout calculation modifier, since new calculation reads the value directly off of the asset. Remove update_last_sale test, since the method no longer returns a cash value.