Tech changes stock markets. In India, almost 40% of trades on NSE are done by algos. Yet, it is still considered to be in the nascent stage. More than 65% of the trades on US stock markets are automated. But what is algotrading?
Algorithmic trading is the use of algorithms to employ strategies for executing trades. Its benefits include faster execution time and reduced costs.
HFT, Algo trading, LFT are buzz words for automated trading strategies, which provide an edge to the trader and investor.
How do we take advantage of the technology to make money?
We start simple, by analyzing what we need to learn step by step, demystifying the concept and understanding what is necessary to make money from automated trading.
Step 1 – Learn a coding language
Step 2 – Develop a strategy
Step 3 – Backtest
Step 4 – Paper Trade
Step 5 – Capital – Test money
Step 6 – Forward test
Step 7- Repeat steps 2-6
Step 1 – Learn a Coding Language
Getting started is the first battle when you want to learn something new. It is also the first step into the world of technology powered investing and trading.
But which language to choose?
If you are a programmer already, you should use the language you prefer.
If, like me a couple of years back, you don’t know much about coding but are willing to learn:
Python, is where you should get started.
There are dozens of articles surmising why python is the right choice for financial trading and investing. Once your brain adapts to learning to code, in any language, picking up another language is easier.
Step 2 – Develop a strategy
If you invest regularly, chances are you already have a few things you look at before purchasing a stock/share. List them on a piece of paper, something like this:
1- PE ratio
2- PEG ratio
3- Dividend history
4- Industry growth rate
5- Price today vs Year high or all-time high
Now, put a number from 1-10 in front of the list depending on how much the particular factor matters to your decision on buying a stock.
You have your basic first strategy!
Step 3 – Backtest
Now that we have our coding skills and factors which are important for us to consider while decision to buy or sell a stock, its time to backtest. A backtest gives us a fair idea of how our factor based strategy would do if we invested based on it.
Backtests require stock data (prices, ratios etc.)
How to get price data?
There are a number of free resources for daily data such as Google Finance, Yahoo Finance, and Investing.com or you can use API calls to free resources such as alphavantage.co or Quandl.
How to get data from API in python? Click to Read
Once we have a good result from the backtest, we need to double check that there is no error in our backtest. Pick some random trades and check whether all parameters are correct for you to buy.
Step 4 – Paper Trading
While backtests give us an idea of whether our strategy is profitable or not in hindsight, paper trading gives us confidence of how it will perform going forward.
1 – Set up an execution script for your strategy: Read here
2- Give it a signal generator: Read here
3- Get the trades into a journal: Read here
Check whether trades are happening at the correct time, right price, etc.
Profit-Loss after a month or two should give us an idea about whether we want to test the strategy with real money!
Step 5&6 – Capital – Test money & Forward Testing
A lot of strategies perform well in backtests and paper trading but fail in real money scenarios. Therefore before committing any significant capital to a strategy we should do a test on relatively less capital.
Don’t run your system without supervision, don’t let it make trades automatically in the beginning. Execution scripts are almost always buggy in the beginning, see if the signal is constantly being generated, if it is then your system will buy the same thing over and over and use up the entire capital.
Read my list of potential problems, and some solutions. – Coming Soon!
Once all the problems are sorted, allocate the test capital to the system to auto-trade and see how the system performs. This is to be risk money and should not be anything which causes you financial hardship.
If it performs well move on to fine tuning or developing another strategy.
Happy Investing!