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't include it,=C2=A0it'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 <<a href=3D"mailto:[email protected]= > ">[email protected]</a>> 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> > > 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= >> > ><br> > > NVDA recently split 10:1. I previously purchased 2 shares:<br> > ><br> > > option "operating_currency" "USD"<br> > ><br> > > 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> > ><br> > > 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> > > 2024-02-14 pad Assets:Cash Equity:Opening-Balances<br> > ><br> > > 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> > > 2024-02-14 commodity NVDA<br> > ><br> > > 2024-02-14 * "Buying some NVDA" ""<br> > >=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> > >=C2=A0 =C2=A0 =C2=A0Assets:Cash<br> > ><br> > > 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> > > 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> > ><br> > > 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> > ><br> > > 2024-06-02 * "NVDA 10:1 stock split" ""<br> > >=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> > >=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> > ><br> > > bean-check fails, however:<br> > ><br> > > nvidia_split.beancount:24:=C2=A0 =C2=A0 =C2=A0 No position matches &qu= > ot;Posting(account=3D'Assets:Stocks:NVDA', units=3D-2 NVDA, cost=3D= > CostSpec(number_per=3DDecimal('1096.33'), number_total=3DNone, curr= > ency=3D'USD', date=3DNone, label=3DNone, merge=3DFalse), price=3DNo= > ne, flag=3DNone, meta=3D{'filename': 'nvidia_split.beancount= > 9;, 'lineno': 29})" against balance (2.00 NVDA {733.09 USD, 20= > 24-02-14})<br> > ><br> > > Explicitly using the lot in that transaction fails, too:<br> > ><br> > > 2024-06-02 * "NVDA 10:1 stock split" ""<br> > >=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA -2 NVDA {733.09 USD, 2024-02-14}= > @ 1096.33 USD<br> > >=C2=A0 =C2=A0 =C2=A0Assets:Stocks:NVDA 20 NVDA {109.633 USD}<br> > ><br> > > The error is:<br> > ><br> > > nvidia_split.beancount:24:=C2=A0 =C2=A0 =C2=A0 Transaction does not ba= > lance: (726.4800 USD)<br> > ><br> > >=C2=A0 =C2=A0 2024-06-02 * "NVDA 10:1 stock split" "&quo= > t;<br> > >=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> > ><br> > > 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> > ><br> > > What is the proper way to reflect a stock split?<br> > ><br> > > Thanks,<br> > > Brian<br> > ><br> > > [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> > > =E2=80=94 <br> > > Brian Lalor (he/him)<br> > > <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]= > rg</a><br> > ><br> ><br> > -- <br> > You received this message because you are subscribed to the Google Groups &= > quot;Beancount" 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" 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.
