diff --git a/JupyterNotebooks/Alphavantage.ipynb b/JupyterNotebooks/Alphavantage.ipynb
index 7abd8aa..af3d799 100644
--- a/JupyterNotebooks/Alphavantage.ipynb
+++ b/JupyterNotebooks/Alphavantage.ipynb
@@ -73,6 +73,13 @@
"key = \"AAUUBAYEDCI353AC\""
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Historic Stock Price and Volume"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 27,
@@ -244,7 +251,18 @@
}
],
"source": [
- "data"
+ "data = {\n",
+ " \"function\": \"DIGITAL_CURRENCY_DAILY\", # WEEKLY, MONTHLY possible\n",
+ " \"symbol\": \"ETH\",\n",
+ " \"market\": 'CNY',\n",
+ " \"apikey\": key\n",
+ " }\n",
+ "r = requests.get(url, params=data)\n",
+ "data = r.json()\n",
+ "crypto_df = pd.DataFrame(data['Time Series (Digital Currency Daily)']).T.reset_index()\n",
+ "crypto_df = crypto_df.rename(columns={\"index\": \"Date\"})\n",
+ "crypto_df['Date'] = pd.to_datetime(crypto_df['Date'])\n",
+ "crypto_df "
]
},
{
@@ -367,7 +385,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "### Live Updates"
+ "### Realtime Data"
]
},
{
@@ -1236,6 +1254,24 @@
"data = r.json()\n"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data = {\n",
+ " \"function\": \"CURRENCY_EXCHANGE_RATE\", # WEEKLY, MONTHLY possible\n",
+ " \"from_currency\": \"ETH\",\n",
+ " \"to_currency\": 'USD',\n",
+ " \"apikey\": key\n",
+ " }\n",
+ "r = requests.get(url, params=data)\n",
+ "data = r.json()\n",
+ "crypto_df = pd.DataFrame(data['Realtime Currency Exchange Rate'], index=[0]).T\n",
+ "crypto_df"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -2314,377 +2350,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "### Historic Data"
+ "### Treasury Yield"
]
},
{
"cell_type": "code",
- "execution_count": 60,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " Date | \n",
- " 1a. open (CNY) | \n",
- " 1b. open (USD) | \n",
- " 2a. high (CNY) | \n",
- " 2b. high (USD) | \n",
- " 3a. low (CNY) | \n",
- " 3b. low (USD) | \n",
- " 4a. close (CNY) | \n",
- " 4b. close (USD) | \n",
- " 5. volume | \n",
- " 6. market cap (USD) | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " 0 | \n",
- " 2021-12-27 | \n",
- " 25883.31547200 | \n",
- " 4063.57000000 | \n",
- " 25990.96171200 | \n",
- " 4080.47000000 | \n",
- " 25780.12795200 | \n",
- " 4047.37000000 | \n",
- " 25954.40020800 | \n",
- " 4074.73000000 | \n",
- " 14823.90760000 | \n",
- " 14823.90760000 | \n",
- "
\n",
- " \n",
- " 1 | \n",
- " 2021-12-26 | \n",
- " 26079.43545600 | \n",
- " 4094.36000000 | \n",
- " 26147.20800000 | \n",
- " 4105.00000000 | \n",
- " 25478.40000000 | \n",
- " 4000.00000000 | \n",
- " 25883.25177600 | \n",
- " 4063.56000000 | \n",
- " 189309.25500000 | \n",
- " 189309.25500000 | \n",
- "
\n",
- " \n",
- " 2 | \n",
- " 2021-12-25 | \n",
- " 25773.63096000 | \n",
- " 4046.35000000 | \n",
- " 26356.83153600 | \n",
- " 4137.91000000 | \n",
- " 25597.00195200 | \n",
- " 4018.62000000 | \n",
- " 26082.42916800 | \n",
- " 4094.83000000 | \n",
- " 208126.88050000 | \n",
- " 208126.88050000 | \n",
- "
\n",
- " \n",
- " 3 | \n",
- " 2021-12-24 | \n",
- " 26188.03713600 | \n",
- " 4111.41000000 | \n",
- " 26337.27686400 | \n",
- " 4134.84000000 | \n",
- " 25587.76603200 | \n",
- " 4017.17000000 | \n",
- " 25773.69465600 | \n",
- " 4046.36000000 | \n",
- " 230833.16610000 | \n",
- " 230833.16610000 | \n",
- "
\n",
- " \n",
- " 4 | \n",
- " 2021-12-23 | \n",
- " 25347.88689600 | \n",
- " 3979.51000000 | \n",
- " 26433.84000000 | \n",
- " 4150.00000000 | \n",
- " 24798.31780800 | \n",
- " 3893.23000000 | \n",
- " 26188.03713600 | \n",
- " 4111.41000000 | \n",
- " 380207.81660000 | \n",
- " 380207.81660000 | \n",
- "
\n",
- " \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- " ... | \n",
- "
\n",
- " \n",
- " 995 | \n",
- " 2019-04-07 | \n",
- " 1054.55097600 | \n",
- " 165.56000000 | \n",
- " 1117.41892800 | \n",
- " 175.43000000 | \n",
- " 1044.99657600 | \n",
- " 164.06000000 | \n",
- " 1109.64801600 | \n",
- " 174.21000000 | \n",
- " 465507.52497000 | \n",
- " 465507.52497000 | \n",
- "
\n",
- " \n",
- " 996 | \n",
- " 2019-04-06 | \n",
- " 1049.96486400 | \n",
- " 164.84000000 | \n",
- " 1100.47579200 | \n",
- " 172.77000000 | \n",
- " 1014.04032000 | \n",
- " 159.20000000 | \n",
- " 1054.16880000 | \n",
- " 165.50000000 | \n",
- " 528168.33297000 | \n",
- " 528168.33297000 | \n",
- "
\n",
- " \n",
- " 997 | \n",
- " 2019-04-05 | \n",
- " 1002.12916800 | \n",
- " 157.33000000 | \n",
- " 1069.00996800 | \n",
- " 167.83000000 | \n",
- " 993.27542400 | \n",
- " 155.94000000 | \n",
- " 1049.51899200 | \n",
- " 164.77000000 | \n",
- " 516070.34553000 | \n",
- " 516070.34553000 | \n",
- "
\n",
- " \n",
- " 998 | \n",
- " 2019-04-04 | \n",
- " 1018.88121600 | \n",
- " 159.96000000 | \n",
- " 1044.61440000 | \n",
- " 164.00000000 | \n",
- " 973.27488000 | \n",
- " 152.80000000 | \n",
- " 1002.32025600 | \n",
- " 157.36000000 | \n",
- " 686080.95248000 | \n",
- " 686080.95248000 | \n",
- "
\n",
- " \n",
- " 999 | \n",
- " 2019-04-03 | \n",
- " 1039.90089600 | \n",
- " 163.26000000 | \n",
- " 1132.57857600 | \n",
- " 177.81000000 | \n",
- " 950.53540800 | \n",
- " 149.23000000 | \n",
- " 1018.88121600 | \n",
- " 159.96000000 | \n",
- " 1345344.53845000 | \n",
- " 1345344.53845000 | \n",
- "
\n",
- " \n",
- "
\n",
- "
1000 rows × 11 columns
\n",
- "
"
- ],
- "text/plain": [
- " Date 1a. open (CNY) 1b. open (USD) 2a. high (CNY) 2b. high (USD) \\\n",
- "0 2021-12-27 25883.31547200 4063.57000000 25990.96171200 4080.47000000 \n",
- "1 2021-12-26 26079.43545600 4094.36000000 26147.20800000 4105.00000000 \n",
- "2 2021-12-25 25773.63096000 4046.35000000 26356.83153600 4137.91000000 \n",
- "3 2021-12-24 26188.03713600 4111.41000000 26337.27686400 4134.84000000 \n",
- "4 2021-12-23 25347.88689600 3979.51000000 26433.84000000 4150.00000000 \n",
- ".. ... ... ... ... ... \n",
- "995 2019-04-07 1054.55097600 165.56000000 1117.41892800 175.43000000 \n",
- "996 2019-04-06 1049.96486400 164.84000000 1100.47579200 172.77000000 \n",
- "997 2019-04-05 1002.12916800 157.33000000 1069.00996800 167.83000000 \n",
- "998 2019-04-04 1018.88121600 159.96000000 1044.61440000 164.00000000 \n",
- "999 2019-04-03 1039.90089600 163.26000000 1132.57857600 177.81000000 \n",
- "\n",
- " 3a. low (CNY) 3b. low (USD) 4a. close (CNY) 4b. close (USD) \\\n",
- "0 25780.12795200 4047.37000000 25954.40020800 4074.73000000 \n",
- "1 25478.40000000 4000.00000000 25883.25177600 4063.56000000 \n",
- "2 25597.00195200 4018.62000000 26082.42916800 4094.83000000 \n",
- "3 25587.76603200 4017.17000000 25773.69465600 4046.36000000 \n",
- "4 24798.31780800 3893.23000000 26188.03713600 4111.41000000 \n",
- ".. ... ... ... ... \n",
- "995 1044.99657600 164.06000000 1109.64801600 174.21000000 \n",
- "996 1014.04032000 159.20000000 1054.16880000 165.50000000 \n",
- "997 993.27542400 155.94000000 1049.51899200 164.77000000 \n",
- "998 973.27488000 152.80000000 1002.32025600 157.36000000 \n",
- "999 950.53540800 149.23000000 1018.88121600 159.96000000 \n",
- "\n",
- " 5. volume 6. market cap (USD) \n",
- "0 14823.90760000 14823.90760000 \n",
- "1 189309.25500000 189309.25500000 \n",
- "2 208126.88050000 208126.88050000 \n",
- "3 230833.16610000 230833.16610000 \n",
- "4 380207.81660000 380207.81660000 \n",
- ".. ... ... \n",
- "995 465507.52497000 465507.52497000 \n",
- "996 528168.33297000 528168.33297000 \n",
- "997 516070.34553000 516070.34553000 \n",
- "998 686080.95248000 686080.95248000 \n",
- "999 1345344.53845000 1345344.53845000 \n",
- "\n",
- "[1000 rows x 11 columns]"
- ]
- },
- "execution_count": 60,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "data = {\n",
- " \"function\": \"DIGITAL_CURRENCY_DAILY\", # WEEKLY, MONTHLY possible\n",
- " \"symbol\": \"ETH\",\n",
- " \"market\": 'CNY',\n",
- " \"apikey\": key\n",
- " }\n",
- "r = requests.get(url, params=data)\n",
- "data = r.json()\n",
- "crypto_df = pd.DataFrame(data['Time Series (Digital Currency Daily)']).T.reset_index()\n",
- "crypto_df = crypto_df.rename(columns={\"index\": \"Date\"})\n",
- "crypto_df['Date'] = pd.to_datetime(crypto_df['Date'])\n",
- "crypto_df\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Exchange Rates\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 98,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " 0 | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " 1. From_Currency Code | \n",
- " ETH | \n",
- "
\n",
- " \n",
- " 2. From_Currency Name | \n",
- " Ethereum | \n",
- "
\n",
- " \n",
- " 3. To_Currency Code | \n",
- " USD | \n",
- "
\n",
- " \n",
- " 4. To_Currency Name | \n",
- " United States Dollar | \n",
- "
\n",
- " \n",
- " 5. Exchange Rate | \n",
- " 4095.02000000 | \n",
- "
\n",
- " \n",
- " 6. Last Refreshed | \n",
- " 2021-12-27 18:57:01 | \n",
- "
\n",
- " \n",
- " 7. Time Zone | \n",
- " UTC | \n",
- "
\n",
- " \n",
- " 8. Bid Price | \n",
- " 4095.29000000 | \n",
- "
\n",
- " \n",
- " 9. Ask Price | \n",
- " 4095.30000000 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " 0\n",
- "1. From_Currency Code ETH\n",
- "2. From_Currency Name Ethereum\n",
- "3. To_Currency Code USD\n",
- "4. To_Currency Name United States Dollar\n",
- "5. Exchange Rate 4095.02000000\n",
- "6. Last Refreshed 2021-12-27 18:57:01\n",
- "7. Time Zone UTC\n",
- "8. Bid Price 4095.29000000\n",
- "9. Ask Price 4095.30000000"
- ]
- },
- "execution_count": 98,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "data = {\n",
- " \"function\": \"CURRENCY_EXCHANGE_RATE\", # WEEKLY, MONTHLY possible\n",
- " \"from_currency\": \"ETH\",\n",
- " \"to_currency\": 'USD',\n",
+ "treasury_yield = {\n",
+ " \"function\": \"TREASURY_YIELD\",\n",
+ " \"interval\": \"weekly\", # daily, monthly\n",
+ " \"maturity\": \"3month\", # OPTIONAL 5year, 10year, 30year\n",
" \"apikey\": key\n",
- " }\n",
- "r = requests.get(url, params=data)\n",
- "data = r.json()\n",
- "crypto_df = pd.DataFrame(data['Realtime Currency Exchange Rate'], index=[0]).T\n",
- "crypto_df"
+ "}"
]
},
{
@@ -2806,12 +2486,7 @@
" \"interval\": \"annual\", # quarterly\n",
" \"apikey\": key\n",
"}\n",
- "treasury_yield = {\n",
- " \"function\": \"TREASURY_YIELD\",\n",
- " \"interval\": \"weekly\", # daily, monthly\n",
- " \"maturity\": \"3month\", # OPTIONAL 5year, 10year, 30year\n",
- " \"apikey\": key\n",
- "}\n",
+ "\n",
"federal_funds_rate = {\n",
" \"function\": \"FEDERAL_FUNDS_RATE\",\n",
" \"interval\": \"weekly\", # daily, monthly\n",
@@ -2842,6 +2517,25 @@
"crypto_df"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Financials"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "document = 'INCOME_STATEMENT' # BALANCE_SHEET, CASH_FLOW\n",
+ "url = 'https://www.alphavantage.co/query?function='+document+'&symbol=IBM&apikey=demo'\n",
+ "r = requests.get(url)\n",
+ "data = r.json()"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
diff --git a/Source/Alphavantage.rst b/Source/Alphavantage.rst
index 145daa9..c8eba71 100644
--- a/Source/Alphavantage.rst
+++ b/Source/Alphavantage.rst
@@ -21,17 +21,17 @@ Fetching the data
- `5. Many Stocks <#5>`_
- `6. Finanical Indices <#6>`_
- `7. Currencies <#7>`_
-- `8. Crypto <#8>`_
-- `9. Mutual Funds <#9>`_
-- `10. Treasury <#10>`_
-- `11. Stock Fundamentals <#11>`_
-- `12. Financials <#12>`_
-- `13. Put Call Options <#13>`_
-- `14. Stream Real Time Data <#14>`_
-- `15. Economic Indicators <#15>`_
-- `16. Technical Indicators <#16>`_
-
-.. code:: ipython3
+- `8. Crypto <#8>`_
+- `9. Mutual Funds <#9>`_
+- `10. Treasury <#10>`_
+- `11. Stock Fundamentals <#11>`_
+- `12. Financials <#12>`_
+- `13. Put Call Options <#13>`_
+- `14. Stream Real Time Data <#14>`_
+- `15. Economic Indicators <#15>`_
+- `16. Technical Indicators <#16>`_
+
+.. code-block:: ipython3
from alpha_vantage.timeseries import TimeSeries
import pandas as pd
@@ -42,6 +42,10 @@ Fetching the data
Historical Price and Volume for 1 Stock
---------------------------------------
+Link to the `historic price and volume of one stock`_ JupyterNB cell.
+
+.. _historic price and volume of one stock: Source/Alphavantage.ipynb#Historic-Stock-Price-and-Volume
+
.. code:: ipython3
data = {
@@ -77,6 +81,9 @@ Adding Time Periods
Frequency Setting
-----------------
+Link to the `intraday data`_ JupyterNB cell.
+
+.. _intraday data: Source/Alphavantage.ipynb#Intraday-Data
.. code:: ipython3
@@ -96,6 +103,9 @@ Frequency Setting
Stock Split and dividends
-------------------------
+Link to the `dividends`_ JupyterNB cell.
+
+.. _dividends: Source/Alphavantage.ipynb#Dividends
.. code:: ipython3
@@ -108,6 +118,9 @@ Stock Split and dividends
Financial Indices
-----------------
+Link to the `financial indices`_ JupyterNB cell.
+
+.. _Financial Indices: Source/Alphavantage.ipynb#Indices
.. code:: ipython3
@@ -120,6 +133,9 @@ Financial Indices
Currencies
---------------
+Link to the `currency exchange`_ JupyterNB cell.
+
+.. _Currency Exchange: Source/Alphavantage.ipynb#Currency-Exchange
.. code:: ipython3
@@ -131,8 +147,11 @@ Currencies
r = requests.get(url)
data = r.json()
-Crypto
----------------
+Cryptocurrencies
+----------------
+Link to the `cryptocurrencies`_ JupyterNB cell.
+
+.. _Cryptocurrencies: Source/Alphavantage.ipynb#Cryptocurrencies
.. code:: ipython3
@@ -146,6 +165,9 @@ Crypto
Mutual Funds
---------------
+Link to the `mutual funds`_ JupyterNB cell.
+
+.. _Mutual Funds: Source/Alphavantage.ipynb#Mutual-Funds
.. code:: ipython3
@@ -159,6 +181,9 @@ Mutual Funds
Treasury Rates
---------------
+Link to the `treasury yield`_ JupyterNB cell.
+
+.. _Treasury Yield: Source/Alphavantage.ipynb#Treasury-Yield
.. code:: ipython3
@@ -171,6 +196,9 @@ Treasury Rates
Stock Fundamentals
------------------
+Link to the `intraday data`_ JupyterNB cell.
+
+.. _intraday data: Source/Alphavantage.ipynb#Intraday-Data
.. code:: ipython3
@@ -181,6 +209,9 @@ Stock Fundamentals
Import Financials
-----------------
+Link to the `financials`_ JupyterNB cell.
+
+.. _Financials: Source/Alphavantage.ipynb#Financials
.. code:: ipython3
@@ -191,6 +222,9 @@ Import Financials
Stream Realtime Data
--------------------
+Link to the `realtime data`_ JupyterNB cell.
+
+.. _Realtime Data: Source/Alphavantage.ipynb#Realtime-Data
.. code:: ipython3
@@ -214,6 +248,9 @@ Stream Realtime Data
Economic Indicators
-------------------
+Link to the `economic indicators`_ JupyterNB cell.
+
+.. _Economic Indicators: Source/Alphavantage.ipynb#Economic-Indicators
.. code:: ipython3
@@ -258,6 +295,9 @@ Economic Indicators
Technical Indicators
--------------------
+Link to the `technical indicators`_ JupyterNB cell.
+
+.. _Technical Indicators: Source/Alphavantage.ipynb#Technical-Indicators
.. code:: ipython3