As per related requirements in #345 and a bit of tasking in #489, it
probably makes sense to make this change for flexibility for things in
legacy markets like splits, renames and in modern (crypto) ones
things like transfers, forks, etc..
Please also see #478 for an older issue prior to #489 which describes
this task set in the past where appropriate content has been movied
here.
Note that this issue is a highlevel section of the grander parent
milestone in #515.
Of course the current schema records would just be flipped to {'type': 'clear', ...}.
There's a TODO in the respective .accounting._pos module:
[ ] change .clears -> .events and adding a 'type': 'clear' field
to each entry to also allow supporting transaction or market structure
change events:
'split': for stocks which change their float by reducing or
increasing the number of units in circulation.
'rename': for any asset that is renamed by it's venue/provider.
'transfer': for both fiat and crypto where it pertains to simply
moving an amount of asset to some other account or wallet and the
user desires that this affect the size of the position: eg.
xferring btc to pay for something in a target fiat which the user
wishes to view as a "sell-for-profit".
'removal': for assets that get discontinued by their
venue/provider: eg. a shit coin or penny stock that finally is
deleted from exchange.
[ ] the above set of market-event types can also be mapped to
a set of distinct (graphical) icons when displayed on chart:
as an eg. we have arrows for clears and alerts..
[ ] removal of obsoleted top levels fields: eg. split_ratio
[ ] add nice-to-have summary stats to the top level?
bep break even price
duration showing time span since last net-zero position?
src_fiat to allow defining which mkts the user chooses to project
to particular "user fiat": the asset-money-tech of choice that the
user wants to "price the position in terms of"
[ ] add a top level balances table per account which shows the
history of asset holdings per every single clear and transfer allowing
for avoiding non-trading (non clearing) transactions to be filtered
in position-pnl calcs?
Further preferred adjustments to actual data schema and surrounding
operating machinery:
[ ] #496 final refinements and hopefully avoiding carrying our own
fork!
[x] finer grained file update update system
we added .write_config() to
.accounting._ledger.TransactionLedger and the PpTable in #489
[ ] high-level multi-account PpTable api that would avoid all the
exit stacks as is currently implemented in the
ib.broker.trades_dialogue() backend.
[ ] Avoid Position.size being a state var and instead always
computed from an
[e for e in Position.events if e['type'] in {'clear', 'transfer'}]
using .calc_size()
As per related requirements in #345 and a bit of tasking in #489, it probably makes sense to make this change for flexibility for things in legacy markets like splits, renames and in modern (crypto) ones things like transfers, forks, etc..
Please also see #478 for an older issue prior to #489 which describes this task set in the past where appropriate content has been movied here.
Note that this issue is a highlevel section of the grander parent milestone in #515.
Of course the current schema records would just be flipped to
{'type': 'clear', ...}
.There's a TODO in the respective
.accounting._pos
module:TODO:
[ ] change
.clears
->.events
and adding a'type': 'clear'
field to each entry to also allow supporting transaction or market structure change events:'split'
: for stocks which change their float by reducing or increasing the number of units in circulation.'rename'
: for any asset that is renamed by it's venue/provider.'transfer'
: for both fiat and crypto where it pertains to simply moving an amount of asset to some other account or wallet and the user desires that this affect the size of the position: eg. xferring btc to pay for something in a target fiat which the user wishes to view as a "sell-for-profit".'removal'
: for assets that get discontinued by their venue/provider: eg. a shit coin or penny stock that finally is deleted from exchange.[ ] the above set of market-event types can also be mapped to a set of distinct (graphical) icons when displayed on chart:
[ ] removal of obsoleted top levels fields: eg.
split_ratio
[ ] add nice-to-have summary stats to the top level?
bep
break even priceduration
showing time span since last net-zero position?src_fiat
to allow defining which mkts the user chooses to project to particular "user fiat": the asset-money-tech of choice that the user wants to "price the position in terms of"[ ] add a top level
balances
table per account which shows the history of asset holdings per every single clear and transfer allowing for avoiding non-trading (non clearing) transactions to be filtered in position-pnl calcs?Further preferred adjustments to actual data schema and surrounding operating machinery:
[ ] #496 final refinements and hopefully avoiding carrying our own fork!
[x] finer grained file update update system
.write_config()
to.accounting._ledger.TransactionLedger
and thePpTable
in #489[ ] high-level multi-account
PpTable
api that would avoid all the exit stacks as is currently implemented in theib.broker.trades_dialogue()
backend.[ ] Avoid
Position.size
being a state var and instead always computed from an[e for e in Position.events if e['type'] in {'clear', 'transfer'}]
using.calc_size()