Martin,

just for my understanding. 

*Q1)* Why did you have to implement the *currency_accounts plugin* if you 
already have *beancount.plugins.unrealized*

Isn't the latter supposed to do exactly  what I asked for in my starting 
topic?

In the description, of the *beancount.plugins.unrealized *you write that 

*This will create a synthetic transaction at the date of the last of 
directives, that reflects the unrealized P/L. *

This was my understanding of exactly how Peter Selinger method 
<https://www.mathstat.dal.ca/~selinger/accounting/tutorial.html> is 
supposed to work

*Q2) *You write 
<https://docs.google.com/document/d/1WjARst_cSxNE-Lq6JnJ5CC41T3WndEsiMw4d46r2694/edit#>
that 

*"beancount.plugins.unrealized" "Unrealized" will create a synthetic 
transaction at the date of the last of directives, that reflects the 
unrealized P/L. It books one side as Income and the other side as a change 
in Asset.*

Is my understanding correct, that this will be a virtual transaction, kept 
only in memory and not to be seen in a text format anywhere?


On Thursday, February 28, 2019 at 5:45:58 AM UTC+1, Martin Blais wrote:
>
> Here, I finally did implemented a prototype:
>
> https://bitbucket.org/blais/beancount/commits/ecf5229f65fd574676cd47a060cfbe22152d12fb
> I guess it took me two hours.
>
> It's not entirely trivial; there are a few issues that keep this at the 
> level of "prototype":
>
> 1. the price annotations get stripped out, which means that if you used 
> the implicit_prices plugin AFTER this one, your prices might disappear. 
> Other plugins, such as sellgains, would also have to run BEFORE this one in 
> order to take effect. Custom scripts also would not see price annotations. 
> This could be fixed by changing the booking code to ignore the price 
> annotation for modified postings (identified via flag of the presence of 
> metadata). In other words, instead of removing the price annotations, keep 
> them but make them "lame" by inserting some metadata and requiring 
> collaboration with the booking code (it's a little bit ugly, but I'd be 
> okay with it).
>
> 2. In some cases - a transaction with multiple currency groups, at least 
> one price annotation, and some non-zero residual - a currency trading 
> account posting will be inserted in lieu of a residual posting. This messes 
> with the rounding feature that automatically inserts postings for residuals 
> (maybe it's not that big a deal). I think it could be improved further by 
> conditioning the insertion on multiple required currency account postings.
>
> For more about these limitations, see the test file (look for FIXME).
>
> I like this plugin. There's no need to change any of your input to use it 
> (it worked on my ledger without modification). Maybe I should finesse it 
> and this could become there by default in a future version. It works on my 
> personal large input file and does adds only an insignificant amount of 
> overhead. This is the most natural way to deal with conversions.
>
> See this file for usage instructions:
>
> https://bitbucket.org/blais/beancount/src/default/beancount/plugins/currency_accounts.py
>
>
> On Wed, Feb 27, 2019 at 9:17 PM Martin Blais <[email protected] 
> <javascript:>> wrote:
>
>> I believe it's absent.
>> In Beancount, what would be required is basically to sum up the balances 
>> of each currency group and insert new accounts.
>> It's not difficult, though it's not cheap, some optimizations might be 
>> required.
>>
>>
>>
>>
>>
>>
>> On Wed, Feb 27, 2019 at 9:14 PM Callum Makkai <[email protected] 
>> <javascript:>> wrote:
>>
>>>
>>> On 2/27/19 9:10 PM, Martin Blais wrote:
>>>
>>> An elegant way to handle this is to use the Selinger trading accounts 
>>> method.
>>> It would be easy to write a Beancount plugin to do this automatically.
>>>
>>>
>>> Jumping in here ... Martin, I was reading about the Selinger method the 
>>> other day. Do you know if ledger or hledger implements this method? Or it's 
>>> totally absent from all plain text packages?
>>>
>>> Callum
>>>
>>> -- 
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected] 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beancount/73b3eb60-39b3-3d64-37e4-0b82543fe40e%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/beancount/73b3eb60-39b3-3d64-37e4-0b82543fe40e%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/33ac0b66-aa2f-4a5f-924a-a1aaa0ca5b6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to