Team Name: K2BLE
Python projects should use a virtual environment to control which versions of packages are used. After cloning this repository, perform the following commands while inside the directory.
- Create a virtual environment with
python -m venv ".venv"
. - Activate it with
./.venv/Scripts/activate
on Windows, orsource ./.venv/bin/activate
on Mac (not tested yet). - Install the required packages with
pip install -r requirements.txt
. - Run
pip install -e tools
.
Whenever you install a new package and use it in the project, add it to the requirements list with pip freeze > requirements.txt
. This overwrites the old file, so make sure the new package is really necessary!
timestep:
From experiments, this is approximately what happens at each
- you get a list of bids/offers
- you get to submit any number of bids/offers
- your trades get matched to the bots' bids/offers, resolving to the bot price
- your remaining trades may be executed by the bots, resolving to your price
The backtester will simulate your trades on the order book in each iteration, so all trades of step 3 above will be processed. No trades from step 4 will be processed as we don't know what the bots will do (thus the backtester will execute less trades overall).
Example code in tutorial-round/backtest.py
.
- Run
prober.py
(or some other solution that printsjsonpickle.encode(state)
and nothing else) on the actual evaluation platform. - Download the log.
- Parse the log file:
log = log_parser.parse_log("/path/to/log/file", parse_trader_log_as_object=True)
- Run
backtester.backtest(trader.run, log)
, wheretrader.run
is the run function of the trader you want to backtest.
Note that you don't need to make a trader to run the backtester: just make the function if you're testing things out.
This is what I did so far...
Data1 includes all the stuff from the log, thinking maybe we keep each thing in a seperate folder? idk how to best organise data
I wrote the script that changes log into 2 logs and a csv (readLog.py)
In each data folder there is the trader bot that gave that data:
Trader1 is just standard, doesnt ac work because 'appropriate price' was set to like 10 or smt
Trader2 I set 'appropriate price' to 10000, this now only trades Amethyst because thats the one with a stable price Trader2 only 'market takes' when price moves
Trader3 and Trader4 are constantly market making around 10000, trader3 is 9999 bid 10001 ask trader4 is 9998 bid 10002 ask
both have same PnL, shown in activityAnalysis.ipynb