Code Monkey home page Code Monkey logo

webclinic017 / readytraderone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jvlelodic/readytraderone

0.0 0.0 0.0 490 KB

Ready Trader One is a programming competition for University students created by Optiver Asia Pacific Pty Ltd. The competition involves coding an autotrader that can trade in a simulated market, trading against other teams to deliver the best result.

License: GNU Affero General Public License v3.0

Python 100.00%

readytraderone's Introduction

Ready Trader One

What is Ready Trader One?

Ready Trader One is a programming competition for University students created by Optiver Asia Pacific Pty Ltd. The competition involves coding an autotrader that can trade in a simulated market, trading against other teams to deliver the best result.

Details about the competition, including the terms and conditions, can be found on the website: readytraderone.com.au.

Getting started

To run Ready Trader One, you'll need Python version 3.6 and PySide2. You can download Python from www.python.org.

Once you have installed Python, you'll need to create a Python virtual environment, and you can find instructions for creating and using virtual environments at docs.python.org/3.6/library/venv.html.

To use the Ready Trader One graphical user interface, you'll need to install the PySide2 package which you can do by running

pip3 install PySide2

in your Python virtual environment.

Running a Ready Trader One match

To run a Ready Trader One match with one or more autotraders, simply run:

python3 rto.py run [AUTOTRADER FILENAME [AUTOTRADER FILENAME]]

For example:

python3 rto.py run autotrader.py

Each autotrader must have a corresponding JSON configuration file as described below.

What's in this archive?

This archive contains everything needed to run a Ready Trader One match in which multiple autotraders compete against each other in a simulated market. For the exact definition of a match, see the competition terms and conditions.

The archive contains:

  • autotrader.json - configuration file for an example autotrader
  • autotrader.py - an example autotrader
  • data - sample market data to use for testing
  • exchange.json - configuration file for the exchange simulator
  • ready_trader_one - the Ready Trader One source code
  • rto.py - Use this with Python 3.6 to run Ready Trader One

Autotrader configuration

Each autotrader is configured with a JSON file like this:

{
  "Execution": {
    "Host": "127.0.0.1",
    "Port": 12345
  },
  "Information": {
    "Interface": "0.0.0.0",
    "ListenAddress": "239.255.1.1",
    "Port": 12346
  },
  "TeamName": "TraderOne",
  "Secret": "secret"
}

The elements of the autotrader configuration are:

  • Execution - network address for sending execution requests (e.g. to place an order)
  • Information - network address to listen for information messages broadcast by the exchange simulator
  • TeamName - name of the team for this autotrader (each autotrader in a match must have a unique name)
  • Secret - password for this autotrader

Simulator configuration

The market simulator is configured with a JSON file called "exchange.json". Here is an example:

{
  "Engine": {
    "MarketDataFile": "data/market_data.csv",
    "MarketOpenDelay": 5.0,
    "MatchEventsFile": "match_events.csv",
    "ScoreBoardFile": "score_board.csv",
    "Speed": 1.0,
    "TickInterval": 0.25
  },
  "Execution": {
    "host": "127.0.0.1",
    "Port": 12345
  },
  "Fees": {
    "Maker": -0.0001,
    "Taker": 0.0002
  },
  "Information": {
    "MulticastAddress": "239.255.1.1",
    "Interface": "0.0.0.0",
    "Port": 12346
  },
  "Instrument": {
    "EtfClamp": 0.002,
    "TickSize": 1.00
  },
  "Limits": {
    "ActiveOrderCountLimit": 10,
    "ActiveVolumeLimit": 200,
    "MessageFrequencyInterval": 1.0,
    "MessageFrequencyLimit": 50,
    "PositionLimit": 1000
  },
  "Traders": {
    "TraderOne": "secret",
    "ExampleOne": "qwerty",
    "ExampleTwo": "12345"
  }
}

The elements of the autotrader configuration are:

  • Engine - source data file, output filename, simulation speed and tick interval
  • Execution - network address to listen for autotrader connections
  • Fees - details of the fee structure
  • Information - network address to broadcast information messages to autotraders
  • Instrument - details of the instrument to be traded
  • Limits - details of the limits by which autotraders must abide
  • Traders - team names and secrets of the autotraders

Important: Each autotrader must have a unique team name and password listed in the 'Traders' section of the exchange.json file.

The Ready Trader One command line utility

The Ready Trader One command line utility, rto.py, can be used to run or replay a match. For help, run:

python3 rto.py --help

Running a match

To run a match, use the "run" command and specify the autotraders you wish to participate in the match:

python3 rto.py run [AUTOTRADER FILENAME [AUTOTRADER FILENAME]]

Each autotrader must have a corresponding JSON file (with the same filename, but ending in ".json" instead of ".py") which contains a unique team name and the team name and secret must be listed in the exchange.json file.

It will take approximately 60 minutes for the match to complete and several files will be produced:

  • autotrader.log - log file for an autotrader
  • exchange.log - log file for the simulator
  • match_events.csv - a record of events during the match
  • score_board.csv - a record of each autotrader's score over time

To aid testing, you can speed up the match by modifying the "Speed" setting in the "exchange.json" configuration file - for example, setting the speed to 2.0 will halve the time it takes to run a match. Note, however, that increasing the speed may change the results.

When testing your autotrader, you should try it with different sample data files by modifying the "MarketDataFile" setting in the "exchange.json" file.

Replaying a match

To replay a match, use the "replay" command and specify the name of the match events file you wish to replay:

python3 rto.py replay match_events.csv

Autotrader environment

Autotraders in Ready Trader One will be run in the following environment:

  • Operating system: Linux
  • Python version: 3.6.10
  • Available libraries: numpy 1.19.5; pandas 1.1.5; scipy 1.5.4
  • Memory limit: 2GB
  • Total disk usage limit: 100MB (including the log file)
  • Maximum number of autotraders per match: 8
  • Autotraders may not create sub-processes but may have multiple threads
  • Autotraders may not access the internet

How do I submit my AutoTrader?

Shortly after the competition begins you'll be supplied with the details of a GIT repository which you can use to submit your autotrader.

To access the GIT repository, you'll need to configure your GIT client with your private key, and we'll use the public key you gave us when you registered to verify that it's you.

To submit your autotrader, simply commit your autotrader.py file to the GIT repository. If you're using C++, simply commit your autotrader.h and autotrader.cc files. Do not put the file(s) in a folder and do not include any other files (any other files will be ignored). You may only submit one autotrader (i.e. you cannot submit both a Python and a C++ autotrader).

You may replace your autotrader with a new one at any time. When each tournament starts we'll use the autotrader in your GIT repository at the cut-off time for that tournament.

readytraderone's People

Contributors

jvlelodic avatar andyliu11037 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.