def __init__(self, input_strategy_setup, input_strategy, market_setup, algorithm_setup, bt_strategy_setup, bt_datafeed_setup): self._args = model_launcher_parser.parse_args() self._input_strategy_origin = input_strategy self._input_strategy_post = input_strategy_setup(input_strategy) self._market_setup = market_setup self._algorithm_setup = algorithm_setup self._bt_datafeed_setup = bt_datafeed_setup self._bt_datafeed = bt_datafeed_setup() self._bt_strategy_setup = bt_strategy_setup self._bt_strategy = bt_strategy_setup()
def main(args): env = Market(args.codes, **{"use_sequence": True}) algorithm = Algorithm( tf.Session(config=config), env, env.seq_length, env.data_dim, env.code_count, **{ "mode": args.mode, # "mode": "test", "save_path": os.path.join(CHECKPOINTS_DIR, "SL", "DualAttnRNN", "model"), "summary_path": os.path.join(CHECKPOINTS_DIR, "SL", "DualAttnRNN", "summary"), "hidden_size": 5, "enable_saver": True, "enable_summary_writer": True }) algorithm.run() algorithm.eval_and_plot() if __name__ == '__main__': main(model_launcher_parser.parse_args())
def setUp(self): self.args = model_launcher_parser.parse_args()