mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 17:42:42 +08:00
7f669c4391
In the volume share slippgae, the current amount had the direction, i.e. buy/sell was baked into the value of `cur_amount` which then needed to have the direction multiplied out when parts of the slippage model needed to take in just the magnitude/amount into account. So calculate the current volume, use that in calculations and then apply at the order direction at order time. Also, when applying the direction to the magnitude of the sell, use copysign to make the code more explicit about taking the direction of the order, instead of it possibly having some scalar impact. As well as remove direction from volume_share calculation since that calculation and subsequent calculations only care about the magnitude, so make the disregard for direction more explicit by removing it.