Exemplo n.º 1
0
}
train_options = {
    'upper_th': 0.3,
    'lower_th': -0.3,
    'z_score_mean_window': 3,
    'z_score_std_window': 6,
    'slsp': (-100,2000), # None means no constraint
    'close_change': 1,  # 0 = close; 1 = change
}
# tensorboard --logdir C:\Users\Chris\projects\210215_mt5\production\docs\1\runs --host localhost

with mt5Model.csv_Writer_Helper():
    prices_loader = prices.Prices_Loader(symbols=data_options['symbols'],
                                         timeframe=data_options['timeframe'],
                                         start=data_options['start'],
                                         end=data_options['end'],
                                         timezone=data_options['timezone'],
                                         data_path=data_options['local_min_path'],
                                         deposit_currency=data_options['deposit_currency'])
    # get the data
    prices_loader.get_data(data_options['local'])
    # Prices = prices_loader.get_Prices_format(options['local'])

    # split into train set and test set
    Train_Prices, Test_Prices = prices.split_Prices(prices_loader.Prices, percentage=data_options['trainTestSplit'])
    dependent_variable = Train_Prices.c
    if train_options['close_change'] == 1:
        dependent_variable = Train_Prices.cc

    # define the model, optimizer, trainer, writer
    myModel = None
Exemplo n.º 2
0
                                    -0.98662]),  # will be round to 2 decimal
    'upper_th': 1.5,  # 1.5
    'lower_th': -1.5,  # -1.5
    'z_score_mean_window': 5,
    'z_score_std_window': 20,
    'slsp': (-50000, 50000),  # None means no constraint
    'close_change': 1,  # 0 = close; 1 = change
}

with mt5Model.Trader(dt_string=options['dt'],
                     history_path=trader_options["history_path"],
                     type_filling=trader_options['type_filling']) as trader:

    prices_loader = prices.Prices_Loader(
        symbols=trader_options['symbols'],
        timeframe=trader_options['timeframe'],
        count=trader_options['count'],
        timezone=trader_options['timezone'],
        deposit_currency=trader_options['deposit_currency'])

    long_lots = [
        round(i, 2) for i in coinModel.get_modified_coefficient_vector(
            coin_option['coefficient_vector'],
            long_mode=True,
            lot_times=trader_options['lot_times'])
    ]
    short_lots = [
        round(i, 2) for i in coinModel.get_modified_coefficient_vector(
            coin_option['coefficient_vector'],
            long_mode=False,
            lot_times=trader_options['lot_times'])
    ]