This is the fourth article written by Mario Cesolini for Unger Academy. Mario is a trader specialized in the conception, programming and development of trading systems, always looking for the perfect algorithm. The search for new strategies never stops. There are times when everything is hectic and times when everything goes in slow motion.


Discover Your Next Trading Step w/ this Test >>


In the previous post, we left off with a very interesting equity line, a much less interesting average trade and with the intention of applying “our” system to “other financial instruments”.

Question: what are these “other financial instruments”? The stocks that make up the SP500 index. The answer is dictated by the hypothesis that if our benchmark index is characterized by a bullish and meanreverting bias the stocks that compose it should (we have yet to prove) have a greater reactivity to the signals of the trading system than the index.

Moreover, since the SP500 is a weighted index and therefore representing an average (weighted by the capitalization of individual securities), the individual shares should (this is also a step that we have to demonstrate) have a greater reactivity to the signals of the trading system than the index.

Let’s continue. Let’s use an indicator that I really love to select the stocks on which to operate. We remember that we are retail traders (small investors) and that we need liquid and efficient markets.

We want to operate only on very liquid securities with a lot of interest. We will use a liquidity indicator (clearly, the denomination is improper) that calculates the average of the volumes of the last 3 months and multiplies it by the listing of the individual shares. For reasons dictated by the readability of the indicator, we will also divide the result obtained by 10,000,000.

Smaller numbers = greater readability.

In short, our indicator identifies those securities that have moved more dollars in the last 3 months.

We could have used the capitalization of the securities: the share value multiplied by the public or free float. In this case, however, we would have had difficulty finding the data relating to the float (i.e. the number of shares in circulation).

Our liquidity indicator works great for our purpose: it identifies liquid and interesting securities.

Let’s see which are the 10 most interesting stocks selected by our indicator on a random day.

The 10 most “liquid” shares of the SP500 index

In order to go forward we have to open a small parenthesis concerning the optimization of the system. So far, we have not yet talked about in sample and out sample. For readers who do not know, the in sample (is) period is the period considered to optimize the parameters of a trading system. The out-of-sample (oos) period is instead a new period in which the developer will see the system in action in an unknown period. This technique is used to avoid, or at least limit the so-called overfitting, that is the danger of over-optimizing the system’s input parameters to past data on which it is tested.

A robust system, which continues to perform when market conditions change, should also return interesting performances in the out of sample phase (it is very common to see a decay of the parameters of the trading system).

In our case, our objective is very ambitious: not only our out of sample will be represented by the quotations of different financial instruments (the shares) but we have also hypothesized (for the alleged greater reactivity of the shares) that our system can return better performance (in terms of average trade) than the original version.

Below is a summary report of the strategy (version 30-70) applied to 10 stocks, investing a capital of $ 10,000 for each trade.

Trading System on 10 US shares

I have good news and bad news.

The good news: all the profit factor values are greater than 1 and this is a strong indication of the robustness of the strategy. In the out of sample phase, the trading system behaved well but, as we will see, not well enough.

The bad news: contrary to our expectations, the average trade continues to be the weak point of the trading system. Our hypothesis that the stocks lend themselves better to this operation by returning more substantial average trade values clashed hard with the evidence of the facts.

Reality has proved to be different from our idea.

This happens very often during the study phase, it does not mean, however, that we should break down.

We will try to use a particular trend filter, borrowed from a Forex strategy: we want to operate only when the 100-period RSI is greater than the 200-period RSI. I should point out that the values 100 and 200 have not been optimized, I have simply used “round” numbers.

I want to be completely clear: from a purely technical point of view, this is a serious mistake. Developers with a very rigid approach may think that I am modifying the system in the out of sample phase.

I believe we can accept the change for two reasons:

  • the system proved to be robust: in its basic version it obtained positive profit factor values on all the securities analyzed;
  • we have not made a real change, we have not changed the logic, we have not optimized any input or made other substantial changes: it is always the same strategy that operates less because it is filtered by a trend indicator.

In the previous article, I wrote that the system would no longer be modified. In fact, I would have preferred not to touch the strategy. However, necessity required it and I had to dust off the old plan B.

Below is the same table with the results of the filtered system.

Comparison Ratio – Filtered Trading System

We observe that the average trade has improved in 7 cases out of 10, in some cases, for example, in AMD the system has proven to be much more performing. Most of the time the net profit has decreased, making a smaller number of transactions, this is normal. The average trade continues to not be as big as we would like.

What would have happened if we had traded all 10 strategies together?

Below are some analyzes extrapolated from the Multicharts Portfolio Manager, investing $10,000 per trade.

Portfolio analysis – 10 US shares

Testing your portfolio is important, especially for checking the drawdown phases. In fact, since all the underlying assets belong to the same index we must make sure that the systems do not go into difficulty at the same time. From this point of view, we like the table of monthly correlations between the systems’ equity lines: values close to 1 or -1 would have been very worrying. And instead we observe many values close to or almost at 0.

The results, though encouraging, are far from perfect. The absence of risk management (stop loss, take profit, trailing stop, …) is felt and discourages the use of this strategy, which, however, can represent a good basis for study and development for subsequent evolutions-improvements.

An unsolicited advice: we should negotiate better commissions with our brokers and, if we have to choose a new one, we pay the utmost attention to this item. There are brokers (I will not name them for obvious reasons) that ask for 1 dollar per transaction, regardless of the invested capital (2 dollars round-turn). Attention must be paid especially by traders with lower accounts for which the commissions have a higher percentage impact.

And finally, a consideration on the strategy we used. The RSI in its 2-period version has been the subject of many studies and in some countries such as the United States, it is one of the most popular indicators. If you are interested in examining the subject, the starting point is the book “Short-Term Trading Strategies That Work” by Larry Connors and Cesar Alvarez, a 2008 publication that has now entered the most popular trading works by far. Many other insights and contributions can be easily found on the web.

To the next post.


Discover Your Next Trading Step w/ this Test >>