Core features of the contest system are given below. This page is not a comprehensive description but rather a quick start overview!
- Contest structure
- Trading simulator
- Off-line development package
- Using Viewer to analyze order book
- Quick Tips
There are three submission types in the competition:
- There is no practical limit on the number of training submissions — use them to develop and to improve your strategies.
- Control mode — your strategies will be run on a new set of days, which are not available in the testing mode. This helps you to determine whether your strategy performs well on out of sample data. Besides, control submissions are taken into account for overall rating. You may upload up to two control submissions per day.
- Weekly testing — each week the selected strategy (or the best one among control runs) will be run on a new dataset.
Final testing will be carried out after the main competition phase is over.
- Four restrictions approximate the trading simulator to the reality:
- Maximum bid / ask size for an open position is limited to 100 lots. This limit replaces the initial capital limit.
- If your strategy losses reach -100000, the simulator liquidates the position and stops trading.
- Fee = 8 per each executed lot.
- Round-trip equals to 10 microseconds. This is the time period from a moment you request some action (to add or to remove an order) to the moment when it is actually processed.
- At the end of the trading session the position is liquidated. It happens automatically for your convenience. More on this here.
- Your strategy deals with three types of events: order book update, deals update and your order execution report. So, when your order is executed, the first event is the order execution report and the next one is the deals update.
Take particular attention to the strategy logs as they contain data on your orders and deals.
See Trading simulator for more information.
Off-line development package
We have published the off-line development package on GitHub:
git clone https://github.com/hftbattle/hftbattle.git
To work with the package you need a compiler g++ 5.0 or above, CMake 2.8.4 or above, too.
If the strategy is written in C++, the single cpp file contains everything. If it is written in Python, its code is in the python_strategy.py. Each strategy has a corresponding json file.
To build everything in the strategies folder it is necessary to run python script build.py located in the repository root to build all the strategies in the folder:
To run the strategy, run the python script run.py with the strategy name as a parameter to execute the chosen strategy:
If you develop new strategies in the off-line development package, change the strategy registration line in the cpp-file. Note that best_strategy_ever is the folder, cpp and json files name:
More on that in the off-line development kit.
Using Viewer to analyze the order book
- On viewer.hftbattle.com you may get a trading visualization tool. All events are shown atomically, deals are combined in packets, as they were sent by the exchange.
- Please note, that the order book in Viewer is actually the market online order book that is a list of pairs [price, total amount by the price] currently existing on the market. You are not able to affect it.
- You can also see your strategy transactions in Viewer. Click the button “Write data to Viewer” on the particular day. After a certain amount of time you will get an opportunity to see your strategy actions in Viewer.
- You may browse through all events or through your strategy events only (see Settings tab).
- Click at any point on the chart to get into Viewer. Order book state around the time moment corresponding to the chart point will be displayed.
More on that in the Viewer section.
- In case you would like to find out how your strategy performs on a particular day, you may run it just for the selected date. This way you get results much faster.
- To get most out of your idea try parameters tuning.
More on the participant interface in the corresponding section.