In my ledger I have USD's that I want to convert to CHF, so I need a price 
of USD in CHF as base price. I do it by adding following commodity:

2013-01-01 commodity USD
  price: "CHF:yahoo/USDCHF=X"

The base currency is encoded in the source specific symbol. Now, it might 
look weird that all tickers are listed twice here, but it is required 
because we need to convert from the symbols we use in our ledger, to 
symbols that are used by price source (which might differ).

On Monday, April 12, 2021 at 7:54:34 AM UTC+2 pat...@ch.tario.org wrote:

> True, looking at it from that point it makes sense to have it part of the 
> ticker. Thanks for the discussion.
>
>
> On April 11, 2021 11:45:40 PM GMT+02:00, Martin Blais <bl...@furius.ca> 
> wrote:
>>
>> I view these are different financial instruments altogether
>> spot fx: USD/JPY != USD/GBP
>> Ditto for DA:  BTC/USD != BTC/EUR
>>
>>
>>
>> On Sun, Apr 11, 2021 at 4:03 PM Patrick Ruckstuhl <pat...@ch.tario.org> 
>> wrote:
>>
>>> I think my cases are often cases where there is no "original" quote 
>>> currency. E.g. fx rates or crypto rates. At least for me it's very useful 
>>> to specify in which currency I want to get my rates.
>>>
>>> As an alternative I can create a custom ticker format.
>>>
>>> One related thing I'm not getting is, that both the source can specify 
>>> in which base it returns the quote but there is also the first part of the 
>>> base specified on the source string.
>>>
>>> On April 11, 2021 9:23:43 PM GMT+02:00, Martin Blais <bl...@furius.ca> 
>>> wrote:
>>>>
>>>> I don't think so.
>>>> Conversions is something you should be doing from the caller side.
>>>> Price sources should always return numbers in original quote currencies
>>>>
>>>>
>>>> On Sun, Apr 11, 2021, 14:52 'Patrick Ruckstuhl' via Beancount <
>>>> bean...@googlegroups.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I started looking into moving my price fetchers into beanprice and 
>>>>> noticed something.
>>>>>
>>>>> Most of my price sources actually allow you to specify in which base 
>>>>> ccy 
>>>>> to return the result.
>>>>>
>>>>> As far as I can tell, at the moment the Source interface
>>>>>
>>>>> https://github.com/beancount/beanprice/blob/master/beanprice/source.py
>>>>>
>>>>> doesn't have a way where you can request prices in a certain base ccy, 
>>>>> the only thing the source can do is specify in which base ccy it did 
>>>>> return them.
>>>>>
>>>>> Should the source contract be extended to (optionally) allow to 
>>>>> specify 
>>>>> the desired base ccy?
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Patrick
>>>>>
>>>>>
>>>>> -- 
>>>>> 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/dd26456f-bc40-356e-ada7-aa4729425355%40ch.tario.org
>>>>> .
>>>>>
>>>>

-- 
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/763bd7d7-92ff-4ecb-ad4f-70b6dc6d4171n%40googlegroups.com.

Reply via email to