<p>This spreadsheet does the calculations for you, you just need to input your buys and sells: <a href="https://github.com/alanhett/coin-cost-basis" rel="nofollow noreferrer">https://github.com/alanhett/coin-cost-basis</a></p>

CC BY-SA 3.0
2017-11-16T12:08:40.583Z
2017-11-16T12:08:40.583Z
Glenn
<p>No need for fancy scripts and databases:</p>

<p><strong>[what you put in] - [what you got out] = [your profit]</strong></p>

<p>All you need to know:</p>

<ul>
<li>the price of BTC at the beginning of the period</li>
<li>the price of BTC at the end of the period</li>
<li>have a list of all USD deposits/withdrawals</li>
<li>have a list of all BTC deposits/withdrawals (and the value of BTC in USD at that moment the deposit or withdrawal was made)</li>
</ul>

<p>I will try to explain with an example:</p>

<ol>
<li>Starting balance = $0 + 1 BTC </li>
<li>Deposit $1,000 (balance = $1,000 + 1 BTC)</li>
<li>Buy 1 BTC @ $900/BTC 1% fee = 0.01 BTC (balance = $100 + 1.99 BTC)</li>
<li>Sell 0.5 BTC @ $920/BTC 1% fee = $46 (balance = $555.40 + 1.49 BTC)</li>
<li>Withdraw $500 (balance = $55.40 + 1.49 BTC)</li>
</ol>

<p>For a certain period in time the profit</p>

<pre><code>= ([value of all assets at end of period] – [value of all assets at beginning of period]) + ([value of assets withdrawn] – [value of assets deposited])
= (($55.40 + 1.49BTC) - ($0 + 1BTC)) + (($500 + 0BTC) - ($1,000 + 0BTC))
= (($55.40 + 1.49BTC x $920) - ($0 + 1BTC x $900)) + (($500 + $0 x $920) - ($1,000 + $0 x $900)) // convert BTC to USD for the price at that time
= (($55.40 + $1,370.80) - ($0 + $900)) + (($500 + $0) - ($1,000 + $0))
= ($1,426.20 - $900) - $500 // My assets is worth $1426.20 at the end of the period, it was worth $900 at the beginning of the period but I added $500 from external sources (deposit - withdraw)
= $26.20 // Total value of my assets increased by $26.20
</code></pre>

<p>Even if I made zero trades for the month and the BTC price increased while I had BTC "stock", I would have made "profit" from a USD perspective as my total assets' value increased in USD terms.</p>

CC BY-SA 3.0
2016-09-14T10:52:23.097Z
2016-09-14T10:52:23.097Z
Jasper Citi
<p>If you're concerned with privacy, checkout my app <a href="http://coinfox.co?stack" rel="nofollow noreferrer">Coinfox, cryptocoin portfolio tracker</a>. It stores all your data client side in localStorage, and is fully open source</p>

CC BY-SA 3.0
2017-07-24T19:58:24.417Z
2017-09-07T22:46:37.630Z
2017-09-07T22:46:37.630Z
Vinnie James
<p>You could use a script that gets executed every day that connects to your exchange using their API and requests your balances.</p>

<p>If you were calculating your profit and loss using USD as your base currency you could take the current market price for BTC/USD and multiply that by the total number of BTC you have on balance, then add that to your USD balance to get your total USD balance. Then store your total USD balance for that day in a database.</p>

<p>Now your database should have records of your daily USD balance, from which you can calculate your daily P&amp;L. You could obviously use another script to generate a PDF or webpage showing your P&amp;L graphically.</p>

<p>If you're looking to track per trade P&amp;L, that's just a matter of utilizing the API to get a list of your trades and then calculate the P&amp;Ls individually based on first in first out accounting.</p>

<p>I hope I was able to give you some ideas.</p>

CC BY-SA 3.0
2016-07-16T16:52:50.420Z
2016-07-16T16:52:50.420Z
Brandon
<p>I made a site to use the Coinbase API to keep track of your net gains/losses. Check it out at <a href="https://www.profbit.info/" rel="nofollow noreferrer">profbit.info</a></p>

CC BY-SA 3.0
2017-11-27T19:28:40.640Z
2017-11-27T19:28:40.640Z
joshblum
<p>Does anyone have recommendations when it comes to monitoring BTC trading profit and loss? I find it confusing when taking into account the transaction fee the exchanges impose (ie- GDAX). I use Coinigy for charts and entering orders.</p>

<trading>
Ways to monitoring BTC trading profit and loss?
Justin Levy
# Ways to monitoring BTC trading profit and loss?

(Asked by: username_0 on 2016-07-14)

Does anyone have recommendations when it comes to monitoring BTC trading profit and loss? I find it confusing when taking into account the transaction fee the exchanges impose (ie- GDAX). I use Coinigy for charts and entering orders.

**Tags:** trading


---

## 5 answers

### Answer by username_1 on 2017-11-16. Score: 2

This spreadsheet does the calculations for you, you just need to input your buys and sells: <https://github.com/alanhett/coin-cost-basis>


---

### Answer by username_2 on 2016-09-14. Score: 2

No need for fancy scripts and databases:
[what you put in] - [what you got out] = [your profit]
All you need to know:

the price of BTC at the beginning of the period
the price of BTC at the end of the period
have a list of all USD deposits/withdrawals
have a list of all BTC deposits/withdrawals (and the value of BTC in USD at that moment the deposit or withdrawal was made)

I will try to explain with an example:

Starting balance = $0 + 1 BTC 
Deposit $1,000 (balance = $1,000 + 1 BTC)
Buy 1 BTC @ $900/BTC 1% fee = 0.01 BTC (balance = $100 + 1.99 BTC)
Sell 0.5 BTC @ $920/BTC 1% fee = $46 (balance = $555.40 + 1.49 BTC)
Withdraw $500 (balance = $55.40 + 1.49 BTC)

For a certain period in time the profit
= ([value of all assets at end of period] – [value of all assets at beginning of period]) + ([value of assets withdrawn] – [value of assets deposited])
= (($55.40 + 1.49BTC) - ($0 + 1BTC)) + (($500 + 0BTC) - ($1,000 + 0BTC))
= (($55.40 + 1.49BTC x $920) - ($0 + 1BTC x $900)) + (($500 + $0 x $920) - ($1,000 + $0 x $900)) // convert BTC to USD for the price at that time
= (($55.40 + $1,370.80) - ($0 + $900)) + (($500 + $0) - ($1,000 + $0))
= ($1,426.20 - $900) - $500 // My assets is worth $1426.20 at the end of the period, it was worth $900 at the beginning of the period but I added $500 from external sources (deposit - withdraw)
= $26.20 // Total value of my assets increased by $26.20

Even if I made zero trades for the month and the BTC price increased while I had BTC "stock", I would have made "profit" from a USD perspective as my total assets' value increased in USD terms.


---

### Answer by username_3 on 2017-07-24. Score: 1

If you're concerned with privacy, checkout my app [Coinfox, cryptocoin portfolio tracker](http://coinfox.co?stack). It stores all your data client side in localStorage, and is fully open source


---

### Answer by username_4 on 2016-07-16. Score: 0

You could use a script that gets executed every day that connects to your exchange using their API and requests your balances.

If you were calculating your profit and loss using USD as your base currency you could take the current market price for BTC/USD and multiply that by the total number of BTC you have on balance, then add that to your USD balance to get your total USD balance. Then store your total USD balance for that day in a database.

Now your database should have records of your daily USD balance, from which you can calculate your daily P&L. You could obviously use another script to generate a PDF or webpage showing your P&L graphically.

If you're looking to track per trade P&L, that's just a matter of utilizing the API to get a list of your trades and then calculate the P&Ls individually based on first in first out accounting.

I hope I was able to give you some ideas.


---

### Answer by username_5 on 2017-11-27. Score: 0

I made a site to use the Coinbase API to keep track of your net gains/losses. Check it out at [profbit.info](https://www.profbit.info/)


---

