pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
1.9k stars 284 forks source link

Crypto: no data loading #158

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hey guys,

there are any updates for crypto tickers? Using the following code your library does not working..

import ffn
#%pylab inline

dataset_ffn = ffn.get('XRP:Open, XRP:High, XRP:Low, XRP:Close', start='2020-01-01', end='2021-12-31')
dataset_ffn.columns = ["open","high","low","close"]
dataset_ffn = dataset_ffn.apply(lambda x: round(x,2))

ffn_issue

thanks cya!

ghost commented 2 years ago

Also, if I write other codes using a cryptocurrency instead i.e AAPL ticker, this does not working

this works `import ffn

dataset = ffn.get('aapl:Open,aapl:High,aapl:Low,aapl:Close', start='2007-01-01', end='2019-09-22') dataset.columns = ["open","high","low","close"] dataset = dataset.apply(lambda x: round(x,2)) dataset["avgprice"] = dataset.mean(axis=1) dataset["medprice"] = dataset.open + (dataset.high - dataset.low) / 2 dataset["medbodyprice"] = dataset.open + abs(dataset.open - dataset.close) / 2 dataset["body"] = dataset.close - dataset.open dataset["range"] = dataset.high - dataset.low dataset.head(10)`

if i change the ticker (i.e aapl : xrp) it stops working

timkpaine commented 2 years ago

Currencies don't really have intrinsic prices, they have relative prices, so you'll want to specify a pair e.g. https://finance.yahoo.com/quote/XRP-USD?p=XRP-USD&.tsrc=fin-srch

ghost commented 2 years ago

great! thanks