Trade Warehouse (SPOT trades)

Hello there!

Let's imagine You are trading SPOT, buy more and more every new dump, but bear market is not going to stop... and your first trade was 3 YEARS AGO!!!

Can't believe it is true.

The problem is - exchanges allow You to see only new trades last 6 months(Binance). But I want to see all of them! How do I know AVG Price?

This script is my solution. Just use it to track and store your trade, so You can see AVG without uploading old trades everytime and using calculator.

Script description:

Here You can see the "Trade" type of variable. Python script using Pandas converts trades from .csv file into string type that You can input as trade(price, pair, amount, date..). After it uppends to the trades_array and pushed into the loop.
If trade date is more than current cundle - it pushes new trade to other arrays such a "pair", "avg_tot" etc. to comput it later.

If trade was buy - it increase invested capital and owned amount, opposite for sell and recomputs AVG price.

Since script has at least 1 trade it starts to plot AVG price.

There are 2 AVG price:
1. For total invested counting(You can get negative value if traded successful)
2. Current AVG price since last 0 currency amount(there is dust value to set how many usd we take as dust)

Table represents all assets statistics

Just upload your trades only 1 time, use script to convert it into pine code, and use as indicator. This script allow You to see ALL trades from oldest to the newest.

If this script helped You - press Star (on GitHub) Like (on TradingView)

Warning -

Does not include free/earn/withdraw/deposit counting. Only Buy and Sell =>
This script has no idea about your side currency deposits, so if You got Your BTC or EUR or .. from another wallet and sold later - it can break your statistical data. Add this transfer manually(see examples inside script).

Use my github manual to get this script workin.

Installing takes around 3 minutes and contains 3-5 steps
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?