This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| token = 'XXX' | |
| # Get a token from https://api.tiingo.com/ | |
| ticker = "TSLA" | |
| url = "https://api.tiingo.com/tiingo/daily/{}/prices?token={}".format(ticker, token) | |
| response = requests.get(url) | |
| print(response.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| key = 'XXXX' | |
| # Get a key from https://intrinio.com/ | |
| ticker = 'MSFT' | |
| url = 'https://api-v2.intrinio.com/companies/{}?api_key={}'.format(ticker, key) | |
| response = requests.get(url) | |
| print(response.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| token = 'XXXXX' | |
| # Get an Xignite token from https://www.xignite.com/Register | |
| url = "http://globalcurrencies.xignite.com/xGlobalCurrencies.json/ListCurrencies?_token={}".format(token) | |
| response = requests.get(url) | |
| print(response.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| token = 'XXXX' | |
| # Get a key from https://iexcloud.io/cloud-login#/register/ | |
| ticker = 'TSLA' | |
| url = 'https://cloud.iexapis.com/stable/stock/{}/quote?token={}'.format(ticker, token) | |
| response = requests.get(url) | |
| print(response.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| ticker = 'TSLA' | |
| # Only US tickers in the developer account | |
| token = 'XXXXX' | |
| # Get a sandbox/developer token here: https://developer.tradier.com/ | |
| headers = {'Authorization': 'Bearer {}'.format(token), | |
| 'Accept': 'application/json'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| url = "http://ftp.nasdaqtrader.com/dynamic/SymDir/nasdaqlisted.txt" | |
| response = requests.get(url) | |
| tickers = [line.split("|")[0] for line in response.text.split("\n")][1:-2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from alpha_vantage.timeseries import TimeSeries | |
| from concurrent.futures import ThreadPoolExecutor | |
| import os | |
| KEY = os.path.expandvars("$ALPHAVANTAGE_API_KEY") | |
| ts = TimeSeries(key=KEY, output_format='pandas') | |
| def get_daily_adjusted_ignore_failure(ticker): | |
| try: | |
| return ts.get_daily_adjusted(symbol=ticker,outputsize='full') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TRADING_DAYS_IN_2019 = 252 | |
| TODAY_NUMERIC_VALUE = 0 | |
| from datetime import datetime | |
| end = datetime.strptime('2019-02-07', '%Y-%m-%d') | |
| shape = 40000 | |
| train_valid_tickers = 2392 | |
| test_valid_tickers = 800 | |
| def transform_data(test_or_train_set, valid_tickers): | |
| y_set = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.6.0; | |
| import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol"; | |
| contract GetData is ChainlinkClient { | |
| uint256 public currentPrice; | |
| address public owner; | |
| // The address of an oracle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.6; | |
| import "https://raw.githubusercontent.com/smartcontractkit/chainlink/7a4e19a8ff07db1be0b397465d38d175bc0bb5b5/evm-contracts/src/v0.6/VRFConsumerBase.sol"; | |
| contract VRFTestnetD20 is VRFConsumerBase { | |
| uint256[] public d20Results; | |
| bytes32 internal keyHash; | |
| uint256 internal fee; |