Since we're going to need them anyway for desired features, add
2 new Position methods:
.calc_be_price() which computes the breakeven cost basis price
from the entries in the clears table.
.calc_size() which just sums the clear sizes.
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.
Since we're going to need them anyway for desired features, add 2 new
Position
methods:.calc_be_price()
which computes the breakeven cost basis price from the entries in the clears table..calc_size()
which just sums the clear sizes.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 thefinally:
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.