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[:]
    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_no_hedge_" + select_pair + ".log")
    execute_news_signals.file_ext_key = "_no_hedge"

    for lookup in no_hedge_lookups:
        if lookup[0] == select_pair:
Exemple #2
0
        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(
                [account_nbr],
                execute_news_signals.avg_spreads,
                select_pair,
                "/root/news_signal_",
                execute_news_signals.ModelType.barrier,
                is_low_barrier=False,
                strategy_weight=strategy_weight,
                is_new_trade=(select_pair in trade_pairs))
        elif strategy == "P2":
            #sharpe = execute_news_signals.get_sharpe(False, is_hedge, select_pair, "/root/news_signal_all_", execute_news_signals.ModelType.barrier)

            print("strategy_weight", strategy_weight)

            execute_news_signals.process_pending_trades(
                [account_nbr],
                execute_news_signals.avg_spreads,
                select_pair,
                "/root/news_signal_all_",
                execute_news_signals.ModelType.barrier,
Exemple #3
0
            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(
                    [lookup[0]],
                    execute_news_signals.avg_spreads,
                    select_pair,
                    "/root/time_regression_",
                    execute_news_signals.ModelType.time_regression,
                    trading_params=trading_params,
                    strategy_weight=0.2)  #demo
                print("demo account index", dummy_account_index, lookup)

            dummy_account_index = dummy_account_index + 1

lookups = [
    [
        "101-011-11740843-002",
        "fee5fff8cae39957c79e9cb1fe78276a-8a5ea905de304b6ab14cfb64fb7f44f9"
    ],
    [
        "101-011-11740843-007",
        "fee5fff8cae39957c79e9cb1fe78276a-8a5ea905de304b6ab14cfb64fb7f44f9"