This is how I would have done it:
```
P 2016-01-14 01:27:52 LTC $ 432.05
P 2016-01-17 17:19:08 LTC $ 372.92
2016/01/17=2016/01/20 * purchase on trading platform
Assets:Trading 24 LTC @@ $ 8849.77
Expenses:Trading costs $ 88.49
Assets:Bank $ -8938.26
2016-01-30 * transfer of LTC purchase
Assets:Trading -24 LTC
Assets:Mycelium 24 LTC
P 2016-07-26 18:00:00 LTC $ 399.99
2016-07-26 * transfer to trading platform
Assets:Mycelium -8 LTC
Assets:Trading 7.99975 LTC
Expenses:Transfer fees 0.0002 LTC {=$ 399.99}
Expenses:Trading costs 0.00005 LTC {=$ 399.99}
Revenue:Exchange 8 LTC
Revenue:Exchange -7.99975 LTC
Revenue:Exchange -0.0002 LTC {=$ 399.99}
Revenue:Exchange -0.00005 LTC {=$ 399.99}
2016-07-28 * transfer from trading platform
Assets:Trading -7.99975 LTC
Assets:Mycelium 7.99975 LTC
P 2016-08-03 21:35:02 LTC $ 539.48
```
```
$ ledger --args-only --file=/tmp/test.ledger bal
$ -8938.26
23.99975 LTC Assets
$ -8938.26 Bank
23.99975 LTC Mycelium
$ 88.49
0.00025 LTC {=$ 368.7405} Expenses
$ 88.49
0.00005 LTC {=$ 368.7405} Trading costs
0.00020 LTC {=$ 368.7405} Transfer fees
0.00025 LTC
-0.00025 LTC {=$ 368.7405} Revenue:Exchange
--------------------
$ -8849.77
24.00000 LTC
```
Thierry
On Sunday, November 13, 2016 at 8:50:06 PM UTC+1, Manuel Amador (Rudd-O)
wrote:
>
> Using ledger 3.1.1-1.fc24 I am seeing the following issue whenever I use
> the @= stanza to fix the price of an expenditure in an expense account
> (so that it won't fluctuate wildly with the exchange rate). Instead of
> the fraction of the lot getting the fixed price, *the entire lot* gets
> that fixed price.
>
> This looks like a bug to me. But, if it isn't, I would certainly
> appreciate people helping me figure out how I fix the price of an
> expenditure without fixing it for the rest of the lot.
>
> -----------------------------------
>
> P 2016-01-14 01:27:52 BTC $ 432.05
>
> P 2016-01-17 17:19:08 BTC $ 372.92
>
> 2016/01/17=2016/01/20 * purchase on trading platform
> Assets:Trading 24 LTC @ $ 368.7405
> Expenses:Trading costs $ 88.49
> Assets:Bank $ -8938.26
>
> 2016-01-30 * transfer of LTC purchase
> Assets:Trading -24 LTC {$ 368.7405}
> [2016/01/17] @ $ 368.7405
> Assets:Mycelium 24 LTC {$ 368.7405}
> [2016/01/17] @ $ 368.7405
>
> 2016-07-26 * transfer to trading platform
> Assets:Mycelium -8 LTC {$ 368.7405} [2016/01/17] @ $ 368.7405
> Assets:Trading 7.99975 LTC {$ 368.7405} [2016/01/17]
> @ $ 368.7405
> Expenses:Transfer fees 0.0002 LTC {$ 368.7405}
> [2016/01/17] @= $ 368.7405
> Expenses:Trading costs 0.00005 LTC {$ 368.7405}
> [2016/01/17] @= $ 368.7405
>
> 2016-07-28 * transfer from trading platform
> Assets:Trading -7.99975 LTC {$ 368.7405}
> [2016/01/17] @ $ 368.7405
> Assets:Mycelium 7.99975 LTC {$ 368.7405}
> [2016/01/17] @ $ 368.7405
>
> P 2016-08-03 21:35:02 BTC $ 539.48
>
> ;Expected ledger bal -f test
> ; $ -8938.26
> ; 23.99975 LTC Assets
> ; $ -8938.26 Bank
> ; 23.99975 LTC Mycelium
> ; $ 88.49
> ; 0.00025 LTC Expenses
> ; $ 88.49
> ;0.00005 LTC{=$ 368.7405} Trading costs
> ;0.00020 LTC{=$ 368.7405} Transfer fees
> ;--------------------
> ; $ -8849.77
> ; 24.00000 LTC
> ;
> ;Got ledger bal -f test
> ; $ -8938.26
> ;23.99975 LTC {=$ 368.7405} Assets
> ; $ -8938.26 Bank
> ;23.99975 LTC {=$ 368.7405} Mycelium
> ; $ 88.49
> ;0.00025 LTC {=$ 368.7405} Expenses
> ; $ 88.49
> ;0.00005 LTC {=$ 368.7405} Trading costs
> ;0.00020 LTC {=$ 368.7405} Transfer fees
> ;--------------------
> ; $ -8849.77
> ;24.00000 LTC {=$ 368.7405}
>
> --
> Rudd-O
> http://rudd-o.com/
>
>
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.