Just a quick update on what I ended up doing.

- I do not do any fancy options strategies, not even naked calls (only 
covered calls).
- After options expire or the positions get closed, I only need to keep a 
record the cash outflow and inflow. The options details are only in 
narration.
- So options accounts are needed only until options are held in account

I created a separate file for each account where I trade options to keep 
track of live options. This file has entries like this:

2021-01-25 open Assets:Vanguard:Brokerage:Options:CUK210820P00010000 
CUK210820P00010000
2021-02-02 open Assets:Vanguard:Brokerage:Options:CNK220121C00020000 
CNK220121C00020000

2021-01-25 * "Sold -300.0 Options CUK210820P00010000"
Assets:Vanguard:Brokerage:Options:CUK210820P00010000 -300.000 
CUK210820P00010000 {0.8200 USD}
Assets:Vanguard:Brokerage:VMSXX -3000.00 USD
Assets:Vanguard:Brokerage:VMSXX:Reserved 3000.00 USD
Assets:Vanguard:Brokerage:VMSXX 245.99 USD
Expenses:US:BrokerageFees 0.01 USD
Income:Vanguard:Brokerage:PnL

2021-02-02 * "Bought 200.0 Options CNK220121C00020000"
Assets:Vanguard:Brokerage:Options:CNK220121C00020000 200.000 
CNK220121C00020000 {5.5000 USD}
Assets:Vanguard:Brokerage:VMSXX -1100.00 USD
Income:Vanguard:Brokerage:PnL

When the positions get closed the entries change into this (the first 
option expired, the second one got sold) and move to the main file:

2021-01-25 * "Sold -300.0 Options CUK210820P00010000"
Assets:Vanguard:Brokerage:VMSXX 245.99 USD
Expenses:US:BrokerageFees 0.01 USD
Income:Vanguard:Brokerage:PnL

2021-02-02 * "Bought 200.0 Options CNK220121C00020000"
Assets:Vanguard:Brokerage:VMSXX -1100.00 USD
Income:Vanguard:Brokerage:PnL

2021-02-10 * "Sold 200.0 Options CNK220121C00020000"
Assets:Vanguard:Brokerage:VMSXX 500.00 USD
Income:Vanguard:Brokerage:PnL

Automatic importers spit out the transactions broken down into two parts - 
open option trades that go into the secondary file, closed option trades 
that go into the main file.

This way the number of Options account is limited to the options that I 
currently have open positions in. 


On Sunday, February 14, 2021 at 10:45:55 AM UTC-5 Rahul Kuchhal wrote:

> Thank you!
>
> I see that adding new commodities is the recommended way then.
>
> Now on to finding Vanguard and Schwab importers or adopting your 
> Ameritrade importer for them.
>
> On Saturday, February 13, 2021 at 5:13:01 PM UTC-5 b...@bben.us wrote:
>
>> Good point about the price directive. I agree with your recommendation. 
>> Seems like the best way to handle it is to fix any reporting tooling that 
>> have problems with the flood of commodity symbols to aggregate or page 
>> their output.
>>
>> On Sat, Feb 13, 2021, 14:03 Martin Blais <bl...@furius.ca> wrote:
>>
>>> On Sat, Feb 13, 2021 at 1:34 PM Rahul Kuchhal <ra...@kuchhal.com> wrote:
>>>
>>>> I am also trying to figure out the best way to represent Sold options 
>>>> that open new positions.
>>>>
>>>> The suggested approach below works (kind of). 
>>>>
>>>> 2020-12-28 * "Sell March 1 PUT 200 on HOOL"
>>>>    Assets:Brokerage:Taxable:HOOL:Options   -1 HOOL_PUT_200_2021_03_01 
>>>> {1000 USD}
>>>>    Assets:Brokerage:Taxable:Cash                     1000 USD
>>>>
>>>> Seems like I would need to add a new currency to HOOL:Options account 
>>>> each time I open a new position. Overtime I suspect this may result in 
>>>> hundreds (or even thousands) of currencies attached to a single account.
>>>>
>>>
>>> That's what I do. My importer creates them automatically from the TOS 
>>> log.
>>> Here:
>>>
>>> https://github.com/blais/ameritrade/blob/master/examples/ameritrade2beancount.py
>>>
>>> I'm doing vertical and calendar spreads, collars, covered calls, and 
>>> more. It all works great with Beancount.
>>> I can give a little demo of how to use bean-doctor to interactively 
>>> compute the P/L of an isolated sequence of trades if anyone cares.
>>>
>>> The importer above groups the trades by underlying, and typically these 
>>> are positions being rolled, but not always. I may initiate multiple 
>>> separate trades with distinct history in the same underlying (either 
>>> closing and reopening, or over different months).
>>>
>>> One of the issues is that "regular" activity - stock purchases and 
>>> sales, or short positions, as well as longer-term hedging on LEAPs, all 
>>> happen in the same account. I consider these logically distinct from the 
>>> premium / vol trading I do, so I want to separate them out. Here's how I do 
>>> this: when I import, I keep the active options traffic segregated to an 
>>> include file, one per week. I manually move the long term activity to my 
>>> main Beancount file, where it will remain forever. All the transactions are 
>>> tagged with TD's unique transaction ids, and when the importer runs it 
>>> automatically ignores anything that's been imported before, here:
>>>
>>> https://github.com/blais/ameritrade/blob/master/examples/ameritrade2beancount.py#L912
>>>
>>> I have been keeping each week in a separate file, with custom scripts to 
>>> compute realized and unrealized P/L by week.
>>> However, as I've increased my volume and am holding positions over a 
>>> longer time, I'm finding I need something more sophisticated.
>>> So I've started slowly moving away from using Beancount for that 
>>> particular activity, and have been building code that can automatically 
>>> untangle each trade directly from the TOS log, following it through 
>>> multiple rolls over time, and compute the total P/L once all the related 
>>> legs are closed out. It's nice as I can do per-trade analysis on spreads 
>>> and all their history of managing them that follows over multiple weeks, as 
>>> a single "trade".
>>>
>>> As far as the main ledger goes, I think I'll probably end up summarizing 
>>> the impact of realized P/L on a weekly basis through a single transaction 
>>> in my main Ledger file. There's no reason I'd need to keep all that traffic 
>>> in my main file, even if I'd still use Beancount for it (which I'm not 
>>> entirely sure I will for that activity).
>>>
>>>
>>>
>>> 1) Is there any downside of attaching so many currencies to a single 
>>>> account? 
>>>>
>>>
>>> No. I do think that we may want to eventually add a regexp type of 
>>> commodity that can cover them all though.
>>> You shouldn't have to insert them manually, have your importer do that.
>>> So far it works well for me.
>>>
>>>  
>>>
>>>> 2) Is there a way to represent these transactions using the same 
>>>> currency over and over (based on the cost basis and date of options)
>>>>
>>>> 2020-12-28 * "STO March 1 PUT 200 on HOOL"
>>>>    Assets:Brokerage:Taxable:HOOL:Options   -1 Options {1000 USD}
>>>>    Assets:Brokerage:Taxable:Cash                     1000 USD
>>>>
>>>> 2020-12-30 * "BTC March 1 PUT 200 on HOOL"
>>>>    Assets:Brokerage:Taxable:HOOL:Options   1 Options {1000 USD} @ 990 
>>>> USD
>>>>    Assets:Brokerage:Taxable:Cash                     -990 USD
>>>>    Income:PnL
>>>>
>>>>
>>> I wouldn't do that. Part of the point of using Beancount is to figure 
>>> out what your inventory is and different options have different prices over 
>>> time (I use the Price directive, works well).
>>> Besides it would have to be OPTIONS.
>>>
>>>
>>> On Tuesday, December 29, 2020 at 5:11:26 PM UTC-5 Rajath wrote:
>>>>
>>>>> Two good approaches. The one where each option symbol is commoditized 
>>>>> more inline with how stocks are managed. But the second approach is also 
>>>>> very interesting because it accounts for assignment risk. My brokerage 
>>>>> also 
>>>>> holds the collateral from available cash when I sell a put option, so 
>>>>> maybe 
>>>>> I can find a way to represent that too (which says exactly how much cash 
>>>>> I 
>>>>> have on hand to trade). 
>>>>>
>>>>> I will play around with this!
>>>>>
>>>>> On Tuesday, December 29, 2020 at 1:16:10 PM UTC-8 tinot...@gmail.com 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I count only the money in my account and control the sum of possible 
>>>>>> assignments. I don't have an "entity" option. 
>>>>>>
>>>>>> For the options, I sell puts of stocks I want to buy and I have the 
>>>>>> money for doing it. So if it's assigned, no problem ;-)
>>>>>>
>>>>>> On Tue, Dec 29, 2020 at 6:47 PM Martin Blais <bl...@furius.ca> wrote:
>>>>>>
>>>>>>> On Tue, Dec 29, 2020 at 11:24 AM Tuno Tunante <tinot...@gmail.com> 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi, 
>>>>>>>>
>>>>>>>> What I'm doing (I did the last yesterday) is like that:
>>>>>>>>
>>>>>>>> 2020-12-28 * "TD" "Sell Put MO 15 JAN 2021 Strike 40 @0.40" #Option 
>>>>>>>> #Put #MO #Sell
>>>>>>>> Income:Options:TD -40.00 USD
>>>>>>>> Expenses:Comission:TD 0.67 USD
>>>>>>>> Assets:Account:TD 39.33 USD
>>>>>>>> Assets:Options 4000.00 USD
>>>>>>>> Liabilities:Opctions
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Where's the option?
>>>>>>>  
>>>>>>>
>>>>>>> I do 6 or 7 per month. I use the Assets:Options and 
>>>>>>>> Liabilities:Options in order to have a complete view about the money I 
>>>>>>>> must 
>>>>>>>> reserve in case I'm assigned.
>>>>>>>>
>>>>>>>
>>>>>>> Rule #1 of options trading: never get assigned! ;-)
>>>>>>>  
>>>>>>>  
>>>>>>>
>>>>>>>> Before each put, I check that Liabilities:Options is less that the 
>>>>>>>> money in Assets:account:TD
>>>>>>>>
>>>>>>>> Regards.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Dec 29, 2020 at 6:18 AM Rajath Agasthya <
>>>>>>>> rajatha...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Yeah, I figured each option could be a new commodity. I don't do a 
>>>>>>>>> lot of option trades, so I'm okay with having more commodities until 
>>>>>>>>> something better turns up. 
>>>>>>>>>
>>>>>>>>> The thing I'm not sure of is how to represent a trade where I'm 
>>>>>>>>> getting a credit (from selling a put or even a short sale of a 
>>>>>>>>> stock). I 
>>>>>>>>> can't quite seem to figure out the matching posting for this 
>>>>>>>>> transaction if 
>>>>>>>>> I represent receiving credit as a posting into a cash account such as 
>>>>>>>>> Assets:US:Schwab:Cash. Any thoughts on how to do this or an 
>>>>>>>>> example you can share?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>> On Monday, December 28, 2020 at 5:04:37 PM UTC-8 bl...@furius.ca 
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> On Mon, Dec 28, 2020 at 5:47 PM Rajath Agasthya <
>>>>>>>>>> rajatha...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> First of all, thanks to all the contributors (especially Martin) 
>>>>>>>>>>> for this wonderful tool! I'm new to double entry accounting and 
>>>>>>>>>>> Beancount, 
>>>>>>>>>>> but I'm blown away at how simple yet powerful this tool is, 
>>>>>>>>>>> especially when 
>>>>>>>>>>> combined with Fava. 
>>>>>>>>>>>
>>>>>>>>>>> I've been reading docs and I just started setting up my 
>>>>>>>>>>> beancount file. But as I setup my investment account, I'm a little 
>>>>>>>>>>> bit lost 
>>>>>>>>>>> as to how I should manage option trades. The trades where there is 
>>>>>>>>>>> a net 
>>>>>>>>>>> debit is straightforward (I think), but I'm not sure how to enter 
>>>>>>>>>>> trades 
>>>>>>>>>>> like selling a covered call or a put or a spread/multi-leg option 
>>>>>>>>>>> that 
>>>>>>>>>>> result in a credit. 
>>>>>>>>>>>
>>>>>>>>>>> Are there some examples I can refer to on how to manage option 
>>>>>>>>>>> trades? The docs mention options trading as a future topic to be 
>>>>>>>>>>> tackled 
>>>>>>>>>>> and I unfortunately couldn't find anything in the mailing list 
>>>>>>>>>>> (perhaps I 
>>>>>>>>>>> didn't search properly). So if anyone can point me in the right 
>>>>>>>>>>> direction, 
>>>>>>>>>>> I would really appreciate it.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I do options trading, but I only record simple options, never 
>>>>>>>>>> combos like this.
>>>>>>>>>> - The option can be encoded in the symbol name. This makes a lot 
>>>>>>>>>> of new commodities to declare and put out of commissions. I haven't 
>>>>>>>>>> yet 
>>>>>>>>>> figured out what needs to be done to make this a bit nicer (e.g. 
>>>>>>>>>> allow user 
>>>>>>>>>> to define a commodity regex/pattern for these).
>>>>>>>>>> - For stable asset types, I use leaf subaccounts; for options I 
>>>>>>>>>> don't (would be too many accounts, and it feels silly to create an 
>>>>>>>>>> account 
>>>>>>>>>> for a single position).
>>>>>>>>>> - For options combinations/"strategies", if you have some way to 
>>>>>>>>>> trade all the legs instantly, you should be able to either (a) 
>>>>>>>>>> insert all 
>>>>>>>>>> the individual legs and their prices in a single transaction, or, if 
>>>>>>>>>> the 
>>>>>>>>>> product is already securitized by your broker, trade it like any 
>>>>>>>>>> other 
>>>>>>>>>> product (one leg with the derivative instrument).
>>>>>>>>>>
>>>>>>>>>> Hope this helps, you do have to get a bit creative if you trade 
>>>>>>>>>> options, but, well, you trade options, so you will be able to figure 
>>>>>>>>>> out 
>>>>>>>>>> something :-)
>>>>>>>>>>
>>>>>>>>>>  
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Rajath
>>>>>>>>>>>
>>>>>>>>>>> -- 
>>>>>>>>>>> You received this message because you are subscribed to the 
>>>>>>>>>>> Google Groups "Beancount" group.
>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from 
>>>>>>>>>>> it, send an email to beancount+...@googlegroups.com.
>>>>>>>>>>> To view this discussion on the web visit 
>>>>>>>>>>> https://groups.google.com/d/msgid/beancount/51c57efc-8915-4edd-981a-cb997c1f143cn%40googlegroups.com
>>>>>>>>>>>  
>>>>>>>>>>> <https://groups.google.com/d/msgid/beancount/51c57efc-8915-4edd-981a-cb997c1f143cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>> -- 
>>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>>> Groups "Beancount" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>>> send an email to beancount+...@googlegroups.com.
>>>>>>>>> To view this discussion on the web visit 
>>>>>>>>> https://groups.google.com/d/msgid/beancount/b12e5c7d-f2d7-4b9c-8131-3cac25b17810n%40googlegroups.com
>>>>>>>>>  
>>>>>>>>> <https://groups.google.com/d/msgid/beancount/b12e5c7d-f2d7-4b9c-8131-3cac25b17810n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> -- 
>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>> Groups "Beancount" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>> send an email to beancount+...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit 
>>>>>>>> https://groups.google.com/d/msgid/beancount/CAM6BLCwOUD47fZz6o0WroYjvPHFhLcHYfSft6bdwiDW1sC%2B%2BSw%40mail.gmail.com
>>>>>>>>  
>>>>>>>> <https://groups.google.com/d/msgid/beancount/CAM6BLCwOUD47fZz6o0WroYjvPHFhLcHYfSft6bdwiDW1sC%2B%2BSw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "Beancount" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to beancount+...@googlegroups.com.
>>>>>>>
>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/beancount/CAK21%2BhMp0mVafPWRtdPYgFiQ1GmPLfpZgfaY_fdJJ_oZW74gZA%40mail.gmail.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/beancount/CAK21%2BhMp0mVafPWRtdPYgFiQ1GmPLfpZgfaY_fdJJ_oZW74gZA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Beancount" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to beancount+...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/beancount/652e0445-c9a1-4b0b-9084-67672d3207cbn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/beancount/652e0445-c9a1-4b0b-9084-67672d3207cbn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Beancount" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to beancount+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beancount/CAK21%2BhO_34Q_5k63ZfzP-8B%3DY%3DVg9CwYVQ4U8iL_ob_76jZabQ%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/beancount/CAK21%2BhO_34Q_5k63ZfzP-8B%3DY%3DVg9CwYVQ4U8iL_ob_76jZabQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/aaf4def9-e5c7-42a8-aff2-2c3b6eecf73en%40googlegroups.com.

Reply via email to