# UNSW-algothon25 **Repository Path**: knightmaremoon/UNSW ## Basic Information - **Project Name**: UNSW-algothon25 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-29 - **Last Updated**: 2025-06-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Brief Make the best trading algorithm! - GENERAL ROUND SUBMISSION IS ON 14/07/2025 --- ## Objective Develop a trading strategy algorithm to perform optimally given certain metrics. ## How to Get Started 1. Assess provided price data from our simulated trading universe. 2. Build a predictive model. 3. Back-test the predictive model across given price data. 4. Evaluate your algorithmic strategy. 5. Hope for the best (just kidding!). 6. Consider factors such as optimisation and risk analysis. Topics that may be explored include: - Optimising for trade frequency. - Projections for worst-case scenarios and methods to mitigate this. - Considering risk factors, and techniques to minimise risk. --- ## **
Case Brief
** ## Task Implement a function _getMyPosition()_ which - Takes as input a NumPy array of the shape _nInst_ x _nt_. - nInst = 50 is the number of instruments. - nt is the number of days for which the prices have been provided. - Returns a vector of desired positions. - i.e. This function returns a NumPy vector of integers. This integer denotes your daily position per instrument in the universe. With 50 instruments, we can expect this function to return 50 integers each time it is called. ## Data All required data has been generated by us, and is available in the Github repo in the top right corner of this page. We'd recommend cloning this repo to use a base for your algorithm development, and to make it easier for submission. - Our simulated trading universe consists of several years of daily price data, spanning 50 instruments. - The instruments are numbered from 0 to 49, and days go chronologically from 0 onwards such that p[inst, t] indicates the price of the instrument _inst_ on day _t_. - The price data file contains a NumPy array of the shape _nInst x nt._ - _nInst_ = number of instruments, _nt_ = number of days. - There will be an interim leaderboard update. This round is optional and failure will not result in elimination from the competition. - Teams will then receive price data and results from the leaderboard evaluation. - Preliminary round algorithms will be assessed on the next set of data. - Successful teams will then receive price data and results from preliminary evaluation. - Final round algorithms will be assessed on the final set of data. ## The Algorithm ### Format Algorithms must be contained in a file titled _main.py._ - This file must contain a function _getMyPosition()._ - _getMyPosition()_ must take in the daily price data, and output a vector of integer positions - the numbers of shares desired for each stock as the total final position after the last day. - _getMyPosition()_ must be in the global scope of the file called _main.py_ and have the appropriate signature. - The function will be called once a day, with the entire price history up to and including that day. For example, on day 200, your function should take as input an array of 50 inst x 200 days. - When _getMyPosition()_ is called, we will trade position differences from the previous position **at the most recent price, buying or selling.** - Consider the case where your last position was +30, and the new stock price is $20. If your new position is +50, _eval_ will register this as buying 20 **extra** shares at $20 a share. If your new position is -200, _eval_ will sell 230 shares also at $20 a share. ### **Accepted Packages** To ensure that code runs smoothly on the servers used for marking, we advise the following: - Use only standard packages and their respective versions from the Anaconda library. The best way to do this is to simply download Anaconda... - Where necessary, packages that are not included as part of Anaconda, or version numbers that are greater than those provided in Anaconda need to be declared in the submission form in the relevant section. We will attempt to import and run through all non-standard packages if declared. However, in the case that your code still does not run, your team will be **disqualified**. Similarly, if your submission does not declare a non-standard package or provide a brief description of its use, it will also be **disqualified**. ### **Considerations** - A commission rate of 5 bps (0.0005) can be assumed, meaning you will be charged commission equating 0.0005 \* _totalDollarVolumeTraded_. This will be deducted from your PL. - Positions can be long or short (i.e. the integer positions can be either positive or negative). - Teams are limited to a $10k position limit per stock, positive or negative. The $10k limit cannot be breached at the time of the trade. - This position limit may technically be exceeded in the case that exactly $10k worth of a stock is bought, and stock goes up the next day - this is fine. - However, given this occurs, the position must be slightly reduced to be no greater than $10k by the new day's price. - Note: _eval.py_ contains a function to clip positions to a maximum of $10k. This means that if the price is $10 and the algorithm returns a position of 1500 shares, _eval.py_ will assume a request of 1000 shares. ### **Assessment Benchmarks** The program we will use to evaluate your algorithm is provided in _eval.py_ The formula used will be: **mean(PL) - 0.1 \* StdDev(PL)** Your algorithms will be assessed against _unseen, future_ price data of the same 50 instruments within the provided simulated trading universe. We expect algorithms to have a maximum runtime of ~10min.