prosperity3bt 0.9.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

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/runner.py CHANGED
@@ -6,7 +6,16 @@ from IPython.utils.io import Tee
6
6
  from tqdm import tqdm
7
7
 
8
8
  from prosperity3bt.data import LIMITS, BacktestData, read_day_data
9
- from prosperity3bt.datamodel import Listing, Observation, Order, OrderDepth, Symbol, Trade, TradingState
9
+ from prosperity3bt.datamodel import (
10
+ ConversionObservation,
11
+ Listing,
12
+ Observation,
13
+ Order,
14
+ OrderDepth,
15
+ Symbol,
16
+ Trade,
17
+ TradingState,
18
+ )
10
19
  from prosperity3bt.file_reader import FileReader
11
20
  from prosperity3bt.models import (
12
21
  ActivityLogRow,
@@ -33,6 +42,25 @@ def prepare_state(state: TradingState, data: BacktestData) -> None:
33
42
 
34
43
  state.listings[product] = Listing(product, product, 1)
35
44
 
45
+ observation_row = data.observations.get(state.timestamp)
46
+
47
+ if observation_row is None:
48
+ state.observations = Observation({}, {})
49
+ else:
50
+ conversion_observation = ConversionObservation(
51
+ bidPrice=observation_row.bidPrice,
52
+ askPrice=observation_row.askPrice,
53
+ transportFees=observation_row.transportFees,
54
+ exportTariff=observation_row.exportTariff,
55
+ importTariff=observation_row.importTariff,
56
+ sugarPrice=observation_row.sugarPrice,
57
+ sunlightIndex=observation_row.sunlightIndex,
58
+ )
59
+
60
+ state.observations = Observation(
61
+ plainValueObservations={}, conversionObservations={"MAGNIFICENT_MACARONS": conversion_observation}
62
+ )
63
+
36
64
 
37
65
  def type_check_orders(orders: dict[Symbol, list[Order]]) -> None:
38
66
  for key, value in orders.items():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prosperity3bt
3
- Version: 0.9.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 and conversion observations are not supported.
128
+ Conversions are not supported.
129
129
 
130
130
  ## Environment Variables
131
131
 
@@ -1,13 +1,13 @@
1
1
  prosperity3bt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  prosperity3bt/__main__.py,sha256=bx4AfUcwwb_-kMJ5d_jdwwb0uehUZzgBkvw1wgPy8eM,9424
3
- prosperity3bt/data.py,sha256=JAjOAZj2__px3O3zaLSv-WAzic5pDAzOsXh2-cGZ_HU,4301
3
+ prosperity3bt/data.py,sha256=aLl2f4c5b4-frNcJ-FuW4Aesy1pmYdEYQXMTASi6Lk0,5732
4
4
  prosperity3bt/datamodel.py,sha256=zcQTqLkOG2IRT6a9BWdYKtJ8wqyJulkQcHs0H5IfiqA,4040
5
5
  prosperity3bt/file_reader.py,sha256=clNSLPpVOuBqcCKvaCKbYbruqQxREWR71sqYzMcCXhM,1392
6
6
  prosperity3bt/models.py,sha256=t4_RqcRLT199Y80ZO47q_6jirb2qiSiTzVVLEemyVcw,2560
7
7
  prosperity3bt/open.py,sha256=iaxWp401d7kPB_tE-K_zQLvSFl66NDCC4efzuQ36iXI,1118
8
8
  prosperity3bt/parse_submission_logs.py,sha256=7zQ1xnNh09gE0gQxJ4foFrTXiFbkt2x_R5eVE9VscHw,2765
9
9
  prosperity3bt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- prosperity3bt/runner.py,sha256=pzV1mKahGb6y-AJWN1TeF0QLtq_-pxKVy1--4TWdppA,11677
10
+ prosperity3bt/runner.py,sha256=vPkrSY4JoMt8HZ7e-3_lT9Uc1NtktqX3pOe-TieYGbw,12490
11
11
  prosperity3bt/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  prosperity3bt/resources/round0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  prosperity3bt/resources/round0/prices_round_0_day_-1.csv,sha256=3vIHfkfwCBZW9AUw5sjmdzOuJaBDLlsIUMDvuiObH7Q,249936
@@ -34,6 +34,9 @@ prosperity3bt/resources/round3/trades_round_3_day_0_nn.csv,sha256=QGFjJypDS9kmad
34
34
  prosperity3bt/resources/round3/trades_round_3_day_1_nn.csv,sha256=DxNfQlGZshL7rWdabse6A6mHmBCGwx5eZPxtHfkM4a4,776454
35
35
  prosperity3bt/resources/round3/trades_round_3_day_2_nn.csv,sha256=iisa4ZmQ-swAziZ3nxnve7n5ArsS8kfl0d2SZwqn5PM,771128
36
36
  prosperity3bt/resources/round4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ prosperity3bt/resources/round4/observations_round_4_day_1.csv,sha256=otdJU3Bu1Tggo01jWx0WCYz8Sb0E-519bbE32jpWcaA,536265
38
+ prosperity3bt/resources/round4/observations_round_4_day_2.csv,sha256=PdE7-A6vAgzQ-9dQckgyz-3deBBpAKiT86kMEjs-cLw,723387
39
+ prosperity3bt/resources/round4/observations_round_4_day_3.csv,sha256=ZIgddHjk6IrYrKTSc_-iNEv0xdr4EMJsRiuDPRzLWTI,729362
37
40
  prosperity3bt/resources/round4/prices_round_4_day_1.csv,sha256=VxnwKFZ3K43PmCRdvrEzqx7jzx4ktKFUFcZoQQKJHWo,9913462
38
41
  prosperity3bt/resources/round4/prices_round_4_day_2.csv,sha256=Hs2QorDoPab01fG8LDaLOEjgt8ZCOg_KKHneYDLcERs,9864752
39
42
  prosperity3bt/resources/round4/prices_round_4_day_3.csv,sha256=BGFyFTAHUqJkcO-Eo5hwTHHItJeIkSZqQiwIN6U91xo,9820770
@@ -65,9 +68,9 @@ prosperity3bt/resources/round8/prices_round_8_day_1.csv,sha256=uEAc2XhX8NG266W61
65
68
  prosperity3bt/resources/round8/trades_round_8_day_-1_nn.csv,sha256=6Y_hdrQL6tg9rIjIGdkuKHCsk_4mz9Q3qLlIffZjQf4,482682
66
69
  prosperity3bt/resources/round8/trades_round_8_day_0_nn.csv,sha256=acbo9lpQrJGWV3EXmb7F8jePLbbcI8BJJjpkPCjXpEA,481747
67
70
  prosperity3bt/resources/round8/trades_round_8_day_1_nn.csv,sha256=fs6Z_3aYHsB6G2cHw2Mf-JESSFkz61c34CsdcICBv0o,485456
68
- prosperity3bt-0.9.0.dist-info/licenses/LICENSE,sha256=fel8BL5f1w-o-aUb4ZDJchOOx_ldqM0V9aIxl5G00MA,1073
69
- prosperity3bt-0.9.0.dist-info/METADATA,sha256=epXyt-SRJ4a5YdviTiEA5coDiYUZc9BdVKkNs7u6Y74,9044
70
- prosperity3bt-0.9.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
71
- prosperity3bt-0.9.0.dist-info/entry_points.txt,sha256=09PWTfMVNppmPEDXrbOtIRK087zoC5W2IBXWpD7WolQ,62
72
- prosperity3bt-0.9.0.dist-info/top_level.txt,sha256=aPf2VrYQr3L02jA7JNT0lEFbIG0-T9f0TLwHdxgVJIc,14
73
- prosperity3bt-0.9.0.dist-info/RECORD,,
71
+ prosperity3bt-0.10.0.dist-info/licenses/LICENSE,sha256=fel8BL5f1w-o-aUb4ZDJchOOx_ldqM0V9aIxl5G00MA,1073
72
+ prosperity3bt-0.10.0.dist-info/METADATA,sha256=t-INaXiLT_4Q10eAXRw73BItkXe7von0aex6j81Glfo,9070
73
+ prosperity3bt-0.10.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
74
+ prosperity3bt-0.10.0.dist-info/entry_points.txt,sha256=09PWTfMVNppmPEDXrbOtIRK087zoC5W2IBXWpD7WolQ,62
75
+ prosperity3bt-0.10.0.dist-info/top_level.txt,sha256=aPf2VrYQr3L02jA7JNT0lEFbIG0-T9f0TLwHdxgVJIc,14
76
+ prosperity3bt-0.10.0.dist-info/RECORD,,