@author: v-beshi """ from sklearn.decomposition import IncrementalPCA from sklearn.neural_network import MLPClassifier import pandas as pd from sklearn.externals import joblib import time import pandas as pd import bfx import huobi_USDT import wallstreet_news from okex2 import OKCoinFuture as ok from preprocessing import d_pro mykey=ok('www.okex.com','Public-Key','Private-Key') def test_data(tt): pca=joblib.load('pca.m') next5=joblib.load('next5.m') next10=joblib.load('next10.m') next15=joblib.load('next15.m') i=0 while i<=tt: try: DateTime=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) ok0330=float(mykey.future_ticker('btc_usd','quarter')['ticker']['last']) ok_thisweek=float(mykey.future_ticker('btc_usd','this_week')['ticker']['last']) bfx_bids_wall=float(bfx.bfx_books()['bids_wall']) bfx_asks_wall=float(bfx.bfx_books()['asks_wall']) bfx_total_bids=float(bfx.bfx_books()['total_bids'])
@author: v-beshi """ import sys import requests import json import time import pandas as pd import bfx import huobi_USDT import wallstreet_news from okex2 import OKCoinFuture as ok import pyodbc import traceback mykey = ok('www.okex.com', 'fabec789-4981-46b7-8155-db0730f6157e', 'A1C6A6937573B675B519A789C1E77C97') #replace the Public-Key and Private-Key with your OKex API access #con=pyodbc.connect('DRIVER={SQL Server};SERVER=server;DATABASE=db;UID=id;PWD=password') con = pyodbc.connect( 'DSN=MYAMAZONSQL;UID=lucaskingjade;DATABASE=PythonTestDB;PWD=wq891216', autocommit=True) #connect to SQL Server Database def input_data(tt): #input the number of rows you want to input j = 0 for i in range(0, tt): #count number of rows try: ok0330 = float(