Re: currency trading accounts

2022-02-14 Thread Pierre
Big step for my comprehension. Thank you @Pranesh 

On Sunday, February 13, 2022 at 1:17:41 PM UTC+1 the.so...@gmail.com wrote:

> Dear Pierre,
> I just today saw this discussion. I made the change to the wiki, and would 
> like to explain the change.
>
> Multiple functions are served by commodity/currency trading accounts:
>
> 1. They enable the trial balance to be "0", regardless of the commodity 
> which you use (with `-X`)
> 2. They act as a store of unrealized gains, when prices are changed using 
> price directives.
>
> Function 1 will be served regardless of the naming pattern of the 
> commodity trading accounts.
>
> However, for fully realizing Function 2, the naming convention makes a 
> difference.  Depending on the naming pattern, you can either find out your 
> total unrealized gains (for instance, from all your stocks, etc., taken 
> together), or you can find out unrealized gains from each commodity pair 
> (for instance, the gain for each stock separately).  
>
> If you want more granular reporting of unrealized gains, having a "parent" 
> sub-account where both commodities in a commodity pair are represented is 
> important. Without that, you can't get a single account balance to tell you 
> the gain/loss: you'll need the balance of two accounts. 
>
> So using `Equity:Trading:AUD-EUR:AUD` and `Equity:Trading:AUD-EUR:EUR` 
> will allow you to see the unrealized gains for the AUD-EUR pair by running 
> `ledger bal Equity:Trading;AUD-EUR -X EUR` which, if you use 
> `Equity:Trading:AUD:EUR` and `Equity:Trading:EUR:AUD` will need two 
> separate accounts to be mentioned: `ledger bal Equity:Trading:AUD:EUR 
> Equity:Trading:EUR:AUD -X EUR`.
>
> Now, if you have multiple commodity pairs, and want a tree view, then the 
> `AUD:EUR` / `EUR:AUD` naming pattern makes it very difficult. Whereas with 
> `--depth`, getting unrealized gains for multiple commodity pairs is very 
> easy if you use the `:COMM1-COMM2:` naming pattern.  Of course, you need to 
> be consistent in which of the two commodities you use as "COMM1".  I tend 
> to think of a single currency as the "base" currency in the transaction, 
> and use that as "COMM1".  You could also just go by alphabetical order.
>
> I hope that helps.  In case it is still not clear, try constructing an 
> example journal with multiple commodities (at least 3) in both styles and 
> play around with the reports.  That ought to help.
>
> Cheers,
> Pranesh
>
>
> On Friday, 31 December, 2021 at 11:55:40 pm UTC+5:30 Pierre Bastoul wrote:
>
>> Thank you guys for that 2 tools. I will try to understand them.
>>
>> On Friday, December 31, 2021 at 12:35:48 AM UTC+1 d10 wrote:
>>
>>> On Wednesday, December 29, 2021 at 12:51:22 PM UTC-5 Pierre wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm working on tracking my cryptocurrencies trades with ledger-cli as 
>>>> described in the "Multiple currencies with currency trading accounts 
>>>> <https://github.com/ledger/ledger/wiki/Multiple-currencies-with-currency-trading-accounts>"
>>>>  wiki 
>>>> page.
>>>>
>>>>
>>> Check out lotter, https://src.d10.dev/lotter.  It's goal is to let you 
>>> express your trades in ledger-cli and calculate cost basis for you.
>>>  
>>>
>>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/e6778bbc-15b3-4d29-847e-863c0a9affe1n%40googlegroups.com.


Re: currency trading accounts

2022-02-13 Thread Alan Schmitt

> I hope that helps.

It does, thank you very much.

Alan

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87fsol991q.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: currency trading accounts

2022-02-13 Thread the.so...@gmail.com
On Sunday, 13 February, 2022 at 9:40:57 pm UTC+5:30 
alan.s...@polytechnique.org wrote:

> Hello, 
>
> Would you also recommend this method to track investments, such as 
> stocks? 
>

This is indeed the method I use for all commodity conversions, including 
stocks.  I use the ISIN of the stocks as the commodity symbol, and use the 
stock exchange scrip symbol as well in the account, and follow this pattern:

Equity:Trading:Shares:JUNIORBEES:INR-INF732E01045:INF732E01045
Equity:Trading:Shares:JUNIORBEES:INR-INF732E01045:INR

... and the asset follows the pattern:

Assets:Investment:Equity:Shares:JUNIORBEES

(Do note that the "Equity" in the account name here refers to the type of 
investment, rather than the (Assets – Liabilities).  I use this to know how 
much of my investments are in equity, how much in debt, how much in cash & 
cash equivalents, how much in property, and how much in tangibles.)

To know the cost (the invested amount), one can use the query:
`ledger bal Equity:Trading:Shares:JUNIORBEES:INR-INF732E01045:INR`

or for all your shares:

`ledger bal '^Equity:Trading:Shares:.*:INR$'`

I hope that helps.

Cheers,
Pranesh

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/835af947-22ea-4662-9538-f33529778c94n%40googlegroups.com.


Re: currency trading accounts

2022-02-13 Thread Alan Schmitt
Hello,

Would you also recommend this method to track investments, such as
stocks?

Best regards,

Alan Schmitt

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87wnhyu4qc.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: currency trading accounts

2022-02-13 Thread the.so...@gmail.com
Dear Pierre,
I just today saw this discussion. I made the change to the wiki, and would 
like to explain the change.

Multiple functions are served by commodity/currency trading accounts:

1. They enable the trial balance to be "0", regardless of the commodity 
which you use (with `-X`)
2. They act as a store of unrealized gains, when prices are changed using 
price directives.

Function 1 will be served regardless of the naming pattern of the commodity 
trading accounts.

However, for fully realizing Function 2, the naming convention makes a 
difference.  Depending on the naming pattern, you can either find out your 
total unrealized gains (for instance, from all your stocks, etc., taken 
together), or you can find out unrealized gains from each commodity pair 
(for instance, the gain for each stock separately).  

If you want more granular reporting of unrealized gains, having a "parent" 
sub-account where both commodities in a commodity pair are represented is 
important. Without that, you can't get a single account balance to tell you 
the gain/loss: you'll need the balance of two accounts. 

So using `Equity:Trading:AUD-EUR:AUD` and `Equity:Trading:AUD-EUR:EUR` will 
allow you to see the unrealized gains for the AUD-EUR pair by running 
`ledger bal Equity:Trading;AUD-EUR -X EUR` which, if you use 
`Equity:Trading:AUD:EUR` and `Equity:Trading:EUR:AUD` will need two 
separate accounts to be mentioned: `ledger bal Equity:Trading:AUD:EUR 
Equity:Trading:EUR:AUD -X EUR`.

Now, if you have multiple commodity pairs, and want a tree view, then the 
`AUD:EUR` / `EUR:AUD` naming pattern makes it very difficult. Whereas with 
`--depth`, getting unrealized gains for multiple commodity pairs is very 
easy if you use the `:COMM1-COMM2:` naming pattern.  Of course, you need to 
be consistent in which of the two commodities you use as "COMM1".  I tend 
to think of a single currency as the "base" currency in the transaction, 
and use that as "COMM1".  You could also just go by alphabetical order.

I hope that helps.  In case it is still not clear, try constructing an 
example journal with multiple commodities (at least 3) in both styles and 
play around with the reports.  That ought to help.

Cheers,
Pranesh


On Friday, 31 December, 2021 at 11:55:40 pm UTC+5:30 Pierre Bastoul wrote:

> Thank you guys for that 2 tools. I will try to understand them.
>
> On Friday, December 31, 2021 at 12:35:48 AM UTC+1 d10 wrote:
>
>> On Wednesday, December 29, 2021 at 12:51:22 PM UTC-5 Pierre wrote:
>>
>>> Hello,
>>>
>>> I'm working on tracking my cryptocurrencies trades with ledger-cli as 
>>> described in the "Multiple currencies with currency trading accounts 
>>> <https://github.com/ledger/ledger/wiki/Multiple-currencies-with-currency-trading-accounts>"
>>>  wiki 
>>> page.
>>>
>>>
>> Check out lotter, https://src.d10.dev/lotter.  It's goal is to let you 
>> express your trades in ledger-cli and calculate cost basis for you.
>>  
>>
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/d5bac723-eaf8-4afc-8371-03ee164f125fn%40googlegroups.com.


Re: currency trading accounts

2021-12-31 Thread Pierre Bastoul
Thank you guys for that 2 tools. I will try to understand them.

On Friday, December 31, 2021 at 12:35:48 AM UTC+1 d10 wrote:

> On Wednesday, December 29, 2021 at 12:51:22 PM UTC-5 Pierre wrote:
>
>> Hello,
>>
>> I'm working on tracking my cryptocurrencies trades with ledger-cli as 
>> described in the "Multiple currencies with currency trading accounts 
>> <https://github.com/ledger/ledger/wiki/Multiple-currencies-with-currency-trading-accounts>"
>>  wiki 
>> page.
>>
>>
> Check out lotter, https://src.d10.dev/lotter.  It's goal is to let you 
> express your trades in ledger-cli and calculate cost basis for you.
>  
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/b81bdae6-07f7-4652-b7e2-c7b37e9bdf58n%40googlegroups.com.


Re: currency trading accounts

2021-12-30 Thread d10


On Wednesday, December 29, 2021 at 12:51:22 PM UTC-5 Pierre wrote:

> Hello,
>
> I'm working on tracking my cryptocurrencies trades with ledger-cli as 
> described in the "Multiple currencies with currency trading accounts 
> <https://github.com/ledger/ledger/wiki/Multiple-currencies-with-currency-trading-accounts>"
>  wiki 
> page.
>
>
Check out lotter, https://src.d10.dev/lotter.  It's goal is to let you 
express your trades in ledger-cli and calculate cost basis for you.
 

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/7511e016-391e-45d0-a27c-ffde78637916n%40googlegroups.com.


Re: currency trading accounts

2021-12-29 Thread John Wiegley
>>>>> "PB" == Pierre Bastoul  writes:

PB> I'm working on tracking my cryptocurrencies trades with ledger-cli as
PB> described in the "Multiple currencies with currency trading accounts "
PB> wiki page.

I'd like to note that my trade-journal project:

  https://github.com/jwiegley/trade-journal

Is aiming at providing good support for crypto transactions, including
taxation laws for different countries (it will be a modular system). The first
version will work on CSV exports of Coinbase fills, and so far only support
staking operation for one crypto (ICP). But again, it's meant to be fully
modular.

The idea is to take data from a crypto exchange, apply know-how in terms of
staking taxation events and local tax laws, and then to output a Ledger file
that allows you to do your year-end and performance reporting.

John

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2czlevaso.fsf%40newartisans.com.


Re: currency trading accounts

2021-12-29 Thread Pierre
oh, I'm sorry but what  the "tax man" has to do here? I've  poorly 
explained, but my point is not to hide something. In the country I live, 
I'm not supposed to provide a book of records to the "tax man", it is not 
mandatory for personal finance.

I probably do not understand your answer. 

I just want to use Ledger mainly because I suppose it can help me see 
clearly what my money does, and answer very precisely what are my 
loss/gains, expenses/incomes...
Buying some BTC with USDT is not a strange operation nowadays, after 2 or 3 
trades of this kind, getting loss or gains is not so trivial, I hoped that 
Ledger could help me on that. Even if that kind of transaction does not 
involve or is linked to my own home currencies. We can probably think of 
that as a trade made directly between apples and oranges, does it change 
something if we call them cryptocurrencies?

As I understand the -X operator for ledger,  will give me a full report in 
the home currency if I want it.

 




On Wednesday, December 29, 2021 at 10:47:30 PM UTC+1 Ajoeibin wrote:

> On Wed, Dec 29, 2021 at 11:51 AM Pierre Bastoul  wrote:
> >
> > Hello,
> >
> > I'm working on tracking my cryptocurrencies trades with ledger-cli as 
> described in the "Multiple currencies with currency trading accounts" wiki 
> page.
> >
> > My first idea is not to have a default Fiat, I prefer not having a local 
> currency point of view. I want to be able to track trades for all pairs 
> like BTC to USDT, then BTC to ETH, the ETH to USD, and be able to do 
> "swaps" in all available possible combinations.
> >
> > So I started with only one trading account, expressed in many currencies:
> > Equity:Trading:USD
> > Equity:Trading:ETH
> > Equity:Trading:BTC
> > Equity:Trading:JPY
> > 
> >
>
> Greetings
>
> Hmm - - - well - - - most of us keep our records (record keeping -
> - - -most
> commonly called accounting) as much for the tax man (the man) as we do
> to manage
> our businesses or our finances.
>
> The requirement for 'books' for the taxman is that 'everything' is in
> ONE currency.
> If other currencies are used everything is linked back to that 'home' 
> currency.
>
> The tax man really doesn't care about your costs or what you're spending 
> money
> on or most of any other details. They're looking to see that your income is
> reported accurately and that you're not trying to 'fiddle the books' by 
> either
> misreporting income or expenses.
> So if you're insisting that any currency goes - - - - well - - - I hope you
> really never get audited. My guess is that that process would be very
> very painful.
>
> Haven't had the joy myself but I've heard that they use a fine toothed
> comb to make sure that not one hair is out of place on your hemorrhoids.
>
> I'm trying to come up with a way to use ledger for invoicing which
> would be hugely useful for business purposes. I would suggest that
> what you're looking for would be fine if you do it for just you but I
> wouldn't suggest that a any currency goes in a general ledger be
> a normal thing. (And yes, right now I'm usually only using 3 currencies
> so I'm not just using a 'home' currency.) Just because one can
> do something doesn't mean that you 'should' do it.
>
> Regards
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/96da0384-f186-4a37-b60a-81b8da5094bfn%40googlegroups.com.


Re: currency trading accounts

2021-12-29 Thread o1bigtenor
On Wed, Dec 29, 2021 at 11:51 AM Pierre Bastoul  wrote:
>
> Hello,
>
> I'm working on tracking my cryptocurrencies trades with ledger-cli as 
> described in the "Multiple currencies with currency trading accounts" wiki 
> page.
>
> My first idea is not to have a default Fiat, I prefer not having a local 
> currency point of view. I want to be able to track trades for all pairs like 
> BTC to USDT, then BTC to ETH, the ETH to USD, and be able to do "swaps" in 
> all available possible combinations.
>
> So I started with only one trading account, expressed in many currencies:
> Equity:Trading:USD
> Equity:Trading:ETH
> Equity:Trading:BTC
> Equity:Trading:JPY
> 
>

Greetings

Hmm - - - well - - - most of us keep our records (record keeping -
- - -most
commonly called accounting) as much for the tax man (the man) as we do
to manage
our businesses or our finances.

The requirement for 'books' for the taxman is that 'everything' is in
ONE currency.
If other currencies are used everything is linked back to that 'home' currency.

The tax man really doesn't care about your costs or what you're spending money
on or most of any other details. They're looking to see that your income is
reported accurately and that you're not trying to 'fiddle the books' by either
misreporting income or expenses.
So if you're insisting that any currency goes - - - - well - - - I hope you
really never get audited. My guess is that that process would be very
very painful.

Haven't had the joy myself but I've heard that they use a fine toothed
comb to make sure that not one hair is out of place on your hemorrhoids.

I'm trying to come up with a way to use ledger for invoicing which
would be hugely useful for business purposes. I would suggest that
what you're looking for would be fine if you do it for just you but I
wouldn't suggest that a any currency goes in a general ledger be
a normal thing. (And yes, right now I'm usually only using 3 currencies
so I'm not just using a 'home' currency.) Just because one can
do something doesn't mean that you 'should' do it.

Regards

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAPpdf58Ccv2m5-7WUtL9va4jbrwCTaA6UgkR3njU-sMuocGKtQ%40mail.gmail.com.


currency trading accounts

2021-12-29 Thread Pierre Bastoul
Hello,

I'm working on tracking my cryptocurrencies trades with ledger-cli as 
described in the "Multiple currencies with currency trading accounts 
<https://github.com/ledger/ledger/wiki/Multiple-currencies-with-currency-trading-accounts>"
 wiki 
page.

My first idea is not to have a default Fiat, I prefer not having a local 
currency point of view. I want to be able to track trades for all pairs 
like BTC to USDT, then BTC to ETH, the ETH to USD, and be able to do 
"swaps" in all available possible combinations.

So I started with only one trading account, expressed in many currencies:
Equity:Trading:USD
Equity:Trading:ETH
Equity:Trading:BTC
Equity:Trading:JPY


Then I made a trading account per currency, with multiple currencies in 
each:
Equity:Trading:ETH:USD
Equity:Trading:ETH:JPY
Equity:Trading:ETH:BTC
Equity:Trading:BTC:USD
Equity:Trading:BTC:JPY
because I want to be able to calculate Gain/loss for each currencies.

And then, discovered another chart naming model in the recent update in the 
wiki page:
Equity:Trading:ETH-BTC:USD
Equity:Trading:ETH-BTC:JPY
Equity:Trading:ETH-BTC:BTC
Equity:Trading:ETH-BTC:ETH

Do someone, or the author itself can explain the reason why accounts names 
were converted from AUD:EUR to AUD-EUR:EUR and AUD-EUR:AUD? Why this 
revision was made? for what usage?

I'm not able to calculate Cost  of a trade. But it seems feasible as 
described in point 5.3 
https://www.mathstat.dal.ca/~selinger/accounting/tutorial.html#4 









-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/9a99c842-3c0c-4253-b247-2a860054e81cn%40googlegroups.com.