From a post from Simon on the hledger google group, I thought I'd understood that I can make auto-postings based on commodities using cur:<commodity>
(using the hledger query language). I've also included an example of an auto posting based on the account name.
= expr cur:GOOG
(Allocation:Equities:World) *1.0
= expr ^Assets:Investments:Pension:
(Assets:Virtual:NetPension) *0.8
2024-10-01 Test1
Assets:Investments:Pension:Blah = 60 GBP
Equity:Opening-Balances
2024-10-01 Test2
Assets:Investments:Stock:Blah = 60 GOOG
Equity:Opening-Balances
However, in the balance report I only see auto postings based on account name, not those based on commodity:
$ hledger bal --auto
60 GBP Assets:Investments:Pension:Blah
60 GOOG Assets:Investments:Stock:Blah
48 GBP Assets:Virtual:NetPension
-60 GBP
-60 GOOG Equity:Opening-Balances
--------------------
48 GBP
Why is Assets:Virtual:NetPension
there, but not Allocation:Equities:World
?