High Frequency Trading Quick Reference Guide

Understanding The Gamestate

Your calculateMove() function will be passed the current state of the game, the 'gameState'. The gameState is a python dictionary containing the following keys:

  • MyAssets - Is a list of your current assets divided into each currency type.
  • MyAssetsTotal - Is the value of all your assets converted into GBP.
  • MyHistory - Is a list of your previous asset values divided into each currency type.
  • OppAssets - Is a list of your opponents assets divided into each currency type.
  • OppAssetsTotal - Is the value of all your opponents assets converted into GBP.
  • OppHistory - Is a list of your opponents previous asset values divided into each currency type.
  • IsMover - A boolean that represents whether you can submit a trade. Always set to True as long as game is running.
  • ExchangeList - Is the current exchange rates for each of the currencies in play.
  • StartingPounds - The number of GBP you initially start with.
  • GameLength - The total game length in milliseconds.
  • EndTime - The epoch time, in milliseconds at which this game will end.
  • GameStatus - A string that will have value "RUNNING" if the game is in progress or a reason the game has ended otherwise.
  • GameId - An integer representing the unique game id for the current game.
  • OpponentId - A string containing the name of your opponent.

Performing a trade

To submit a trade you must specify the currency you are transferring from, the currency you are transferring too and the amount. The amount is in the source currency e.g. if you perform a trade from GBP to USD of 10 your GBP balance will be reduced by 10 and your USD amount will increase dependent on the exchange rate.

return {"From":"GBP","To":"USD","Amount":10}

One important factor to take into consideration is the exchange rate used is taken at the point the trade is made, this could mean it is different from the price quoted in the ExchangeList.

Jargon

  • GBP - Is the currency abbreviation for the British pound.
  • USD - Is the currency abbreviation for the United States dollar.
  • EUR - Is the currency abbreviation for the European Union Euro.
  • Epoch time - The number of seconds (or in our case milliseconds) that have elapsed since January 1 1970 00:00 UTC.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License