Ejemplo n.º 1
0
def get_conf_helper():
    obj_helper = DataProcessor('data_in','data_out','conf_help.yml')
    obj_helper.read_prm()
    cut_cluster = obj_helper.conf.get('cut_cluster')
    cut_cluster_num = obj_helper.conf.get('cut_cluster_num')
    max_cluster_rep = obj_helper.conf.get('max_cluster_rep')
    return(cut_cluster,cut_cluster_num,max_cluster_rep)
Ejemplo n.º 2
0
def get_data_all():
    obj_reader = DataProcessor('data_in', 'data_out', 'conf_model.yml')
    obj_reader.read_prm()
    obj_reader.process()
    return(obj_reader.hk_index_daily,obj_reader.nikkei_index_daily,obj_reader.spmini_index_daily,obj_reader.eu_index_daily,obj_reader.vix_index_daily, \
           obj_reader.hk_index_minute,obj_reader.nikkei_index_minute,obj_reader.spmini_index_minute,obj_reader.eu_index_minute,obj_reader.vix_index_minute, \
           obj_reader.hk_daily_dates,obj_reader.nikkei_daily_dates,obj_reader.spmini_daily_dates,obj_reader.eu_daily_dates,obj_reader.vix_daily_dates, \
           obj_reader.hk_minute_dates,obj_reader.nikkei_minute_dates,obj_reader.spmini_minute_dates,obj_reader.eu_minute_dates,obj_reader.vix_minute_dates)
Ejemplo n.º 3
0
from dt_help import Helper
from dt_model import SmaCross, LogPrice, SmaEma, BollStrat, FractalBollStrat
from dt_read import DataProcessor
from pandas.plotting import register_matplotlib_converters

warnings.filterwarnings('ignore', category=FutureWarning)
pd.options.mode.chained_assignment = None
register_matplotlib_converters()

if __name__ == '__main__':
    obj_helper = Helper('data_in', 'conf_help.yml')
    obj_helper.read_prm()

    fontsize = obj_helper.conf['font_size']
    matplotlib.rcParams['axes.labelsize'] = fontsize
    matplotlib.rcParams['xtick.labelsize'] = fontsize
    matplotlib.rcParams['ytick.labelsize'] = fontsize
    matplotlib.rcParams['legend.fontsize'] = fontsize
    matplotlib.rcParams['axes.titlesize'] = fontsize
    matplotlib.rcParams['text.color'] = 'k'

    obj_reader = DataProcessor('data_in', 'data_out', 'conf_model.yml')
    obj_reader.read_prm()
    obj_reader.process()

    # strat_0 = SmaCross.exec_model(obj_reader.values,obj_reader.cash)
    # strat_1 = LogPrice.exec_model(obj_reader.values,obj_reader.cash)
    # strat_2 = SmaEma.exec_model(obj_reader.values,obj_reader.cash)
    # strat_3 = BollStrat.exec_model(obj_reader.values,obj_reader.cash)
    # strat_4 = FractalBollStrat.exec_model(obj_reader.values,obj_reader.cash)
Ejemplo n.º 4
0
def get_data_all():
    obj_reader = DataProcessor('data_in','data_out','conf_model.yml')
    obj_reader.read_prm()
    obj_reader.process()
    return(obj_reader.trade_data,obj_reader.bid_data,obj_reader.ask_data,obj_reader.volume_data,
           obj_reader.df_trade_cluster,obj_reader.df_bid_cluster,obj_reader.df_ask_cluster)
Ejemplo n.º 5
0
pd.options.mode.chained_assignment = None
register_matplotlib_converters()

if __name__ == '__main__':
    obj_helper = Helper('data_in', 'conf_help.yml')
    obj_helper.read_prm()

    fontsize = obj_helper.conf['font_size']
    matplotlib.rcParams['axes.labelsize'] = fontsize
    matplotlib.rcParams['xtick.labelsize'] = fontsize
    matplotlib.rcParams['ytick.labelsize'] = fontsize
    matplotlib.rcParams['legend.fontsize'] = fontsize
    matplotlib.rcParams['axes.titlesize'] = fontsize
    matplotlib.rcParams['text.color'] = 'k'

    obj_0 = DataProcessor('data_in', 'data_out', 'conf_model.yml')
    obj_0.read_prm()
    obj_0.read_tickers()
    obj_0.process()

    yvar = obj_0.conf.get('yvar')
    df = obj_0.data[[yvar]]

    # Initiating the class
    deep_learner = DeepModelTS(
        data=df,
        Y_var=yvar,
        lag=obj_0.conf.get('lag'),
        n_ahead=obj_0.conf.get('n_ahead'),
        LSTM_layer_depth=obj_0.conf.get('LSTM_layer_depth'),
        epochs=obj_0.conf.get('epochs'),