Hi,

having the following example file, I'm getting the error:

Test.bean:21:      No position matches 
"Posting(account='Assets:Crypto:USDT:Binance', units=-0.43686294 USDT, 
cost=CostSpec(number_per=Decimal('0.83161458'), number_total=None, 
currency='EUR', date=None, label=None, merge=False), price=0.83161458 EUR, 
flag=None, meta={'filename': 
'/media/Daten/03-Finanzen/00-Beancount/Test.BTCUSDT2.bean', 'lineno': 28})" 
against balance (134.27435124 USDT {0.83159490 EUR, 2020-12-17})

*File*

option "booking_method" "FIFO"
option "operating_currency" "EUR"
plugin "beancount.plugins.auto_accounts"

2020-12-15 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    Assets:Crypto:BTC:Binance              0.1 BTC {16000 EUR} @ 16000 EUR
    Equity:Opening                        -0.1 BTC {16000 EUR} @ 16000 EUR

2020-12-17 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    time: "08:50 "
    orderId: "123456789-01"
    Assets:Cash:Binance           111.77364000 EUR  
    Assets:Crypto:BTC:Binance      -0.00600000 BTC {} @ 18628.94000000 EUR
    Assets:Crypto:USDT:Binance    134.40876000 USDT {0.83159490 EUR} @ 
0.83159490 EUR
    Assets:Cash:Binance          -111.77364000 EUR  
    Assets:Crypto:USDT:Binance     -0.13440876 USDT {0.83159490 EUR} @ 
0.83159490 EUR
    Expenses:Commission:Binance     0.13440876 USDT  @ 0.83159490 EUR
    Income:Day-trading                              


2020-12-17 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    time: "08:50 "
    orderId: "123456789-02"
    Assets:Cash:Binance           363.30158788 EUR  
    Assets:Crypto:BTC:Binance      -0.01950200 BTC {} @ 18628.94000000 EUR
    Assets:Crypto:USDT:Binance    436.86293686 USDT {0.83161458 EUR} @ 
0.83161458 EUR
    Assets:Cash:Binance          -363.30158788 EUR  
    Assets:Crypto:USDT:Binance     -0.43686294 USDT {0.83161458 EUR} @ 
0.83161458 EUR
    Expenses:Commission:Binance     0.43686294 USDT  @ 0.83161458 EUR
    Income:Day-trading

I can't figure out why I'm gettig the error because the transaction is 
basically the same as the first one.  And the first transaction parses 
without error.
Furthermore, if I "split" the second transaction and move the commission 
expenses into a seperate transaction, I'm getting no error:

option "booking_method" "FIFO"
option "operating_currency" "EUR"
plugin "beancount.plugins.auto_accounts"

2020-12-15 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    Assets:Crypto:BTC:Binance              0.1 BTC {16000 EUR} @ 16000 EUR
    Equity:Opening                        -0.1 BTC {16000 EUR} @ 16000 EUR

2020-12-17 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    time: "08:50 "
    orderId: "123456789-01"
    Assets:Cash:Binance           111.77364000 EUR  
    Assets:Crypto:BTC:Binance      -0.00600000 BTC {} @ 18628.94000000 EUR
    Assets:Crypto:USDT:Binance    134.40876000 USDT {0.83159490 EUR} @ 
0.83159490 EUR
    Assets:Cash:Binance          -111.77364000 EUR  
    Assets:Crypto:USDT:Binance     -0.13440876 USDT {0.83159490 EUR} @ 
0.83159490 EUR
    Expenses:Commission:Binance     0.13440876 USDT  @ 0.83159490 EUR
    Income:Day-trading                              


2020-12-17 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    time: "08:50 "
    orderId: "123456789-02"
    Assets:Cash:Binance           363.30158788 EUR  
    Assets:Crypto:BTC:Binance      -0.01950200 BTC {} @ 18628.94000000 EUR
    Assets:Crypto:USDT:Binance    436.86293686 USDT {0.83161458 EUR} @ 
0.83161458 EUR
    Assets:Cash:Binance          -363.30158788 EUR  
    ; Assets:Crypto:USDT:Binance             -0.43686294 USDT {0.83161458 
EUR} @ 0.83161458 EUR
    ; Expenses:Commission:Binance     0.43686294 USDT  @ 0.83161458 EUR
    Income:Day-trading                              

2020-12-17 * "" "Trade BTCUSDT: SELL BTC for USDT" 
    Assets:Crypto:USDT:Binance     -0.43686294 USDT {0.83161458 EUR} @ 
0.83161458 EUR
    Expenses:Commission:Binance     0.43686294 USDT  @ 0.83161458 EUR

What am I doing wrong in the second transaction that beancount can't figure 
out the correspoding lot?

Regards

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/aa5b7b54-9bd1-4308-b872-7d3e52b1ef71n%40googlegroups.com.

Reply via email to