Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to choose the day price from average, open, close, low, high? #45

Open
aleqx opened this issue Jan 10, 2021 · 0 comments
Open

option to choose the day price from average, open, close, low, high? #45

aleqx opened this issue Jan 10, 2021 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request question Further information is requested

Comments

@aleqx
Copy link

aleqx commented Jan 10, 2021

On recap.io one can choose a default accounting price for transactions that are missing their cost basis or nominal value: day average, day open, day close, day low, day high.

Is there such a setting for bittytax? If not, which one does BT consider when fetching prices online?

As you know, luck or bad luck can add/subtract quite bit from the tax bill given we had plenty of 50%+ swings in a single day. Even though this choice should be made once and then stuck with (HMRC doesn't like us gaming the system), the nature of someone's trading can take advantage of this choice.

It's a useful option to have.

@nanonano offered a first reply in #42 (comment)

@nanonano nanonano self-assigned this Jan 10, 2021
@nanonano nanonano added the question Further information is requested label Jan 10, 2021
@nanonano
Copy link
Member

Thanks for raising this, it's taken a while to confirm with each of the data providers what price point their API is returning.

Data source Data point Available data points API used API Docs
CoinDesk close close? https://api.coindesk.com/v1/bpi/historical/close.json https://www.coindesk.com/coindesk-api, https://www.coindesk.com/API
CryptoCompare close open, high, low, close https://min-api.cryptocompare.com/data/histoday https://min-api.cryptocompare.com/documentation
CoinGecko open open, high, low, close https://api.coingecko.com/api/v3/coins/{coin id}/market_chart https://www.coingecko.com/api/documentations/v3
CoinPaprika open open, high, low, close https://api.coinpaprika.com/v1/tickers/{coin id}/historical https://api.coinpaprika.com

As you can see, not the results I was expecting, two are using the start price, instead of the close.

I did not get a reply from CoinDesk, but from the name of the endpoint, suggests it is the close. Changing the name to open (https://api.coindesk.com/v1/bpi/historical/open.json) made no difference to the data returned.

I believe Recap.io are using the CryptoCompare API. Day average is not available, so presume this is calculated as an average of the open and close prices.

CoinGecko does not provide high or low historic price points, they do have an OHLC endpoint in beta (https://www.coingecko.com/api/documentations/v3#/coins/get_coins__id__ohlc), but this does not allow the retrieval of data for a specific day.

The close price for CoinGecko can be retrieved as follows.

We use the open price of each day taken at 00:00 UTC, which is also the closing price of the previous day.

1 Jan 2021, 00:00 UTC, BTC = $20,000 (open) - this is price for 1 Jan 2021
2 Jan 2021, 00:00 UTC, BTC = $21,000 (close of 1 Jan 2021), (open of 2 Jan 2021) - this is the price for 2 Jan 2021

To fix the inconstancy of open/close prices being used, I think the best solution will be to make it part of the config to choose, so existing users can retain the current price points, and any new installations will default to close for all data sources.

@nanonano nanonano added the enhancement New feature or request label Feb 16, 2021
@nanonano nanonano added the bug Something isn't working label Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants