Algorithmic Trading Strategy: December 2014 Case Study

Overview

  • Algorithmic Trading Strategy

    Algorithmic Trading Strategy

    Full explanation of how to apply Dr. Roitman’s algorithmic trading strategy to your trading signals.

  • Day by day analysis of every trade you could have made: when to enter and when to exit.
  • Best trade GEL 18.76% in 7 Days | Worst trade GMCR -2.75% 3 days.
  • Portfolio simulation with a return of 12.75% in 1 month, at the same time the S&P500 dropped 1.7%.

Why is such a simple strategy so effective?

Every stock is affected by millions of underlying factors moving its price. For this reason creating one systematic trading strategy for an entire portfolio becomes nearly impossible. Trade decisions factors for one asset might be very different than for another. The entry and exit point rules might be different for two different assets. This makes one model for decision making nearly impossible.

The I Know First algorithm changes all that. It takes all the assets (stock, currencies, commodities, indexes etc.) and aggregate their millions of decision making elements to create a final “signal”.  Because this is an absolute number figure reflecting the adjustment for each and every asset, it can be used to create a unified mathematical model for trading. This model will work optimally for any asset that you trade under it, as long as your input variable is the signal.

After testing many possibilities a simple model was developed. The model works across all markets and includes just two variables: Signal Strength and Asset Closing Price. In order to test this system we have created a detailed algorithmic analysis, which can be found under Dr. Roitman’s analysis articles.  In his article his findings indicate the optimal trading point is when these rules hold true, and using it enables us to generate a return of over 12.7% in December 2014, a relatively bad trading month:

The rules for entry (buy):

  • Last close of the specific market is above the 5 days average.
  • Average of the last 5 days forecast signals is “up”.
    • If both rules are true, then buy.

The rules for selling short:

  • Last close is lower than the 5 days average.
  • Average of the last 5 days forecasts is “down
    • If both rules are true, then sell.

Exit conditions:

  • If either of the two entry rules is broken, then exit.
  • (Added in this analysis) Exit if the signal goes below 10.
Algorithmic Trading Strategy

Algorithmic Trading Strategy

The tests input data was taken from the “Top 10 Stock Picks + S&P500 forecast” to find out how one could manually locate optimal entry and exit points for any given trade using the algorithm. In order to identify an entry point a chart for each stock which had particularly strong signals is created, and continued to follow them on a daily basis. To the right is an example of the strongest 10 signals from the 2nd of December taken from the 1 month table.

Detailed trade sample: GEL

Algorithmic Trading Strategy

Algorithmic Trading Strategy

This example of the stock Genesis Energy, L.P. (NYSE:GEL) has 4 columns (chart on right). The first on the left is the dates in December 2014. The second column is the closing price of the asset on that given date. The third is a simple rule, if that date’s closing price is above the previous 5 day average return a 1, else return a 0. The right column is the signal given that morning before the market opened.  As can be seen from this example the two rules hold true on the 15th of January and allow us to enter a long position on GEL. The first is that last night’s closing price is above the previous 5 day average. The second is that the signal is strong that morning. As an investor you would hold the stock either until the morning of the 22nd (when the signal became very weak) or until the morning of the 26th (when last night’s closing price was below the moving average.

Algorithmic Trading Strategy

Algorithmic Trading Strategy

 

We could also represent this graphically by plotting the 5 day moving average and closing price of GEL. When the blue line (closing price) crosses above the red line (5 day SMA) it is indicative of an entry point (This point represents the 12th of December). By the same relationship, the exit (on the 24th of December) is illustrated by the crossover of the blue line back under the red line (at data point 17 on the graph)

At this point you should understand what the numbers on the table actually represent, and should not require the assistance of a graph to understand where the trend crossovers occur.   If you are still lost you can view a detailed video tutorial of this trade here. This means that with the date, closing prices, 5 day SMA and I Know First algorithmic signal you are able to create a full trading strategy. The table below represents duplicating this process for all assets with the strongest signals in December 2014. You will see that some trades made a loss, while others made a profit.

All long position trades

Algorithmic Trading Strategy

Algorithmic Trading Strategy

 

Algorithmic Trading Strategy

Algorithmic Trading Strategy

 

If you inspect the tables you will see that a total of 5 good and 2 bad trades were made when following these rules for a total of 7 long position trades.

When the rules are flipped, an entry and exit for the short position is created. You should enter when the price goes below the 5 day SMA, and the signal is negative. Thus, in the below tables the 5 day SMA check column returns a 1 when the price is below the 5 day SMA. You will also see that some trades were based on December’s signals but went into January. The stocks are still in a strong decline, and so the exit point  is still unclear.

All short position trades

Algorithmic Trading Strategy

Algorithmic Trading Strategy

Algorithmic Trading Strategy

Algorithmic Trading Strategy

 

Out of all short trades, three were unprofitable while 3 were profitable.

In total long and short trades 13 trades were made of which 8 were good and 5 bad.  Furthermore, the average return of ALL trades was 4.37%. Here are the entry and exit prices and yields for every single trade you should have made when you followed this strategy.

Summary of all trades

Algorithmic Trading Strategy

Algorithmic Trading Strategy

 

The top trade,GEL, returned 18.76% in just 7 days; moreover, the worst trade GMCR lost only 2.74%, and represents a relatively big loss for this strategy. In order to understand this further the table below splits the good and bad trade returns, thus our deviation is indicative of how the algorithm performs when it is right/wrong.

Average, count, and standard deviation from mean

8

This is perhaps the most indicative table. What is very staggering is the similarity between the deviation results here, and in Dr. Roitman’s algorithmic analysis of the same strategy. The algorithm makes good trades 61.5% of the time. What is truly important here is that good trades have an average return of 8% with a standard deviation of 5%, while bad trades have an average loss of -1.3% with a standard deviation of 1.2%. These numbers make it clear that your upside potential is significantly bigger than your downside risk. Even if good trades were made only 25% of the time, with this average and deviation figures you would still show a long run profit.

From here the only thing left to do is design an allocation model. My design for a very simple allocation model based on a $1,000,000 portfolio invests $200,000 in a trade with a signal under 100, and $250,000 with a signal over 100. The net result was a return of 12.76% based on the 13 trades mentioned above.  You can see here the dates in which the stocks were bought and sold. All prices are at that trading day’s opening price.

Sample portfolio model

9

During this period the S&P500 lost 1.8% (1st of December to the 6th of January). This strongly suggests the algorithm is still able to detect strong opportunities, regardless of the overall market trend fir the long and short positions.

Conclusion

After the case study the most clear conclusion is that the algorithm signal does not reflect the current market trend. This suggests that there are many ways of optimizing returns using various technical analysis strategies, the simplest of which is just following the 5 day moving average. By using the signals to detect were strong opportunities are it becomes possible to invest in very thought out opportunities. As this analysis demonstrated the downside risk will generally fall around 1.3%. In order to make a profit with a 50/50 ratio between good and bad trades the good trades would have to make 1.3% as well (ignoring trade costs). However, because 61.5% of the trades are good and the average return is at 8% it becomes evident that this strategy is a long term winner.

The papers analysis is based on the excel file downloadable here: DOWNLOAD ORIGINAL EXCEL FILE

We always recommend you check several non correlated sources for any trade decision. This article was written for December 2014; however, different months could yield different results (better and worse). I Know First Research is the analytic branch of I Know First, a financial start-up company that specializes in quantitatively predicting the stock market. This article was written by Daniel Hai. We did not receive compensation for this article, and we have no business relationship with any company whose stock is mentioned in this article.

Video Explanations