Possible price conversion issue with mixed-currency quotes
Denis Potapov
d at potapov.id.au
Mon Nov 2 01:49:24 EST 2026
Hi John,
No worries.
Is there a particular rationale behind this preference? From a purely
algorithmic design and generality perspective, the goal is to have a
single, general-purpose algorithm that finds the closest price using any
combination of available price records.
Cheers,
D.
On 2/11/26 15:01, John Ralls wrote:
> Nope, it’s on purpose. Direct prices take precedence over indirect ones.
>
> Regards,
> John Ralls
>
>
>> On Oct 29, 2026, at 16:24, Denis Potapov <d at potapov.id.au> wrote:
>>
>> Hi all,
>>
>> I think I may have found a bug in price conversion when a price database contains a mix of stock prices quoted in the book’s base currency and in another currency.
>>
>> For example, my book’s base currency is AUD, but SSS is quoted in USD on the exchange. In the attached screenshot, the balance sheet and price editor show SSS valued at 1,500 AUD, using the SSS price in USD and the USD-to-AUD exchange rate.
>>
>> The lower part of the screenshot shows the same windows, but with one additional price entry: an SSS price in AUD dated earlier than the USD-denominated prices. The balance sheet is set to use the price closest to the report date, but it uses the older AUD price and values SSS at 1,000 AUD instead.
>>
>> I traced this behavior to get_nearest_price in gnc-pricedb.cpp. The direct_price_conversion call appears to take precedence over indirect_price_conversion. I also tried changing the code to use indirect_price_conversion for all conversions, which seemed to avoid the issue.
>>
>> Does this sound like a bug that should be fixed? If so, I’d be happy to submit a patch or pull request.
>>
>> Thanks,
>>
>> D
>> <bugreport.png>_______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
More information about the gnucash-devel
mailing list