Forex USD/CAD Machine Learning Assisted Trading
82.9% profitable trades over 222 trades. Not bad for a weekend project.
Since the post Forex USDCAD Price Predict Every 15 minutes a year ago, I’ve started experimenting with a new idea that started with a question.
Trading with predictions looks great on the test and validation dataset, but it does not work well in the real world. Since most of the machine learning based solutions require a level of predictability, the prediction models cannot comprehend unexpected events in politics, new regulations, and unexpected news. If so, how can I make profitable trades despite such unpredictable events?
If this is the right question, then I can define the problem, then I can (probably) solve it.
Benjamin Graham explained that “In the short run, a market is a voting machine, but in the long run, it is a weighing machine.” Implying that in the long run, the market assesses the substance of a company. I had a hypothesis that this can apply to currency. Since the currency value is based on thousands of assets, other currencies, and commodities, I might be able to estimate what the fair value of a currency is and therefore remove much of the noise in the market.
I’ve downloaded 220 asset data of different currencies, metal prices, index and commodities. From there, identified a set of features that impact the price of USD/CAD currency pair.
These features were then used to compute the estimation of the fair value of a currency using an ensemble of six different deep learning models.
The result: At the time of writing, 30% gain in 2018 and another 30% gain so far April 2019 with 82.9% profitable trades over 222 trades. And no, it was not on a practice account.
Here is how it works:
Below is the graph with USD/CAD rate in green, and the estimated fair value of CAD in yellow. Notice that the green line periodically diverges from the yellow line, then gravitates back to the yellow line. Hence, whenever there is a divergence over 30 pips between USD/CAD and the estimated fair value, I make a trade. After a few days, the green line will gravitate towards the orange line. Works for both long and short positions.
I’ve tested this over a year with a small cap, and I am happy with the P&L result.
Going forward:
Until now, I’ve made the system as an assistant tool to make trade recommendations. Which allowed me to make trades without spending too much time into it — Less than 30 minutes per week. Now that I have the trading data built up, it’d be interesting to make it completely automated (Reinforcement Learning can be interesting here). It would be a fun weekend project. Though it’d be a while until I create a working version. Just too damn busy these days :)
This post references an opinion and is for information purposes only. It is not intended to be investment advice. Seek a duly licensed professional for investment advice.