Martin Blais wrote:
> --000000000000ccec4f061b85622f
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> Your price annotation is incorrect (the price on that date woudl be
> different), don't include it, it'll insert the wrong price in the price
> database.

  it hasn't caused problems to me as of yet that i've
noticed, but i removed them and nothing went out of
balance so that's good to know.


> On Sat, Jun 22, 2024 at 10:16=E2=80=AFPM fin <[email protected]> wrote:
>
>> Brian Lalor wrote:
>> > I know this has been discussed a few times, but the docs are still
>> incorrect and I=E2=80=99m unable to find a complete example.  I=E2=80=99m=
>  using beancount
>> v2 because Fava=E2=80=99s not been updated for v3, yet.
>> >
>> > NVDA recently split 10:1. I previously purchased 2 shares:
>> >
>> > option "operating_currency" "USD"
>> >
>> > 2024-02-14 open Equity:Opening-Balances
>>        USD
>> >
>> > 2024-02-14 open Assets:Cash
>>        USD
>> > 2024-02-14 pad Assets:Cash Equity:Opening-Balances
>> >
>> > 2024-02-14 open Assets:Stocks:NVDA
>>         NVDA
>> > 2024-02-14 commodity NVDA
>> >
>> > 2024-02-14 * "Buying some NVDA" ""
>> >     Assets:Stocks:NVDA
>>    2.00 NVDA {733.09 USD}
>> >     Assets:Cash
>> >
>> > 2024-05-31 balance Assets:Stocks:NVDA
>>      2 NVDA
>> > 2024-05-31 balance Assets:Cash
>>    0.00 USD
>> >
>> > The pre-split stock price (per Yahoo and bean-price) was 1,096.33, and
>> my Fidelity account confirms that I have 20 shares.  Per the docs[1], I
>> would do (I think):
>> >
>> > 2024-06-02 * "NVDA 10:1 stock split" ""
>> >     Assets:Stocks:NVDA
>>      -2 NVDA {1,096.33 USD}
>> >     Assets:Stocks:NVDA
>>      50 NVDA {109.633 USD}
>> >
>> > bean-check fails, however:
>> >
>> > nvidia_split.beancount:24:      No position matches
>> "Posting(account=3D'Assets:Stocks:NVDA', units=3D-2 NVDA,
>> cost=3DCostSpec(number_per=3DDecimal('1096.33'), number_total=3DNone,
>> currency=3D'USD', date=3DNone, label=3DNone, merge=3DFalse), price=3DNone=
> , flag=3DNone,
>> meta=3D{'filename': 'nvidia_split.beancount', 'lineno': 29})" against bal=
> ance
>> (2.00 NVDA {733.09 USD, 2024-02-14})
>> >
>> > Explicitly using the lot in that transaction fails, too:
>> >
>> > 2024-06-02 * "NVDA 10:1 stock split" ""
>> >     Assets:Stocks:NVDA -2 NVDA {733.09 USD, 2024-02-14} @ 1096.33 USD
>> >     Assets:Stocks:NVDA 20 NVDA {109.633 USD}
>> >
>> > The error is:
>> >
>> > nvidia_split.beancount:24:      Transaction does not balance: (726.4800
>> USD)
>> >
>> >    2024-06-02 * "NVDA 10:1 stock split" ""
>> >      Assets:Stocks:NVDA  -2.00 NVDA {733.09 USD, 2024-02-14} @ 1096.33
>> USD
>>
>>
>>   I write those as (but I also include a label):
>>
>>       Assets:Stocks:NVDA     -2 NVDA {733.09 USD, 2024-02-14} @ 733.09 US=
> D
>>       Assets:Stocks:NVDA     20 NVDA {73.309 USD, 2024-02-14}
>>
>>
>>   IMO the basis and purchase date of this lot should not be changed by a
>> split.
>>
>> $ hld
>>
>> Account                 Units  Currency  Cost Currency  Average Cost
>> Price  Book Value  Market Value
>> ------------------  ---------  --------  -------------  ------------
>> -----  ----------  ------------
>> Assets:Cash         -1,466.18       USD            USD
>>     -1,466.18     -1,466.18
>> Assets:Stocks:NVDA      20.00      NVDA            USD         73.31
>>      1,466.18
>> ------------------  ---------  --------  -------------  ------------
>> -----  ----------  ------------
>>
>>
>>
>> >
>> > So it seems the price of 1096.33 is being ignored and I=E2=80=99m tryin=
> g to
>> purchase 20 shares at 109.633 USD using 2*733.09 USD and the =E2=80=9Cgai=
> n=E2=80=9D of
>> 363.24 USD per share is being lost.
>> >
>> > What is the proper way to reflect a stock split?
>> >
>> > Thanks,
>> > Brian
>> >
>> > [1]:
>> https://beancount.github.io/docs/trading_with_beancount.html#stock-splits
>> > =E2=80=94
>> > Brian Lalor (he/him)
>> > [email protected]
>> >
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/beancount/q4dkkk-f7i.ln1%40anthive.com.
>>
>
> --=20
> 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 e=
> mail to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/=
> beancount/CAK21%2BhMMfgLiTZ%3D5aRZgsQ6SRvaymf_tY3r9jB%2BmWpuUkc89iQ%40mail.=
> gmail.com.
>
> --000000000000ccec4f061b85622f
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,sa=
> ns-serif;font-size:small">Your price annotation is incorrect (the price on =
> that date woudl=C2=A0be different), don&#39;t include it,=C2=A0it&#39;ll in=
> sert the wrong price in the price database.</div><div class=3D"gmail_defaul=
> t" style=3D"font-family:arial,sans-serif;font-size:small"><br></div></div><=
> br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat,=
>  Jun 22, 2024 at 10:16=E2=80=AFPM fin &lt;<a href=3D"mailto:[email protected]=
> ">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
>  style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
> adding-left:1ex">Brian Lalor wrote:<br>
> &gt; I know this has been discussed a few times, but the docs are still inc=
> orrect and I=E2=80=99m unable to find a complete example.=C2=A0 I=E2=80=99m=
>  using beancount v2 because Fava=E2=80=99s not been updated for v3, yet.<br=
>>
> &gt;<br>
> &gt; NVDA recently split 10:1. I previously purchased 2 shares:<br>
> &gt;<br>
> &gt; option &quot;operating_currency&quot; &quot;USD&quot;<br>
> &gt;<br>
> &gt; 2024-02-14 open Equity:Opening-Balances=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USD<br>
> &gt;<br>
> &gt; 2024-02-14 open Assets:Cash=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0US=
> D<br>
> &gt; 2024-02-14 pad Assets:Cash Equity:Opening-Balances<br>
> &gt;<br>
> &gt; 2024-02-14 open Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NVDA<br>
> &gt; 2024-02-14 commodity NVDA<br>
> &gt;<br>
> &gt; 2024-02-14 * &quot;Buying some NVDA&quot; &quot;&quot;<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A02.00 NVDA {733.09 USD}<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Cash<br>
> &gt;<br>
> &gt; 2024-05-31 balance Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02 NVDA<br>
> &gt; 2024-05-31 balance Assets:Cash=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.00 USD<br>
> &gt;<br>
> &gt; The pre-split stock price (per Yahoo and bean-price) was 1,096.33, and=
>  my Fidelity account confirms that I have 20 shares.=C2=A0 Per the docs[1],=
>  I would do (I think):<br>
> &gt;<br>
> &gt; 2024-06-02 * &quot;NVDA 10:1 stock split&quot; &quot;&quot;<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0-2 NVDA {1,096.33 USD}<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
>=A0 =C2=A0 =C2=A050 NVDA {109.633 USD}<br>
> &gt;<br>
> &gt; bean-check fails, however:<br>
> &gt;<br>
> &gt; nvidia_split.beancount:24:=C2=A0 =C2=A0 =C2=A0 No position matches &qu=
> ot;Posting(account=3D&#39;Assets:Stocks:NVDA&#39;, units=3D-2 NVDA, cost=3D=
> CostSpec(number_per=3DDecimal(&#39;1096.33&#39;), number_total=3DNone, curr=
> ency=3D&#39;USD&#39;, date=3DNone, label=3DNone, merge=3DFalse), price=3DNo=
> ne, flag=3DNone, meta=3D{&#39;filename&#39;: &#39;nvidia_split.beancount&#3=
> 9;, &#39;lineno&#39;: 29})&quot; against balance (2.00 NVDA {733.09 USD, 20=
> 24-02-14})<br>
> &gt;<br>
> &gt; Explicitly using the lot in that transaction fails, too:<br>
> &gt;<br>
> &gt; 2024-06-02 * &quot;NVDA 10:1 stock split&quot; &quot;&quot;<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA -2 NVDA {733.09 USD, 2024-02-14}=
>  @ 1096.33 USD<br>
> &gt;=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA 20 NVDA {109.633 USD}<br>
> &gt;<br>
> &gt; The error is:<br>
> &gt;<br>
> &gt; nvidia_split.beancount:24:=C2=A0 =C2=A0 =C2=A0 Transaction does not ba=
> lance: (726.4800 USD)<br>
> &gt;<br>
> &gt;=C2=A0 =C2=A0 2024-06-02 * &quot;NVDA 10:1 stock split&quot; &quot;&quo=
> t;<br>
> &gt;=C2=A0 =C2=A0 =C2=A0 Assets:Stocks:NVDA=C2=A0 -2.00 NVDA {733.09 USD, 2=
> 024-02-14} @ 1096.33 USD<br>
><br>
><br>
>=C2=A0 I write those as (but I also include a label):<br>
><br>
>=C2=A0 =C2=A0 =C2=A0 Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0-2 NVDA {733.09 =
> USD, 2024-02-14} @ 733.09 USD<br>
>=C2=A0 =C2=A0 =C2=A0 Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A020 NVDA {73.309 =
> USD, 2024-02-14}<br>
><br>
><br>
>=C2=A0 IMO the basis and purchase date of this lot should not be changed by=
>  a<br>
> split.<br>
><br>
> $ hld<br>
><br>
> Account=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Units=
>=C2=A0 Currency=C2=A0 Cost Currency=C2=A0 Average Cost=C2=A0 Price=C2=A0 Bo=
> ok Value=C2=A0 Market Value<br>
> ------------------=C2=A0 ---------=C2=A0 --------=C2=A0 -------------=C2=A0=
>  ------------=C2=A0 -----=C2=A0 ----------=C2=A0 ------------<br>
> Assets:Cash=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-1,466.18=C2=A0 =C2=A0 =C2=A0 =
>=C2=A0USD=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 USD=C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -1,466.18=C2=
>=A0 =C2=A0 =C2=A0-1,466.18<br>
> Assets:Stocks:NVDA=C2=A0 =C2=A0 =C2=A0 20.00=C2=A0 =C2=A0 =C2=A0 NVDA=C2=A0=
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 USD=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A073=
> .31=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01,466.18=C2=A0 =C2=A0 =C2=A0 =
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>
> ------------------=C2=A0 ---------=C2=A0 --------=C2=A0 -------------=C2=A0=
>  ------------=C2=A0 -----=C2=A0 ----------=C2=A0 ------------<br>
><br>
><br>
><br>
> &gt;<br>
> &gt; So it seems the price of 1096.33 is being ignored and I=E2=80=99m tryi=
> ng to purchase 20 shares at 109.633 USD using 2*733.09 USD and the =E2=80=
>=9Cgain=E2=80=9D of 363.24 USD per share is being lost.<br>
> &gt;<br>
> &gt; What is the proper way to reflect a stock split?<br>
> &gt;<br>
> &gt; Thanks,<br>
> &gt; Brian<br>
> &gt;<br>
> &gt; [1]: <a href=3D"https://beancount.github.io/docs/trading_with_beancoun=
> t.html#stock-splits" rel=3D"noreferrer" target=3D"_blank">https://beancount=
> .github.io/docs/trading_with_beancount.html#stock-splits</a><br>
> &gt; =E2=80=94 <br>
> &gt; Brian Lalor (he/him)<br>
> &gt; <a href=3D"mailto:[email protected]"; target=3D"_blank">[email protected]=
> rg</a><br>
> &gt;<br>
><br>
> -- <br>
> You received this message because you are subscribed to the Google Groups &=
> quot;Beancount&quot; group.<br>
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to <a href=3D"mailto:beancount%[email protected]"; target=
>=3D"_blank">[email protected]</a>.<br>
> To view this discussion on the web visit <a href=3D"https://groups.google.c=
> om/d/msgid/beancount/q4dkkk-f7i.ln1%40anthive.com" rel=3D"noreferrer" targe=
> t=3D"_blank">https://groups.google.com/d/msgid/beancount/q4dkkk-f7i.ln1%40a=
> nthive.com</a>.<br>
></blockquote></div>
>
><p></p>
>
> -- <br />
> You received this message because you are subscribed to the Google Groups &=
> quot;Beancount&quot; group.<br />
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to <a href=3D"mailto:[email protected]";>beancount=
> [email protected]</a>.<br />
> To view this discussion on the web visit <a href=3D"https://groups.google.c=
> om/d/msgid/beancount/CAK21%2BhMMfgLiTZ%3D5aRZgsQ6SRvaymf_tY3r9jB%2BmWpuUkc8=
> 9iQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups=
> .google.com/d/msgid/beancount/CAK21%2BhMMfgLiTZ%3D5aRZgsQ6SRvaymf_tY3r9jB%2=
> BmWpuUkc89iQ%40mail.gmail.com</a>.<br />
>
> --000000000000ccec4f061b85622f--
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/03ikkk-q4l.ln1%40anthive.com.

Reply via email to