Muscle Up Those Averages (substitute article for AIQ)

 

Original article by Ajay Pankhania
AIQ Code by Richard Denning

The code for John Ehlers’ article is not provided for AIQ. Instead I substituted an article from the September 2013 Stocks and Commodities issue by Ajay Pankhania, “Muscle Up Those Averages”.

I thought this basic code might be useful to beginning AIQ Expert Design Studio users as it illustrates how to code multiple versions of the simple and the exponential moving averages as well as the MACD indicator. Also the simple moving average crossover system and the MACD crossover systems are coded.

EDS Code:

!MUSCLE UP THOSE AVERAGES
!Author: Ajay Pankhania, TASC Sept 2013
!Coded by: Richard Denning 11/10/2013
!www.TradersEdgeSystems.com

!INPUTS:
price is [close].
smaLen1 is 50.
smaLen2 is 200.
emaLen1 is 12.
emaLen2 is 26.
emaLen3 is 9.

!CODE FOR SIMPLE MOVING AVERAGE OF PRICE:
SMA1 is simpleavg(price,smaLen1).
SMA2 is simpleavg(price,smaLen2).

!CODE FOR CROSSOVER SYSTEM:
BuySMA if SMA1 > SMA2 and valrule(SMA1 < SMA2,1).
SellSMA if SMA1 < SMA2 and valrule(SMA1 > SMA2,1).

!CODE FOR EXPONENTIAL MOVING AVERAGES (FOR MACD):
EMA1 is expavg(price,emaLen1).
EMA2 is expavg(price,emaLen2).

!CODE FOR MACD:
Fast is EMA1 – EMA2.
Signal is expavg(Fast,emaLen3).

!CODE FOR MACD SYSTEM:
BuyMACD if Fast > Signal and valrule(Fast < Signal,1).
SellMACD if Fast < Signal and valrule(Fast > Signal,1).

Jay’s Simple Momentum Sector Fund System

If there is one is universally true statement that I can make about trading systems in general and in specific, it is this – they sure are fun when they work.

When I first started trading – back in what I longingly refer to as the “Hair Era” in my life – I figured that I would be a “gut” trader – i.e., I was determined to rely on my keen instincts and intuitive reasoning to decide when to buy and sell based on current market conditions.

That was not fun.  After continually getting sucked into the swirling vortex of emotion – not to mention the abject fear associated with seeing  your money disappear – I found that I was getting the, um, back of my front so to speak, burned so many times that I was having difficulty, um, sitting down, so to speak.

Eventually I evolved into a systematic trader.  Now I am able to sit down much more often.  A few strategies that I have developed over the years have stood the test of time and become something of “bread and butter” strategies.  And they sure are fun when they work.  To wit….

Jay’s Pure Momentum System

In 2001, I published an article in “Technical Analysis of Stocks and Commodities” magazine titled “Trade Sector Funds with Pure Momentum”, which detailed one specific and simple trading method.  While in fact this is only one of many sector trading systems that I have developed over the years – and not necessarily the best one – it remains one of my favorites.  Probably because it is just so gosh darn simple.  When I was young my Momma told me to be a simple kind of man (or was it a Freebird she told me to be?).  Well, in any event, here are the “simple kind of rules” using Fidelity Select Sector funds:

– After the close of the last trading day of the month identify the five Fidelity Select Sector funds that have the largest gain over the previous 240 trading days.

– For this system, ignore Select Gold (ticker FSAGX).  If FSAGX appears in the top 5 funds then skip it and include the 6th highest rated funds.

– If fewer than five funds showed a gain over the previous 240 trading days, then hold cash in that portion of the portfolio (i.e., if only 3 funds showed a gain, then 60% of the portfolio would be in those funds and 40% of the portfolio would be in cash).

– If you sell more than one fund at the end of a month, then rebalance the proceeds in the new funds being purchased (example, you are selling Funds A and B and buying Funds C and D.  You have $12,000 in Fund A and $10,000 in Fund B.  Split the difference and put $11,000 each into funds C and D).

And that’s all there is to it.

The Results
Figure 1 displays the annual results of this method. jotm20140106-01

Figure 1 – Jay’s Pure Momentum Annual Results

Figure 2 displays the current portfolio.
jotm20140106-02

Figure 2 – Jay’s Pure Momentum Current Portfolio

My opinion as to why this system has performed well over the years is, well – what else – simple.  The effects of a positive change in the fundamentals for a given industry or sector typically take a long time to play out.  Thus, by finding the sectors that are performing well you very often find the sectors that are most likely to continue to perform well for a while.

jotm20140106-03 Figure 3 – 12/31/13 Test (Courtesy: AIQ TradingExpert) 
 JOTM20140106-04
Figure 4 – Several Current Sector Fund Holdings (Courtesy: AIQ TradingExpert)

Summary

Obviously 2013 was a banner year for this system.  There is nothing like a rip roaring bull market to help things along.  A couple of caveats:

*First off, sometimes people new to momentum investing will look at the charts in Figure 4 and say “Whoa, these things have already rallied sharply, I’m not jumping into those.”  That’s something you’ll have to get over to use this system.

*Secondly, while the long-term yearly numbers look pretty good, there was about a 45% drawdown along the way in 2008.  So it is not for the faint of heart.

*One other danger is that some people see +48.8% for the year in 2013  and get it in their head that this will occur again often.  History suggests otherwise. 

Still, an average annual return of +20.7% since 1990 (versus +8.9% for the S&P 500) isn’t bad – especially for a “Simple Kind of System.”

Best of Good Fortune in 2014.
 
Jay Kaeppel

Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiq.com) client
 
Jay has published four books on futures, option and stock trading. He was Head Trader for a CTA from 1995 through 2003. As a computer programmer, he co-developed trading software that was voted “Best Option Trading System” six consecutive years by readers of Technical Analysis of Stocks and Commodities magazine. A featured speaker and instructor at live and on-line trading seminars, he has authored over 30 articles in Technical Analysis of Stocks and Commodities magazine, Active Trader magazine, Futures & Options magazine and on-line at www.Investopedia.com.

Jay’s Simple Momentum Sector Fund System

If there is one is universally true statement that I can make about trading systems in general and in specific, it is this – they sure are fun when they work.

When I first started trading – back in what I longingly refer to as the “Hair Era” in my life – I figured that I would be a “gut” trader – i.e., I was determined to rely on my keen instincts and intuitive reasoning to decide when to buy and sell based on current market conditions.

That was not fun.  After continually getting sucked into the swirling vortex of emotion – not to mention the abject fear associated with seeing  your money disappear – I found that I was getting the, um, back of my front so to speak, burned so many times that I was having difficulty, um, sitting down, so to speak.

Eventually I evolved into a systematic trader.  Now I am able to sit down much more often.  A few strategies that I have developed over the years have stood the test of time and become something of “bread and butter” strategies.  And they sure are fun when they work.  To wit….

Jay’s Pure Momentum System

In 2001, I published an article in “Technical Analysis of Stocks and Commodities” magazine titled “Trade Sector Funds with Pure Momentum”, which detailed one specific and simple trading method.  While in fact this is only one of many sector trading systems that I have developed over the years – and not necessarily the best one – it remains one of my favorites.  Probably because it is just so gosh darn simple.  When I was young my Momma told me to be a simple kind of man (or was it a Freebird she told me to be?).  Well, in any event, here are the “simple kind of rules” using Fidelity Select Sector funds:

– After the close of the last trading day of the month identify the five Fidelity Select Sector funds that have the largest gain over the previous 240 trading days.

– For this system, ignore Select Gold (ticker FSAGX).  If FSAGX appears in the top 5 funds then skip it and include the 6th highest rated funds.

– If fewer than five funds showed a gain over the previous 240 trading days, then hold cash in that portion of the portfolio (i.e., if only 3 funds showed a gain, then 60% of the portfolio would be in those funds and 40% of the portfolio would be in cash).

– If you sell more than one fund at the end of a month, then rebalance the proceeds in the new funds being purchased (example, you are selling Funds A and B and buying Funds C and D.  You have $12,000 in Fund A and $10,000 in Fund B.  Split the difference and put $11,000 each into funds C and D).

And that’s all there is to it.

The Results
Figure 1 displays the annual results of this method. jotm20140106-01

Figure 1 – Jay’s Pure Momentum Annual Results

Figure 2 displays the current portfolio.
jotm20140106-02

Figure 2 – Jay’s Pure Momentum Current Portfolio

My opinion as to why this system has performed well over the years is, well – what else – simple.  The effects of a positive change in the fundamentals for a given industry or sector typically take a long time to play out.  Thus, by finding the sectors that are performing well you very often find the sectors that are most likely to continue to perform well for a while.

jotm20140106-03 Figure 3 – 12/31/13 Test (Courtesy: AIQ TradingExpert) 
 JOTM20140106-04
Figure 4 – Several Current Sector Fund Holdings (Courtesy: AIQ TradingExpert)

Summary

Obviously 2013 was a banner year for this system.  There is nothing like a rip roaring bull market to help things along.  A couple of caveats:

*First off, sometimes people new to momentum investing will look at the charts in Figure 4 and say “Whoa, these things have already rallied sharply, I’m not jumping into those.”  That’s something you’ll have to get over to use this system.

*Secondly, while the long-term yearly numbers look pretty good, there was about a 45% drawdown along the way in 2008.  So it is not for the faint of heart.

*One other danger is that some people see +48.8% for the year in 2013  and get it in their head that this will occur again often.  History suggests otherwise. 

Still, an average annual return of +20.7% since 1990 (versus +8.9% for the S&P 500) isn’t bad – especially for a “Simple Kind of System.”

Best of Good Fortune in 2014.
 
Jay Kaeppel

Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiq.com) client
 
Jay has published four books on futures, option and stock trading. He was Head Trader for a CTA from 1995 through 2003. As a computer programmer, he co-developed trading software that was voted “Best Option Trading System” six consecutive years by readers of Technical Analysis of Stocks and Commodities magazine. A featured speaker and instructor at live and on-line trading seminars, he has authored over 30 articles in Technical Analysis of Stocks and Commodities magazine, Active Trader magazine, Futures & Options magazine and on-line at www.Investopedia.com.

January blues for Overstock.com

I usually run a seasonal analysis at the beginning of the trading month to look for consistent seasonal behavior in stocks. I also run this same analysis for the Santa Claus rally and other notable seasonal times.

To be brief. I look at the remainder of the January’s trading for my database of stocks. I look back 8 years to see if there are any stocks that consistent trade the same way during the analysis period for each of the 8 years. I compare to the SPY for the same period, so I can be sure there’s little or no market bias (SPY average for this test period was -1.07%)

For the remainder of January, only one stock made it to the list on the negative side. This stock was down for the remainder of January for each of the last 8 years. The stock is Overstock.com [OSTK].

Here are the results

OSTK return for the remainder of January

Jan-13 -10.28
Jan-12 -13.65
Jan-11 -7.05
Jan-10 -10.99
Jan-09 -0.18
Jan-08 -30.93
Jan-07 -1.22
Jan-06 -14.13

avg -11.16

I’m always cautious when there are extreme figures in one or two years, as these distort the average. The median for OSTK though is roughly -10% so that still makes it attractive to me. Of course there are no guarantees but so far January 2014 has started as a loser for OSTK

January blues for Overstock.com

I usually run a seasonal analysis at the beginning of the trading month to look for consistent seasonal behavior in stocks. I also run this same analysis for the Santa Claus rally and other notable seasonal times.

To be brief. I look at the remainder of the January’s trading for my database of stocks. I look back 8 years to see if there are any stocks that consistent trade the same way during the analysis period for each of the 8 years. I compare to the SPY for the same period, so I can be sure there’s little or no market bias (SPY average for this test period was -1.07%)

For the remainder of January, only one stock made it to the list on the negative side. This stock was down for the remainder of January for each of the last 8 years. The stock is Overstock.com [OSTK].

Here are the results

OSTK return for the remainder of January

Jan-13 -10.28
Jan-12 -13.65
Jan-11 -7.05
Jan-10 -10.99
Jan-09 -0.18
Jan-08 -30.93
Jan-07 -1.22
Jan-06 -14.13

avg -11.16

I’m always cautious when there are extreme figures in one or two years, as these distort the average. The median for OSTK though is roughly -10% so that still makes it attractive to me. Of course there are no guarantees but so far January 2014 has started as a loser for OSTK

en_GBEnglish
en_GBEnglish