Overview
Participating in the Morgan Stanley Coding Challenge, our task revolved around financial markets — specifically currency exchange between GBP and EUR. The EUR/GBP trading pair is a quotation on the current value of the Euro against the Pound.
We were grouped into teams of 5 and given £1,000,000 in startup capital. Based on market predictions, we were to move our assets for the highest return while minimising losses, with final ranking determined by portfolio value at the close of the simulation.
Approach & Architecture
As this was an introductory project into financial trading bots, our team decided on the EMA (Exponential Moving Average) trading strategy. EMA assigns greater weight to the most recent price data, making it more responsive to recent market moves than a simple moving average.
By using a short-term EMA (5 periods) and a long-term EMA (20 periods), the crossing of these two graphs triggered a trade signal within the program to buy or sell.
Risk and Reward Management
The bot incorporated a risk management system by adjusting trade size based on a fixed risk percentage and a reward ratio of 2:1. This meant that our take profit was set at twice the distance of the stop-loss.
Development & Learning
Given that teams were randomly assigned, it was important to first assess each member’s strengths to better distribute the workload. We ended up with a 3-2 split:
- 3 members working on developing the trading strategy
- 2 members working on API calls — GETting current market data from the simulation, and POSTing buy/sell orders based on the strategy output
My role was programming the trading strategy based on research into the EMA approach conducted by one of my sub-team members. This required accurately interpreting the workings of the strategy into code and creating signals for when the API should buy or sell based on previous price data.
