prosperity3bt 0.9.0__tar.gz → 0.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/PKG-INFO +3 -3
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/README.md +2 -2
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/data.py +47 -2
- prosperity3bt-0.10.0/prosperity3bt/resources/round4/observations_round_4_day_1.csv +10001 -0
- prosperity3bt-0.10.0/prosperity3bt/resources/round4/observations_round_4_day_2.csv +10001 -0
- prosperity3bt-0.10.0/prosperity3bt/resources/round4/observations_round_4_day_3.csv +10001 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/runner.py +29 -1
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/PKG-INFO +3 -3
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/SOURCES.txt +3 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/pyproject.toml +1 -1
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/LICENSE +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/__main__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/datamodel.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/file_reader.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/models.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/open.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/parse_submission_logs.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/py.typed +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round0/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round0/prices_round_0_day_-1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round0/trades_round_0_day_-1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/prices_round_1_day_-1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/prices_round_1_day_-2.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/prices_round_1_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/trades_round_1_day_-1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/trades_round_1_day_-2_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round1/trades_round_1_day_0_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/prices_round_2_day_-1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/prices_round_2_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/prices_round_2_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/trades_round_2_day_-1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/trades_round_2_day_0_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round2/trades_round_2_day_1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/prices_round_3_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/prices_round_3_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/prices_round_3_day_2.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/trades_round_3_day_0_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/trades_round_3_day_1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round3/trades_round_3_day_2_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/prices_round_4_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/prices_round_4_day_2.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/prices_round_4_day_3.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/trades_round_4_day_1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/trades_round_4_day_2_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round4/trades_round_4_day_3_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_2.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_3.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_4.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/prices_round_6_day_6.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_0_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_2_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_3_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_4_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round6/trades_round_6_day_6_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round7/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round7/prices_round_7_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round7/prices_round_7_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round7/prices_round_7_day_2.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round7/prices_round_7_day_3.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/__init__.py +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/prices_round_8_day_-1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/prices_round_8_day_0.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/prices_round_8_day_1.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/trades_round_8_day_-1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/trades_round_8_day_0_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt/resources/round8/trades_round_8_day_1_nn.csv +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/dependency_links.txt +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/entry_points.txt +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/requires.txt +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/prosperity3bt.egg-info/top_level.txt +0 -0
- {prosperity3bt-0.9.0 → prosperity3bt-0.10.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: prosperity3bt
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.10.0
|
4
4
|
Summary: Backtester for IMC Prosperity 3 algorithms
|
5
5
|
Author-email: Jasper van Merle <jaspervmerle@gmail.com>
|
6
6
|
License: MIT License
|
@@ -120,12 +120,12 @@ Data for the following rounds is included:
|
|
120
120
|
- Round 1: prices and anonymized trades data on RAINFOREST_RESIN, KELP, and SQUID_INK.
|
121
121
|
- Round 2: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, and PICNIC_BASKET2.
|
122
122
|
- Round 3: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, and VOLCANIC_ROCK_VOUCHER_10500.
|
123
|
-
- Round 4: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, VOLCANIC_ROCK_VOUCHER_10500, and MAGNIFICENT_MACARONS.
|
123
|
+
- Round 4: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, VOLCANIC_ROCK_VOUCHER_10500, and MAGNIFICENT_MACARONS. Conversion observation data on MAGNIFICENT_MACARONS.
|
124
124
|
- Round 6: prices and anonymized trades data that was used during submission runs. Round 6 day X represents the submission data of round X, where X = 0 means the tutorial round and X = 6 means the submission data of round 2 before it was updated because of RAINFOREST_RESIN data this year and AMETHYSTS data last year being identical. The anonymized trades data is derived from the submission of an algorithm that places no orders.
|
125
125
|
- Round 7: prices data that was used during end-of-round runs. Round 7 day X represents the submission data of round X. The exception to the rule is round 1, its old end-of-round data can be found in round 7 day 0 and its new data can be found in round 7 day 1.
|
126
126
|
- Round 8: the version of round 2 data before it was updated because of RAINFOREST_RESIN data this year and AMETHYSTS data last year being identical.
|
127
127
|
|
128
|
-
Conversions
|
128
|
+
Conversions are not supported.
|
129
129
|
|
130
130
|
## Environment Variables
|
131
131
|
|
@@ -74,12 +74,12 @@ Data for the following rounds is included:
|
|
74
74
|
- Round 1: prices and anonymized trades data on RAINFOREST_RESIN, KELP, and SQUID_INK.
|
75
75
|
- Round 2: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, and PICNIC_BASKET2.
|
76
76
|
- Round 3: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, and VOLCANIC_ROCK_VOUCHER_10500.
|
77
|
-
- Round 4: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, VOLCANIC_ROCK_VOUCHER_10500, and MAGNIFICENT_MACARONS.
|
77
|
+
- Round 4: prices and anonymized trades data on RAINFOREST_RESIN, KELP, SQUID_INK, CROISSANTS, JAMS, DJEMBES, PICNIC_BASKET1, PICNIC_BASKET2, VOLCANIC_ROCK, VOLCANIC_ROCK_VOUCHER_9500, VOLCANIC_ROCK_VOUCHER_9750, VOLCANIC_ROCK_VOUCHER_10000, VOLCANIC_ROCK_VOUCHER_10250, VOLCANIC_ROCK_VOUCHER_10500, and MAGNIFICENT_MACARONS. Conversion observation data on MAGNIFICENT_MACARONS.
|
78
78
|
- Round 6: prices and anonymized trades data that was used during submission runs. Round 6 day X represents the submission data of round X, where X = 0 means the tutorial round and X = 6 means the submission data of round 2 before it was updated because of RAINFOREST_RESIN data this year and AMETHYSTS data last year being identical. The anonymized trades data is derived from the submission of an algorithm that places no orders.
|
79
79
|
- Round 7: prices data that was used during end-of-round runs. Round 7 day X represents the submission data of round X. The exception to the rule is round 1, its old end-of-round data can be found in round 7 day 0 and its new data can be found in round 7 day 1.
|
80
80
|
- Round 8: the version of round 2 data before it was updated because of RAINFOREST_RESIN data this year and AMETHYSTS data last year being identical.
|
81
81
|
|
82
|
-
Conversions
|
82
|
+
Conversions are not supported.
|
83
83
|
|
84
84
|
## Environment Variables
|
85
85
|
|
@@ -49,6 +49,18 @@ def get_column_values(columns: list[str], indices: list[int]) -> list[int]:
|
|
49
49
|
return values
|
50
50
|
|
51
51
|
|
52
|
+
@dataclass
|
53
|
+
class ObservationRow:
|
54
|
+
timestamp: int
|
55
|
+
bidPrice: float
|
56
|
+
askPrice: float
|
57
|
+
transportFees: float
|
58
|
+
exportTariff: float
|
59
|
+
importTariff: float
|
60
|
+
sugarPrice: float
|
61
|
+
sunlightIndex: float
|
62
|
+
|
63
|
+
|
52
64
|
@dataclass
|
53
65
|
class BacktestData:
|
54
66
|
round_num: int
|
@@ -56,11 +68,14 @@ class BacktestData:
|
|
56
68
|
|
57
69
|
prices: dict[int, dict[Symbol, PriceRow]]
|
58
70
|
trades: dict[int, dict[Symbol, list[Trade]]]
|
71
|
+
observations: dict[int, ObservationRow]
|
59
72
|
products: list[Symbol]
|
60
73
|
profit_loss: dict[Symbol, float]
|
61
74
|
|
62
75
|
|
63
|
-
def create_backtest_data(
|
76
|
+
def create_backtest_data(
|
77
|
+
round_num: int, day_num: int, prices: list[PriceRow], trades: list[Trade], observations: list[ObservationRow]
|
78
|
+
) -> BacktestData:
|
64
79
|
prices_by_timestamp: dict[int, dict[Symbol, PriceRow]] = defaultdict(dict)
|
65
80
|
for row in prices:
|
66
81
|
prices_by_timestamp[row.timestamp][row.product] = row
|
@@ -72,11 +87,14 @@ def create_backtest_data(round_num: int, day_num: int, prices: list[PriceRow], t
|
|
72
87
|
products = sorted(set(row.product for row in prices))
|
73
88
|
profit_loss = {product: 0.0 for product in products}
|
74
89
|
|
90
|
+
observations_by_timestamp = {row.timestamp: row for row in observations}
|
91
|
+
|
75
92
|
return BacktestData(
|
76
93
|
round_num=round_num,
|
77
94
|
day_num=day_num,
|
78
95
|
prices=prices_by_timestamp,
|
79
96
|
trades=trades_by_timestamp,
|
97
|
+
observations=observations_by_timestamp,
|
80
98
|
products=products,
|
81
99
|
profit_loss=profit_loss,
|
82
100
|
)
|
@@ -87,6 +105,31 @@ def has_day_data(file_reader: FileReader, round_num: int, day_num: int) -> bool:
|
|
87
105
|
return file is not None
|
88
106
|
|
89
107
|
|
108
|
+
def read_observations(file_reader: FileReader, round_num: int, day_num: int) -> list[ObservationRow]:
|
109
|
+
observations = []
|
110
|
+
with file_reader.file([f"round{round_num}", f"observations_round_{round_num}_day_{day_num}.csv"]) as file:
|
111
|
+
if file is None:
|
112
|
+
return []
|
113
|
+
|
114
|
+
for line in file.read_text(encoding="utf-8").splitlines()[1:]:
|
115
|
+
columns = line.split(",")
|
116
|
+
|
117
|
+
observations.append(
|
118
|
+
ObservationRow(
|
119
|
+
timestamp=int(columns[0]),
|
120
|
+
bidPrice=float(columns[1]),
|
121
|
+
askPrice=float(columns[2]),
|
122
|
+
transportFees=float(columns[3]),
|
123
|
+
exportTariff=float(columns[4]),
|
124
|
+
importTariff=float(columns[5]),
|
125
|
+
sugarPrice=float(columns[6]),
|
126
|
+
sunlightIndex=float(columns[7]),
|
127
|
+
)
|
128
|
+
)
|
129
|
+
|
130
|
+
return observations
|
131
|
+
|
132
|
+
|
90
133
|
def read_day_data(file_reader: FileReader, round_num: int, day_num: int, no_names: bool) -> BacktestData:
|
91
134
|
prices = []
|
92
135
|
with file_reader.file([f"round{round_num}", f"prices_round_{round_num}_day_{day_num}.csv"]) as file:
|
@@ -134,4 +177,6 @@ def read_day_data(file_reader: FileReader, round_num: int, day_num: int, no_name
|
|
134
177
|
|
135
178
|
break
|
136
179
|
|
137
|
-
|
180
|
+
observations = read_observations(file_reader, round_num, day_num)
|
181
|
+
|
182
|
+
return create_backtest_data(round_num, day_num, prices, trades, observations)
|