Пример #1
0
               for j in range(agent_count, agent_count + num_zi_agents)])
agent_types.extend("ZeroIntelligenceAgent")
agent_count += num_zi_agents

# 10) Heuristic Belief Learning Agents
num_hbl_agents = 500
agents.extend([HeuristicBeliefLearningAgent(id=j,
                                            name="HBL_AGENT_{}".format(j),
                                            type="HeuristicBeliefLearningAgent",
                                            symbol=symbol,
                                            starting_cash=starting_cash,
                                            sigma_n=10000,
                                            sigma_s=symbols[symbol]['fund_vol'],
                                            kappa=symbols[symbol]['agent_kappa'],
                                            r_bar=symbols[symbol]['r_bar'],
                                            q_max=10,
                                            sigma_pv=5e4,
                                            R_min=0,
                                            R_max=100,
                                            eta=1,
                                            lambda_a=1e-12,
                                            L=2,
                                            log_orders=False,
                                            random_state=np.random.RandomState(seed=np.random.randint(low=0, high=2 ** 32,
                                                                                                      dtype='uint64')))
               for j in range(agent_count, agent_count + num_hbl_agents)])
agent_types.extend("HeuristicBeliefLearningAgent")
agent_count += num_hbl_agents

########################################################################################################################
########################################### KERNEL AND OTHER CONFIG ####################################################
Пример #2
0
# HBL strategy split.
for i, x in enumerate(hbl):
    strat_name = "Type {} [{} <= R <= {}, eta={}, L={}]".format(
        i + 1, x[1], x[2], x[3], x[4])
    agents.extend([
        HeuristicBeliefLearningAgent(
            j,
            "HBL Agent {} {}".format(j, strat_name),
            "HeuristicBeliefLearningAgent {}".format(strat_name),
            random_state=np.random.RandomState(
                seed=np.random.randint(low=0, high=2**32)),
            log_orders=log_orders,
            symbol=symbol,
            starting_cash=starting_cash,
            sigma_n=sigma_n,
            r_bar=s['r_bar'],
            kappa=s['kappa'],
            sigma_s=s['sigma_s'],
            q_max=10,
            sigma_pv=5000000,
            R_min=x[1],
            R_max=x[2],
            eta=x[3],
            lambda_a=0.005,
            L=x[4]) for j in range(agent_count, agent_count + x[0])
    ])
    agent_types.extend([
        "HeuristicBeliefLearningAgent {}".format(strat_name)
        for j in range(x[0])
    ])
    agent_count += x[0]
Пример #3
0
    agent_count += x[0]

# HBL strategy split.
for i, x in enumerate(hbl):
    strat_name = "Type {} [{} <= R <= {}, eta={}, L={}]".format(
        i + 1, x[1], x[2], x[3], x[4])
    agents.extend([
        HeuristicBeliefLearningAgent(
            j,
            "HBL Agent {} {}".format(j, strat_name),
            "HeuristicBeliefLearningAgent {}".format(strat_name),
            random_state=np.random.RandomState(
                seed=np.random.randint(low=0, high=2**32)),
            log_orders=log_orders,
            symbol=symbol1,
            starting_cash=starting_cash,
            sigma_n=sigma_n,
            r_bar=s1['r_bar'],
            q_max=10,
            sigma_pv=5000000,
            R_min=x[1],
            R_max=x[2],
            eta=x[3],
            lambda_a=0.005,
            L=x[4]) for j in range(agent_count, agent_count + x[0])
    ])
    agent_types.extend([
        "HeuristicBeliefLearningAgent {}".format(strat_name)
        for j in range(x[0])
    ])
    agent_count += x[0]
Пример #4
0
                          lambda_a=0.005) for i in range(0, num_agents)
]
agent_types = ["ZeroIntelligenceAgent" for i in range(num_agents)]
agent_count = num_agents

# Here are the heuristic belief learning agents.
num_hbl_agents = 10
agents.extend([
    HeuristicBeliefLearningAgent(i,
                                 "HBL Agent {}".format(i),
                                 symbol,
                                 starting_cash,
                                 sigma_n=sigma_n,
                                 r_bar=s['r_bar'],
                                 kappa=s['kappa'],
                                 sigma_s=s['sigma_s'],
                                 q_max=10,
                                 sigma_pv=5000000,
                                 R_min=250,
                                 R_max=500,
                                 eta=0.8,
                                 lambda_a=0.005,
                                 L=8)
    for i in range(agent_count, agent_count + num_hbl_agents)
])
agent_types.extend(
    ["HeuristicBeliefLearningAgent" for i in range(num_hbl_agents)])
agent_count += num_hbl_agents

### Configure an exchange agent.