Algorithmic trading is an amazing opportunity for retail traders to branch their manual trading strategy into the realm of automation. However, if you have looked into automating your strategy and are looking for a road map this guide will help you navigate through this challenge. In this series of articles, I will document the trials and tribulations of building trading algorithms using different resources that I have found useful on my path. I believe walking through each step will give a better comprehensive insight into the everyday life of a trader’s transition into the quantitative space and open the doors for improvement.
There is a 5 step process a trader should take when analyzing the markets to find unique opportunities. Quantitative strategies have the same process broken into 5 different models that work in unison to produce an outcome. Python, in my opinion, is one of the best programming languages to use for algorithmic trading because of its open-source nature, and its powerful libraries to support high-speed calculations, flexibility to use APIs to access and retrieve data, as well as its object-oriented programming methods.
The 5 main components of a trading model[Black Box]:
Alpha-model: An Alpha strategy can be a rule-based strategy or statistical method that a trader would use to evaluate a financial instrument. For example, a theory-base model can be split into two categories: one being price and the other being fundamental. A price theory-based alpha model[techinal sentiment]would use “many different” indicators such as RSI[Relative Strength Index], MACD[Moving Average Convergence Divergence], mean reversion to understand the trend and volume of a given financial instrument. Whereas if a trader uses a fundamental approach, NLP[Natural Langue Processing] can be used to cipher through financial reportings [10k’s] to decide on how to properly invest in a company by classifying a company into three groups: value/yield, growth, and quality.
Risk Model: A risk model uses the exposure from the alpha model to establish an environment where the model sticks to a set of rules to produce consistent returns without emotional attachment. Techniques such as trailing stops and stop-loss can be calculated by the amount of money a trader is willing to allocate to see if their alpha model prediction is correct.
Transaction Cost Model: Evaluates how much a trader will pay in transaction cost given the fees, slippage and market impact of a strategy. There are four types of transaction cost models flat, linear, piece-wise-linear, and quadratic models. I will go into further detail of each in later writings as there is a vast amount of information about each one that will take away from the overall goal of this overview. However, if you do want to know more about each one here is a link I found useful in its description.
Portfolio Construction Model[PCM]: Think of a PCM model as a judge that takes into consideration the arguments of Alpha, Risk, and Transaction models then render a verdict based on the most probable target portfolio that will produce the most profitability. Two common approaches are ruled base models and portfolio optimizers. Both can be used to find a relationship between Alpha, Risk and Transaction models depending on the given situation. One method that can be used is a decision tree that will take the arguments, create a flow chart that will create combinations amongst the features to produce the best result.
Execution Model: Once the PCM has found the best target portfolio model a trade can be executed electronically or by a broker. Direct market access sends orders directly to the market, whereas a broker An execution algorithm would have to be created. The main approaches are aggressive or passive, depending on the goal of the trader that determination. To clarify an aggressive approach would be market orders, and a passive approach would use limit orders.
The main components to keep in mind are research, patience, and time when crossing over to the quantitative side of the house. A step at a time will yield far better results than not taking a step at all. The ability to ask as many questions as possible to fine-tune one’s understanding is your greatest asset. Remember its a marathon, there is no limit on what you will find on your path as a trader just have fun, embrace the pain as a friend, and let work be the return on investment.