Eleven-Trading / TradeNote

TradeNote is an open source trading journal that helps traders store, discover and recollect all their trades so they can become and remain consistent and profitable traders

Home Page:https://tradenote.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add feature to import crypto trades not traded in dollar (example: ETH/BTC)

oanstein opened this issue · comments

commented

Feature Request

Is your feature request related to a problem? Please describe.

Currently, the TradeNote platform only supports importing and analyzing USD-based crypto trading pairs. However, there are many trading pairs that don't involve USD, such as ETH/BTC. This limits the usefulness of TradeNote for users that frequently trade in non-USD pairs.

Describe the solution you'd like

I propose adding a feature that enables users to import and analyze crypto trades in pairs that don't involve USD, such as ETH/BTC. This should include:

  • Support for importing trading data from exchanges in various formats (CSV, JSON, etc.) for non-USD trading pairs.
  • Adapt the existing analysis tools and visualizations to work with non-USD trading pairs (e.g., calculating the profit/loss in the respective quote currency).
  • Provide an option to convert non-USD trading pair values to a user-defined fiat currency for a more comprehensive portfolio overview (based on historical exchange rates).

Describe alternatives you've considered

An alternative would be to have users manually convert their non-USD trades to USD before importing. However, this is time-consuming and error-prone.

Additional context

Supporting a wide range of input trading pairs will attract a broader user base and increase the accessibility of the TradeNote platform for those trading in various crypto-to-crypto and fiat-to-crypto markets.

Thanks for this issue. It is a relatively complex issue to implement. Thus, can you connect via discord so we can discuss this more in details ?

Hi @oanstein. Would love to implement this but I need your help for it. If you're still interested in this feature please connect via the TradeNote discord

commented

Hi @7aklhz,

Thanks for getting back to me and considering the feature I requested. I know it's a bit complicated, so please let me know if there are any unclear details or if you need more info. I don't use Discord very often and prefer to keep our conversation here on GitHub, if that's cool with you.

Looking forward to helping you out with any needed details!

Best, oanstein

By experience I know it's easier by Discord, because if all the back and fourths, but we can try.

I do not trade crypto so i need to understand the mechanics (time zone, pairs, commissions...). So here are my preliminary questions

  • what platform do you use ?
  • are your already able to import ? How ?
  • could you please send me an export file of the trades you want to import ? Please anonymize the file (I usually ask to send it by DM on Discord). There I will be able to start understanding what changes need to be made and I'll have additional questions from there.

Again, it's quite complex to implement and it requires a lot of back and forth and testing. Maybe you could just use Discord until we get this working?

commented

What platform do you use?

I use Kraken.com as my preferred cryptocurrency exchange. However, other popular options include Binance and Coinbase.

Are your already able to import? How?

No, currently I don't import crypto trades.

Could you please send me an export file of the trades you want to import ?

Here a anonymized table showing trades exported from kraken:

txid ordertxid pair time type ordertype price cost fee vol margin misc ledgers
TGYTGX-YYYYY-XXXXX OBK3T5-YYYYY-XXXXX DOTXBT 2023-04-18 09:38:54.126 sell stop market 0.0002309515 0.0913733069 0.0001827467 395.64024370 0.0304677690 initiated,closing L43CGC-YYYYY-XXXXX
TQN5BR-YYYYY-XXXXX OBK3T5-YYYYY-XXXXX DOTXBT 2023-04-18 09:38:54.1262 sell stop market 0.0002308300 0.0078734652 0.0000157469 34.10936706 0.0026244884 initiated,closing LPETBL-YYYYY-XXXXX
TKEE4D-YYYYY-XXXXX OBK3T5-YYYYY-XXXXX DOTXBT 2023-04-18 09:38:54.1262 sell stop market 0.0002308173 0.0117761102 0.0000235522 51.01919058 0.0039254801 initiated,closing LPB7WS-YYYYY-XXXXX
TQO2PP-YYYYY-XXXXX OBK3T5-YYYYY-XXXXX DOTXBT 2023-04-18 09:38:54.1264 sell stop market 0.0002308438 0.0840477480 0.0001680955 364.24130866 0.0280259260 initiated,closing LUNPCP-YYYYY-XXXXX

Here's the markdown table as a CSV format:

txid,ordertxid,pair,time,type,ordertype,price,cost,fee,vol,margin,misc,ledgers
TGYTGX-YYYYY-XXXXX,OBK3T5-YYYYY-XXXXX,DOTXBT,2023-04-18 09:38:54.126,sell,stop market,0.0002309515,0.0913733069,0.0001827467,395.64024370,0.0304677690,"initiated,closing", L43CGC-YYYYY-XXXXX
TQN5BR-YYYYY-XXXXX,OBK3T5-YYYYY-XXXXX,DOTXBT,2023-04-18 09:38:54.1262,sell,stop market,0.0002308300,0.0078734652,0.0000157469,34.10936706,0.0026244884,"initiated,closing",LPETBL-YYYYY-XXXXX
TKEE4D-YYYYY-XXXXX,OBK3T5-YYYYY-XXXXX,DOTXBT,2023-04-18 09:38:54.1262,sell,stop market,0.0002308173,0.0117761102,0.0000235522,51.01919058,0.0039254801,"initiated,closing",LPB7WS-YYYYY-XXXXX
TQO2PP-YYYYY-XXXXX,OBK3T5-YYYYY-XXXXX,DOTXBT,2023-04-18 09:38:54.1264,sell,stop market,0.0002308438,0.0840477480,0.0001680955,364.24130866,0.0280259260,"initiated,closing",LUNPCP-YYYYY-XXXXX

How to interpret Trades history fields:

Source: https://support.kraken.com/hc/en-us/articles/360001184886-How-to-interpret-Trades-history-fields

Field Currency unit Description
txid n/a Transaction ID; used for each partial execution of an Order (one Order may have multiple executions).
ordertxid n/a Order ID. For an order executed in multiple parts, the Order ID will be the same for each execution. Only the Transaction ID will be different/unique.
pair n/a Base currency + Quote currency.
time n/a Includes both date + time (in UTC time zone). But in some spreadsheet applications, only the time might show up by default.
type n/a "buy" or "sell"
order-type n/a "limit", "market", "touched market" (take profit), "stop market" (stop loss), "liquidation market"
price quote currency If type is "buy", then "price" is the amount of quote currency needed to buy 1 unit of base currency. If type is "sell", then "price" is the amount of quote currency received for selling 1 unit of base currency.
cost quote currency cost = price x volume. If type is "buy", then cost is the amount of quote currency deducted for the base currency purchased. If type is "sell", then cost is the amount of quote currency received for the base currency sold. Cost does NOT include fees and is NOT the amount paid to Kraken (a common misunderstanding).
fee quote currency Amount of quote currency paid to Kraken as commission for the trade. Note: this is not necessarily the fee that was deducted from your account! If you've set your fees to be deducted in the base currency, the Trades history will still show the fee value in the quote currency. To see exactly what fees were deducted and in which currency, you need to refer to the Ledger history. The fee % is the fee ÷ cost × 100%.
vol base currency Amount of the base currency bought/sold.
margin quote currency Amount of used margin (in quote currency). If 5X leverage was used, then: margin ÷ cost = 20%. If 4X leverage was used, then: margin ÷ cost = 25%. If 3X leverage was used, then: margin ÷ cost = 33.33%. If 2X leverage was used, then: margin ÷ cost = 50%. "0" = non-margin trade.
misc n/a "closing" = if it's a trade that closes a spot position on margin. blank = if it's a trade that opens a spot position on margin, or if it's a non-margin trade.
ledgers n/a Corresponding ledger entry IDs (one for the base currency, and one for the quote currency).

How to interpret asset codes

https://support.kraken.com/hc/en-us/articles/360001185506-How-to-interpret-asset-codes

@oanstein : I'm sorry but it will really be too complicated to do it over a ticket. I would love to take the time and evaluate if I can integrate crypto support but this issue raises a lot of questions which I prefer doing over a more synchrone chat session, using Discord. I understand if your not comfortable with Discord. If that's the case let's just wait for another member that can help me out with this and I will reach back to you when it's implemented.