# Chaining commodity prices. I have A=\>B and B=\>C, reports should give me A=\>C

**URL:** <https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261>\
**Category:** General\
**Tags:** beancount\
**Created:** [May 5, 2024, 4:43am UTC](https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261 "2024-05-05T04:43:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spch](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@spch](https://forum.plaintextaccounting.org/u/spch)\
**Post date:** [May 5, 2024, 4:43am UTC](https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261/1 "2024-05-05T04:43:19Z")

</div>

I have some investments that are USD denominated, and most of my other transactions are in my home currency INR.

I have registered the following prices -

2023/04/01 price USD 82.18 INR  
2023/07/01 price USD 82.10 INR  
2023/10/01 price USD 83.04 INR  
2024/01/01 price USD 83.2 INR  
2024/04/01 price USD 83.44 INR  
2023/07/01 price INVESTMENT 1.964 USD  
2024/01/01 price INVESTMENT 1.964 USD

But it is not converting automatically from INVESTMENT to INR.

Is there any way to do this? In beancount or ledger?

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [May 5, 2024, 5:29am UTC](https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261/2 "2024-05-05T05:29:15Z")

</div>

That should work in h/ledger at least. Do beancount docs say it's supported ?

---

<div class="post-metadata">

**Author:** ![spch](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@spch](https://forum.plaintextaccounting.org/u/spch)\
**Post date:** [May 5, 2024, 5:44am UTC](https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261/3 "2024-05-05T05:44:14Z")

</div>

I didn't find anything related to this in the beancount docs. Was hoping to find something here since all my data is in beancount currently

---

<div class="post-metadata">

**Author:** ![tario](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/tario/32/9_2.png) [@tario](https://forum.plaintextaccounting.org/u/tario)\
**Post date:** [May 5, 2024, 7:21am UTC](https://forum.plaintextaccounting.org/t/chaining-commodity-prices-i-have-a-b-and-b-c-reports-should-give-me-a-c/261/4 "2024-05-05T07:21:26Z")

</div>

It doesn't work out of the box in beancount, but I created a plugin which solves it (or at least the cases I needed)

[https://tariochbctools.readthedocs.io/en/latest/plugins.html#generate-base-ccy-prices](https://tariochbctools.readthedocs.io/en/latest/plugins.html#generate-base-ccy-prices)

Basically it will create virtual price entries out of the combination.
