Exemplo n.º 1
0
def upload_file(path):
    """
    Put file on s3
    """
    init()
    s3 = session.client('s3')
    return s3.upload_file(path, bucket_name, path)
Exemplo n.º 2
0
def download_file(path):
    """
    Get file from s3
    """
    init()
    s3 = session.resource('s3')
    s3_object = s3.Object(bucket_name=bucket_name, key=path)
    return s3_object.download_file(path)
Exemplo n.º 3
0
def xgb_cron_pred(model_type='trade'):
    """
    - Loads model for the given unique trading pair, gets the latest data
    availble for that trading pair complete with
    """
    init()
    for exchange_id, trading_pair in h.yield_unique_pair(return_api=False):
        print(exchange_id, trading_pair)
Exemplo n.º 4
0
def cron_pred():
    """
    - Loads model for the given unique trading pair, gets the latest data
    availble for that trading pair complete with
    """
    init()
    all_preds = pd.DataFrame(columns=['close', 'api', 'trading_pair',
                                      'exchange_id', 'timestamp'])
    model_type = 'neural'
Exemplo n.º 5
0
def test_trade_model():
    init()
    exchange_id = 'hitbtc'
    trading_pair = 'eos_usd'
    period = 300
    start = '03-01-2019'

    df, dataset = h.get_data(exchange_id, trading_pair, period, start, n=8000)

    print(score)
    print(preds)

    exchange_id = 'hitbtc'
    trading_pair = 'btc_usd'
    period = 300
    start = '03-01-2019'

    df, dataset = h.get_data(exchange_id, trading_pair, period, start, n=15000)

    print(score)
    print(preds)
Exemplo n.º 6
0
def cron_train():
    """
    - Loads model for the given unique trading pair, gets the latest data
    availble for that trading pair complete with
    """
    init()
Exemplo n.º 7
0
# begin inter imports
from cryptolytic.start import init
# init call early in imports so that cryptolytic.session imports correctly on
# Windows operating systems
init()
import cryptolytic.model.model_framework as model_framework
import cryptolytic.model.data_work as dw
import cryptolytic.data.historical as h
import cryptolytic.data as d
import cryptolytic.data.sql as sql
​
import cryptolytic.model.model_framework as mfw
from cryptolytic import session
import cryptolytic.model.xgboost_model as xgmod
import cryptolytic.data.aws as aws
import cryptolytic.model.xgboost_model as xtrade
import cryptolytic.model.xgboost_arb_model as xarb
import pickle
​
​
# tensorflow imports
import tensorflow as tf
​
# begin general external imports
import os
import ta
import pandas as pd
import time
from io import StringIO
import gc
​