recording profit & loss for securities transaction

24 views
Skip to first unread message

lipp f

unread,
Oct 6, 2021, 4:03:30 PMOct 6
to Ledger
Hy everyoane,

I have this jurnal entries:

$ ledger -f start.j print --limit 'commodity =~ /TSLA  210820P00560000/'
2021/06/04 * Sell -1 TSLA 20AUG21 560.0 P
    Assets:nnnnnnnn:OPT                 -100.0 "TSLA  210820P00560000" @ USD42.49000000000
    Expenses:nnnnnnnn:Fees              USD0.73146990000
    Assets:nnnnnnnn:Cash

2021/06/18 * Buy 1 TSLA 20AUG21 560.0 P
    Assets:nnnnnnnn:OPT                 100.0 "TSLA  210820P00560000" @ USD28.00000000000
    Expenses:nnnnnnnn:Fees              USD0.62780000000
    Assets:nnnnnnnn:Cash

and I have USD1,449.00 profit:

$ ledger -f start.j bal --limit 'commodity =~ /TSLA  210820P00560000/'  --gain
USD1,449.00000000000  Assets:nnnnnnnn:OPT

I am aware that the documentation recommands adding the opening lot price to the closing transaction like this

           Assets:nnnnnnnn:OPT            100.0 "TSLA  210820P00560000" {USD42.49} @ USD 28.0

and the entry for PnL like this:

              Income:nnnnnnnn:PnL USD1,449.00

The question is can this be rewritten in a such thing that I do not have to change the closing transaction above? I need a jurnal entry with 

              Income:nnnnnnnn:PnL                          USD1,449.00

but how do I balance it?

TIA. 
Reply all
Reply to author
Forward
0 new messages