-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
68 lines (53 loc) · 1.71 KB
/
main.py
File metadata and controls
68 lines (53 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import random
from typing import List
from simulation.runner import Runner
from core.types import AgentId, Price
from agents.base_agent import TradingAgent
from agents.house_agents import BadMarketMaker, NoiseTraderBot, RandomReverter, MysteryBot
# !!! IMPORT YOUR BOTS HERE !!!
if __name__ == "__main__":
# --- Simulation Configuration ---
SIMULATION_SEED = 2025
NUM_TICKS = 10_000
DEFAULT_FAIR_VALUE = Price(100)
# House agents
num_market_makers = 3
num_noise_traders = 20
num_mystery_bots = 5
# User agent
# !!! ADD YOUR AGENT HERE !!!
user_agent = None # << Replace None with your agent
# !!! ADD YOUR AGENT HERE !!!
# Setup
config_rng = random.Random(SIMULATION_SEED)
all_agents: List[TradingAgent] = []
# --- Add agents ---
all_agents.append(user_agent) if user_agent else None
for i in range(1, num_market_makers+1):
all_agents.append(
BadMarketMaker(
agent_id = AgentId(i*100),
default_fair_value = DEFAULT_FAIR_VALUE
)
)
for i in range(1, num_noise_traders+1):
all_agents.append(
NoiseTraderBot(
agent_id = AgentId(-i*100),
trade_probability = 0.8,
max_trade_size = 75
)
)
for i in range(num_market_makers+1, num_mystery_bots+num_market_makers+2):
all_agents.append(
MysteryBot(
agent_id = AgentId(i*100),
default_fair_value = DEFAULT_FAIR_VALUE,
)
)
# --- Execution ---
sim = Runner(agents=all_agents, seed=SIMULATION_SEED)
sim.run(
num_ticks = NUM_TICKS,
verbose = True
)