Skip to content

Commit

Permalink
Removed crypto intraday reference, added daily and exchange rate funt…
Browse files Browse the repository at this point in the history
…ionality
  • Loading branch information
Patrick Collins authored and RomelTorres committed Aug 23, 2019
1 parent 22db8c4 commit 70f91af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -138,10 +138,10 @@ from alpha_vantage.cryptocurrencies import CryptoCurrencies
import matplotlib.pyplot as plt

cc = CryptoCurrencies(key='YOUR_API_KEY', output_format='pandas')
data, meta_data = cc.get_digital_currency_intraday(symbol='BTC', market='CNY')
data['1b. price (USD)'].plot()
data, meta_data = cc.get_digital_currency_daily(symbol='BTC', market='CNY')
data['4b. close (USD)'].plot()
plt.tight_layout()
plt.title('Intraday value for bitcoin (BTC)')
plt.title('Daily close value for bitcoin (BTC)')
plt.grid()
plt.show()
```
Expand Down
17 changes: 17 additions & 0 deletions alpha_vantage/cryptocurrencies.py
Expand Up @@ -57,3 +57,20 @@ def get_digital_currency_monthly(self, symbol, market):
"""
_FUNCTION_KEY = 'DIGITAL_CURRENCY_MONTHLY'
return _FUNCTION_KEY, 'Time Series (Digital Currency Monthly)', 'Meta Data'

@av._output_format
@av._call_api_on_func
def get_digital_currency_exchange_rate(self, symbol, market):
""" Returns the current exchange rate for a digital currency
(e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan),
and when it was last updated.
Keyword Arguments:
symbol: The digital/crypto currency of your choice. It can be any
of the currencies in the digital currency list. For example:
symbol=BTC.
market: The exchange market of your choice. It can be any of the
market in the market list. For example: market=CNY.
"""
_FUNCTION_KEY = 'CURRENCY_EXCHANGE_RATE'
return _FUNCTION_KEY, 'Dictonary (Digital Currency Exchange Rate)', 'Meta Data'
Binary file modified images/docs_cripto_btc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 70f91af

Please sign in to comment.