pikers / piker

(e2e) foss trading for non-tinas
GNU Affero General Public License v3.0
103 stars 17 forks source link

Add non-state-incremented calculation methods #364

Closed goodboy closed 2 years ago

goodboy commented 2 years ago

Since we're going to need them anyway for desired features, add 2 new Position methods:

Add a cost_scalar: float control to the .update_from_trans() method to allow manual adjustment of the cost weighting for the case where a "non-symmetrical" model is wanted.

Go back to always trying to write the backing ledger files on exit, even when there's an error (obvs without the return in the finally: block f$#% up).


This is one more step toward tracking historical breakeven prices per position and thus eventually enabling pp "lifetime lines" in the chart UI as per #345.