How to use the quandl.ApiConfig function in Quandl

To help you get started, we’ve selected a few Quandl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vrishank97 / AlgoTrading / algotrading / backtest / eval_ema.py View on Github external
def test(year, stock, window=10, up=0.05, down=0.05, get_plots=True, verbose=True):
	quandl.ApiConfig.api_key = "FDEDsMbK1E2t_PMf7X3M"
	df = quandl.get('NSE/ZEEL', start_date='2017-01-01', end_date='2017-12-31')
	prices = df["Close"]
	dates = df["Date"]

	agent = EMA_Agent(window, up, down)

	test = Backtest(agent, 10000)

	output = test.run(prices)

	# class Evaluation takes for initialization - prices, output, name of algorithm, name of security

	evaluator = Evaluation(prices, dates, output, "EMA", stock)
	return evaluator.complete_evaluation(get_plots, verbose)
github TalaikisInc / blueblood / app / data / quandl / index.py View on Github external
from os import getenv
from quandl import ApiConfig, get
from clint.textui import colored

from app.data import to_pickle
from app.variables import QUANDL_SYMBOLS
ApiConfig.api_key = getenv('QUANDL_KEY')
from app.utils.date_utils import ensure_latest


def run_quandl(check_latest=True):
    for s in QUANDL_SYMBOLS:
        data = get(s[0])
        name = s[0].replace('/', '_')
        if check_latest:
            if s[2]:
                ensure_latest(df=data)
        to_pickle(data, 'futures', name)
        print(colored.green(name))
github CapstoneProject18 / Stock-Market-Analysis / visualization / myapp / views.py View on Github external
def fetch_compare(request):
    if request.method == 'POST':
        company = []
        company1 = ''
        company2 = ''
        company3 = ''
        start_date = '2015-12-31'
        end_date = '2016-12-31'
        stock_return1 = []
        stock_return2 = []
        stock_return3 = []
        # form = NameForm(request.POST)
        
        quandl.ApiConfig.api_key = "23KLyzjn5UvKQog-DZyM"
        company1 = request.POST.get('company_name1')
        company2 = request.POST.get('company_name2')
        company3 = request.POST.get('company_name3')
        if company1 != '':
            company.append(company1)
        if company2 != '':
            company.append(company2)
        if company3 != '':
            company.append(company3)
        
        start_date = request.POST.get('start_date')
        end_date = request.POST.get('end_date')
        
        # print(company1)
        # print(start_date)
        # print(end_date)
github robcarver17 / pysystemtrade / sysdata / quandl / quandl_futures.py View on Github external
"""

from sysdata.futures.contracts import futuresContract
from sysdata.futures.futures_per_contract_prices import futuresContractPriceData, futuresContractPrices
from syscore.fileutils import get_filename_for_package
from sysdata.quandl.quandl_utils import load_private_key

import quandl
import pandas as pd


QUANDL_FUTURES_CONFIG_FILE = get_filename_for_package("sysdata.quandl.QuandlFuturesConfig.csv")


quandl.ApiConfig.api_key = load_private_key()

class quandlFuturesConfiguration(object):

    def __init__(self, config_file = QUANDL_FUTURES_CONFIG_FILE):

        self._config_file = config_file

    def get_list_of_instruments(self):
        config_data = self._get_config_information()

        return list(config_data.index)

    def get_instrument_config(self, instrument_code):

        if instrument_code not in self.get_list_of_instruments():
            raise Exception("Instrument %s missing from config file %s" % (instrument_code, self._config_file))
github ivegner / stocks-net / retired / magic / Stock_NN_Funcs.py View on Github external
import quandl
import pandas as pd
import numpy as np
from scipy.signal import argrelextrema
import sys, os
import dill as pickle
from sklearn import preprocessing as prep
from sklearn.model_selection import train_test_split
from talib import abstract as ta
from sklearn.externals import joblib
import copy

quandl.ApiConfig.api_key = "KDH1TFmmmcrjgynvRdWg"

HI_LO_DIFF = 0.03
MIN_MAX_PERIOD = 8


def build_data(raw=False, random_split=True, start_date=None, end_date=None, test_proportion=0.1):
    # if len(sec) == 1 and os.path.isfile(secs[0]):	#it's a file
    # 	with open(secs[0]) as f:
    # 		secs = ["WIKI/" + line.strip() for line in f]

    # print("SECURITIES: ", s[5:] for s in secs)

    with open("stock_data/invalid_stocks.txt", "r+") as f:
        invalid_stock_codes = [line.strip() for line in f]
    f = open("stock_data/invalid_stocks.txt", "a")
github produvia / kryptos / kryptos / data / manager.py View on Github external
def __init__(self, columns, config=None):
        super(QuandleDataManager, self).__init__("quandl", columns, config)
        """DataManager object used to fetch and integrate Quandl Blockchain database"""

        self.config = config
        _api_key = os.getenv("QUANDL_API_KEY")
        quandl.ApiConfig.api_key = _api_key
        self.data_dir = os.path.join(DATA_DIR, "quandle")
github xeroc / bitshares-pricefeed / bitshares_pricefeed / sources / quandl.py View on Github external
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.period = 60 * 60  # 1h
        self.days = 1
        self.maxAge = getattr(self, "maxAge", 5)

        quandl.ApiConfig.api_key = self.api_key
        quandl.ApiConfig.api_version = '2015-04-09'
github nb5hd / markov_stock_analysis / Old_versions / markov_stock_analysis v2-3.py View on Github external
def get_data(security):
    """
    This function obtains data under certain parameters from Quandl and returns the following information as a Pandas
    DataFrame: date, adjusted closing, and percentage change in adjusted closing from the last week.

    :param security:  Holds information about the requested security
    :return: A Pandas DataFrame with columns: Date, Adjusted Close, and Percentage Change.
    """
    quandl.ApiConfig.api_key = "7NU4-sXfczxA9fsf_C8E"
    name = security.get_name()
    start = security.get_start()
    end = security.get_end()
    period = security.get_period()
    raw_df = quandl.get("YAHOO/" + name, start_date=start, end_date=end, collapse=period)
    adjusted_df = raw_df.ix[:, ['Adjusted Close']]
    adjusted_df["Percentage Change"] = adjusted_df['Adjusted Close'].pct_change() * 100
    return adjusted_df
github ivegner / stocks-net / retired / Stock_NN_Funcs.py View on Github external
import quandl, sys, os
import pandas as pd
import numpy as np
from scipy.signal import argrelextrema
import dill as pickle
from sklearn import preprocessing as prep
from sklearn.model_selection import train_test_split
from talib import abstract as ta
from sklearn.externals import joblib
from collections import OrderedDict
import time

np.random.seed(1337)  # for reproducibility


quandl.ApiConfig.api_key = "KDH1TFmmmcrjgynvRdWg"

HI_LO_DIFF = 0.03
MIN_MAX_PERIOD = 8


def build_data(raw=False, random_split=True, start_date=None, end_date=None, test_proportion=0.1):
    # if len(sec) == 1 and os.path.isfile(secs[0]):	#it's a file
    # 	with open(secs[0]) as f:
    # 		secs = ["WIKI/" + line.strip() for line in f]

    # print("SECURITIES: ", s[5:] for s in secs)

    with open("stock_data/invalid_stocks.txt", "r+") as f:
        invalid_stock_codes = [line.strip() for line in f]
    f = open("stock_data/invalid_stocks.txt", "a")