execute_news_signals.checkIfProcessRunning('execute_demo_accounts_barrier.py', execute_news_signals.sys.argv[1]) count = 0 for select_pair in execute_news_signals.sys.argv[1].split(","): count += 1 if count != 1: handlers = execute_news_signals.trade_logger.handlers[:] for handler in handlers: handler.close() execute_news_signals.trade_logger.removeHandler(handler) execute_news_signals.trade_logger = execute_news_signals.setup_logger( 'first_logger', execute_news_signals.root_dir + "trade_news_release_" + select_pair + ".log") execute_news_signals.file_ext_key = "" execute_news_signals.account_type = "fxpractice" for lookup in hedge_lookups: if lookup[0] == select_pair: execute_news_signals.api_key = lookup[2] execute_news_signals.process_pending_trades( [lookup[1]], execute_news_signals.avg_spreads, select_pair, "/root/news_signal_", execute_news_signals.ModelType.barrier) #demo break handlers = execute_news_signals.trade_logger.handlers[:]
execute_news_signals.file_ext_key = "_" + str(user_id) + "_" + account_nbr execute_news_signals.root_dir = "/root/user_data/" + str( user_id) + "/" + account_nbr + "/" if os.path.isdir(execute_news_signals.root_dir) == False: os.makedirs(execute_news_signals.root_dir) if row_count > 0: handlers = execute_news_signals.trade_logger.handlers[:] for handler in handlers: handler.close() execute_news_signals.trade_logger.removeHandler(handler) execute_news_signals.trade_logger = execute_news_signals.setup_logger( 'first_logger', execute_news_signals.root_dir + "trade_managed_accounts.log") if is_demo: execute_news_signals.account_type = "fxpractice" else: execute_news_signals.account_type = "fxtrade" for select_pair in all_currency_pairs: if strategy == "P1": #sharpe = execute_news_signals.get_sharpe(False, is_hedge, select_pair, "/root/news_signal_", execute_news_signals.ModelType.barrier) print("strategy_weight", strategy_weight) execute_news_signals.process_pending_trades(
]: for min_trade_volatility in [25, 50, 75, 100, 125, 150]: count += 1 if count != 1: handlers = execute_news_signals.trade_logger.handlers[:] for handler in handlers: handler.close() execute_news_signals.trade_logger.removeHandler(handler) execute_news_signals.file_ext_key = "params_rmse_percentile_" + str( rmse_percentile) + "_min_volatility_" + str( min_trade_volatility) + "_is_normalize_signal_" + str( is_normalize_signal) execute_news_signals.trade_logger = execute_news_signals.setup_logger( 'first_logger', execute_news_signals.root_dir + execute_news_signals.file_ext_key + "_trade_news_release_no_hedge_all.log") lookup = dummy_accounts[dummy_account_index] execute_news_signals.account_type = "fxpractice" execute_news_signals.api_key = lookup[1] trading_params = { "is_normalize_signal": is_normalize_signal, "auc_barrier_mult": rmse_percentile, "rmse_percentile": rmse_percentile, "min_trade_volatility": min_trade_volatility } for select_pair in execute_news_signals.sys.argv[1].split(","): execute_news_signals.process_pending_trades(