Definition of Systematic Trading Wikipedia defined Systematic trading (also known as mechanical trading) as a style of trading that defines trade goals, risk controls and rules to make investment and trading decisions in a methodical way. It essentially means trading based on a predefined set of rules. This set of rules governs (either fully or partially) the trade entry conditions, management and exits. They could be based on technical, fundamental or quantitative strategies or a mix of any. Hence systematic trading is not only meant for technical traders or quants as most commonly known. A fundamental investor could be systematic too. In addition, systematic trading could be executed manually as well as automatically as long as it follows a predefined set of rules.
Trend following in a systematic way Many strategy can be implemented in a systematic way as long as it can be quantified, which means it can be written down as a set of rules (possibly without any ambiguity). One such strategy is trend following. A significant part of my trading algorithm is based on trend following (Check out my post on trend following at https://diyquantfund.blogspot.com/2018/01/diyquant-trend-following-keep-winners.html). Trend following is a trading strategy that attempts to capture gains through the analysis of an asset's momentum in a particular direction. Trend following can be executed in a discretionary or systematic way. In the systematic approach, a set of rules are predefined to identify a trend, determine the entry point as well as the exit point.
A famous example of systematic trend following is the turtle breakout system. In 1983, legendary commodity traders Richard Dennis and William Eckhardt held the turtle experiment to prove that anyone could be taught to trade. The 'turtles' (referring to their disciples) were taught how to implement a trend-following strategy. A very specific set of rules were imparted to them and they were instructed to follow them closely in their trading. This is a characteristic of systematic trading.
Rules are NOT meant to be broken I attribute a great part of my success in trading so far to the fact that I was able to consistently follow a set of rules in making my trading decisions (Check out my results on the main page at https://diyquantfund.blogspot.com). This set of rules governs my entry, risk management and exit of trades irregardless of the current market condition. Even if it does not make sense at times. I do have people ridicule my trading decision once in a while. Take the recent case of market downturn in Feb 2018. On 21st Jan 2018, based on the result from the data analysed by my system, I made the call about the high risk of correction. I was met with skepticism as many still believed that the bull run will persist. Well you already know what happened next, I shall not repeat that again here but you can check out my prediction at https://diyquantfund.blogspot.com/2018/03/how-my-system-predicted-recent-downturn.html. These set of rules that my trading based upon has been back-tested and forward-tested to have an edge. Breaking the rules is as good as going back to square one, which is not having a system in the first place. To change the rules would require rigorous testing to determine its usefulness if possible in all kinds of market conditions.
More trades brings out the edge Systematic traders tend to trade more frequently. One of the reasons is because in order to 'realize' the edge in their strategy (assuming the strategy has an edge in the first place), they need to have many trades to reach a big enough sample size in order to properly measure the expected return. Profiting by just having a few trades are considered lucky win (or beginner's luck). On the other hand, discarding a system after having a losing streak of a few trades is not wise.
Easier to Automate As systematic trading rules can be very specific and quantifiable, it makes it easier to automate. Automating the execution of trading rules brings one's trading potential to an even greater level due to the ability of computers to process large amount of information and make objective decisions at lightning speed. I shall leave automatic trading to another future post.
From the above write-up, I hope you get an idea what is systematic trading all about. In the next post, I am going to share with you what are the advantages and disadvantages of systematic trading and how it has benefited me so far. One of the greatest benefits is it removes emotions from my trading decisions. Stay tuned. And do give me a in my Facebook page if you find this article helpful.
Since the system's entry into BNSO, it has made a fairly decent move upward. It consolidated during the bad market in February 2018 and broke out the consolidation on 23rd Feb to reach another consolidation box. Currently waiting for it to break out from this box at 4.11. While NASDAQ is turning bullish, hope it'll give it another boost.
Premium subscribers were informed of entry point on 12th Jan 2018. Currently sitting on a +35% gain.
Profile Bonso Electronics International Inc. designs, develops, produces and sells electronic sensor-based and wireless products for private label original equipment manufacturers (OEMs), original brand manufacturers (OBMs) and original design manufacturers (ODMs).
“Without data you’re just a person with an opinion.”
Dr W. Edwards Deming
I always have this hunch that whatever that is happening in the US indices will have a similar impact on Singapore's Straits Times Index (STI). If you have traded long enough, you will probably share the same observation. Take the recent US market downturn for example. S&P500 started to descend from its top on 28th Jan till 8th Feb 2018. At the same time STI logged a similar drop from a high on 24th Jan to the low on 9th Feb. S&P500 recorded a 10% plunge while STI had about 6% drop.
This led me to perform a simple analysis to determine how correlated are these two indices (I picked S&P500 but using Dow Jones should yield similar results). I analysed using 12 years of historical percentage price changes of both indices (start date is 3rd Jan 2005).
Before I continue further, let's understand two terminologies that are used to perform the analysis.
Correlation - Correlation is a statistical technique that can show whether and how strongly pairs of variables are related.
Correlation Coefficient - The main result of a correlation is called the correlation coefficient (or "r"). It ranges from -1.0 to +1.0. The closer r is to +1 or -1, the more closely the two variables are related. If r is close to 0, it means there is no relationship between the variables. If r is positive, it means that as one variable gets larger the other gets larger. If r is negative it means that as one gets larger, the other gets smaller (often called an "inverse" correlation).
The correlation coefficient can be calculated in Excel via the function CORREL.
PS: Correlation coefficient can be used to determine relationship for any two sets of data not just historical prices. It can be used to determine even common scenario like whether an ice cream stall's sales is related to the temperature of the day.
When I plotted all the 12 years of daily price changes onto a scatter plot, I got the chart below. The correlation coefficient is 0.58 which is considered moderately strong correlation.
Looking at the chart, you can see almost 2 linear clusters (1) and (3). Cluster (2) is more haphazard and suggests a weakly correlated region.
This led me to suspect there could be a period of time when the 2 indices were not that in tandem. I split the prices into 3 periods. From 2005 - 2012, 2013 - 2016 and 2017 - 2018. Here are their individual scatter plots and their corresponding correlation coefficient r.
2005 - 2012 r = 0.75
From 2005 to 2012, the correlation is strong. This period includes the 2008 financial crisis that toppled most major markets in the world. 2013 - 2016 r = -0.21
From 2013 to 2016, r is only -0.2 which means they are weakly correlated.
2017 - 2018
r = 0.94
From 2017 to 2018, r is 0.94 which means that both indices are very strongly correlated. It is as if STI is riding on the same bike with S&P (STI riding the pillion though).
If we eyeball a superimposed chart of the STI and S&P500, you can see where the 3 regions lie.
Indeed we can see that from 2013 - 2016, STI was trading sideway while S&P500 was rising, hence the weak correlation. The reason for the lack of correlation during this period is due to local and regional factors that impacted Singapore economy such as the bear market in China and productivity decline in Singapore due to labour crunch. Other than that, the 2 charts are quite in sync.
If I were to indicate the few somewhat major corrections over the past 12 years, you can see that both US and Singapore were impacted. I also include the recovery points in the chart below. Having this knowledge allows us to identify regions of weakness and buying opportunities in the Singapore market based on the situation in US.
Using 12 years of historical data, I have shown you that for a large part of the time period, S&P500 and STI are strongly correlated. This is especially so in the recent years. Hence be prepared that whatever happen to US will impact Singapore market in a similar fashion in the future.
Given now that my system already sent out a warning on the signification risk of correction in the US, investors in Singapore should also protect their portfolio and properly manage their risk if they have yet to do so.
My system predicted the recent market downturn that brought the Dow Jones from a high of 26616.71 on 26th Jan 2018 to the low of 23850.46 on 8th Feb 2018, a drop of 10.39%.
For the past few months I have been sharing my weekly market analysis free via my blog and other social medias. In those posts, I shared about what happened in the market for the current week and gave an analysis of my system's perspective on the market outlook for the following week. I also shared what my system is likely to do for the following week.
Since 20th Jan 2018, my system started to give warning signals that the market is overheated based on the analysis run on the data by the system and risked a downturn. It has also stopped loading stocks into the portfolio. Here is the list of posts that I made from 20th Jan to 9th Feb 2018.
11 days later, on 31st Jan 2018, Renaissance Technologies mentioned the same thing in an article on Bloomberg.
Even though I was met with skepticism when I posted these warnings, the prediction really came true. The downturn really happened.
This indicator, which is part of the system's risk management module, has protected the portfolio from disaster in February 2018. My portfolio outperformed the S&P500, posting a minute loss of 0.06% while S&P500 and Dow Jones posted losses of 3.89% and 4.28% respectively in February 2018.
What I learnt all these years as a quant is that, many times, a computer can do a much better job when it comes to being objective. We humans are prone to bias and tend to place more weight on what is current and what many others are saying.
Starting from 1st March 2018, the weekly analysis is only available to paid subscribers.
US market had a rather bad February. Dow Jones posted 2 days of 1000 points drop to a low of 23860 on 9th Feb. From the peak on 26th Jan to the trough on 9th Feb, it was a decline of a 2756 points, equivalent to a 10% drop, pushing the indices into correction territory for a moment. The key reason is rising interest rates with the benchmark 10 years Treasury yield reaching 2.95%.
My US portfolio outperformed the S&P500 this month, posting a minute loss of 0.06% while S&P500 and Dow Jones posted losses of 3.89% and 4.28% respectively.After the system posted several red flags since 20th Jan (check out this post about the system issuing several warnings), it has unloaded most of the stocks in the portfolio since then. This has protected the portfolio from the impending market drop. Hence the minute loss. The YTD return is -0.44%, slightly in the red.
Total return since inception (from June 2016) is maintaining at 73.31%.
2 of the 3 stocks currently in the portfolio are still maintaining a strong gain amidst the struggling market. Currently the portfolio is hoarding about 65% cash. There is still a potential risk of further downtrend in the market. For the moment, the system deems keeping more cash is king.
Total Return since inception (June 2016) +73.31% (34.12% for SPY) Total Return YTD -0.44%(1.79% for SPY) +45.85 (2017) +19.35% (2016)
We had a volatile February this year. STI dropped from 3533 at the close of January to a low of 3377 on 9th February and reversed upwards to end the month at 3517, posting a slight drop of 0.45%. The key reason is rising interest rates in the US with the benchmark 10 years Treasury yield reaching a high of 2.95% which ignited a sell-of in the US equity market to the correction level for a brief moment - a correlated SG market was not spared as well. My system's SG portfolio experienced a drop of 8.50% erasing all the gains in January to post a YTD time weighted return of -0.62%. It is due to the system unloading when it sees potential risks in the market downturn. Overall time weighted return since inception (from June 2016) is now standing at 85.32%.
Currently the portfolio is holding about 75% cash. It will deploy if the market recovery is confirmed. But so far, the marker does not look like it is recovering good enough. I will talk more about how the system identifies potential risks in the market in my upcoming posts. Meanwhile, cash is king.
Time Weighted Returns by year
Here is the outcome of the remaining 3 stocks that I shared freely back in 2017. * SELL T24 (Tuan Sing) +17.81% * SELL AXB (Yongnam) +23.91% * SELL SK7 (OUE Hospitality Trust) -1.18%
This is something I found disturbing yet familiar. Yesterday, out of curiosity, I superimposed the DJIA 30 years chart onto the #cryptocurrencies #Bitcoins BTC-USD 1 year chart. I scaled the 30 years DJIA chart to fit into the time frame of bitcoin and below is what I got. Surprisingly similar trend! A characteristic of a bubble.
I believe what happened to bitcoin (crash) is fuelled by greed and fear. After all the market is made up of humans so greed and fear will always be there (ok now we have robots). Hence, so too will bubbles, if left uncontrolled.
Here's what Alan Greenspan said:
Fear and euphoria are dominant forces, and fear is many multiples the size of euphoria. Bubbles go up very slowly as euphoria builds. Then fear hits, and it comes down very sharply. When I started to look at that, I was sort of intellectually shocked. Contagion is the critical phenomenon which causes the thing to fall apart.
As we know bitcoin began its downtrend from its highest point since mid Dec 2017. That represents a 45% drop so far. Before that, there was a melt-up starting from mid Nov 2017. What has taken bitcoin 1 year to unleash, Dow took 30 years because Dow is massive and hence slower. If we were to use this to infer at what stage we are in for the US economy, I say we are already at the melt-up stage and would probably continue for another 1-2 years before it all come crushing down (again).
Of course all these are merely conjectures on my part and you may think that it is utter nonsense but still I hope you enjoyed reading it. Anyway, nobody can perfectly predict what is going to happen. In the meantime enjoy the melt-up.
US indices posted a slight gain of 0.55% this week. This week, the system did not buy or sell any stocks. It is still hoarding about 60% cash but 2 of the 3 stocks in the portfolio are performing quite well.
PS: Just to assure everyone, this is just a post to share how one can handle losses effectively. I did not blew my account. Far from it as per below screenshot =) Same for US portfolio. My system already scaling down since 3 weeks ago.
Suffering losses is part and parcel of your trading journey. If you have not made any losses, it is either you have just started trading or you are just not trading (ok fine... you are investing, for long term, that's not the point of this post). Recently, the Dow Jones Industrial Average has just tumbled almost 2000 points equivalent to 7.5% as of this writing and many traders including me has suffered some losses, especially those investing in cryptocurrencies Bitcoins. It is not easy to deal with but you do not need to be miserable or feel bitter over it.
In this post, I will talk about how I manage losses. I understand not everybody's situation is the same but I hope it will benefit you in one way or the other.
Accept that losses are part and parcel of trading If you have traded long enough, you will see losses. it is inevitable. No one can make 100% profitable trades. Not even AI (as far as I know). If someone claims to have 100% profitable trades, it is probably a Ponzi scheme. For me, I just have to accept losses. As my strategy is based on trend following, a large part of my trades are losing trades and sometimes drawdown can be large. As long as it is still within my model, I just have to live with it.
Take it as a lesson learnt and do a strategy review if necessary The first time I experienced heavy losses was during many years ago when I just started trading US stocks. I was investing in a pharmaceutical company that gapped down 63% in a day. I was stopped out. That was a huge loss. It was an expensive lesson learnt, I reaccessed my strategy and move on. Now if possible my system won't buy pharmaceutical stocks. It is also good to keep a journal or some sort of report to record all the trades that you have done and the reasons behind buying/selling those trades so that you can review them or fine-tune your strategy in the future.
Shutdown your laptop and take a break Move away from the war zone. If it is affecting your emotions, avoid staring at the screen. Being emotional may cloud your judgement which could lead to bad trading decisions. Take a break, go for a coffee or do your favourite sport. Or my Facebook! Don't go back to your screen until you are in the right frame of mind.
Talk about it Well, don't bottle it up. There is nothing to be ashamed of. I'm not saying you should tell everyone your losses. Confide in your loved ones, Or post anonymously in social medias. Gather together like minded people and share with each others about your bad experiences. Pray or meditate.
In trading and investment, it is important that you are in the right frame of mind. Knowing how to control your emotions and employing a disciplined approach to trading will dramatically increase your odds for success. For me I have my automated trading system to do the job.