Category Archives: trading strategy

Exponential Standard Deviation Bands

The AIQ code based on Vitali Apirine’s article in the 2017 issue of Stocks & Commodities magazine, “Exponential Standard Deviation Bands”

Editor note: “Author Vitali Apirine presented a method intended to help traders see volatility while a stock is trending. These bands, while similar to Bollinger Bands, are calculated using exponential moving averages rather than simple moving averages. Like Bollinger Bands, they widen when volatility increases and narrow as volatility decreases. He suggests that the indicator can be used as a confirming indication along with other indicators such as the ADX. Here’s an AIQ Chart with the Upper, Lower and Middle Exponential SD added as custom indicators.”

 

 

To compare the exponential bands to Bollinger Bands, I created a trend-following trading system that trades long only according to the following rules:
  1. Buy when there is an uptrend and the close crosses over the upper band. An uptrend is in place when the middle band is higher than it was one bar ago.
  2. Sell when the low is less than the lower band.
Figure 8 shows the summary test results for taking all signals from the Bollinger Band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016. Figure 9 shows the summary test results for taking all signals from the exponential band system on NASDAQ 100 stocks over the same period. The exponential band system improved the average profit per trade while reducing the total number of trades.

Sample Chart

FIGURE 8: AIQ. Here are summary test results for taking all signals from the Bollinger Band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016.

Sample Chart

FIGURE 9: AIQ. Here are summary test results for taking all signals from the exponential band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016.
The EDS file can be downloaded from http://aiqsystems.com/EDS/Exponential_Standard_Deviation_Bands.EDS 
and is also shown here:
!Exponential Standard Deviation Bands
!Author: Vitali Apirine, TASC February 2017
!Coded by: Richard Denning 12/11/2016
!www.TradersEdgeSystems.com!INPUT:
xlen is 20.
numSD is 2.

!INDICATOR CODE:
ExpAvg is expavg([close],xlen).
Dev is [close] – ExpAvg.
DevSqr is Dev*Dev.
SumSqr is sum(DevSqr,xlen).
AvgSumSqr is SumSqr / xlen.
ExpSD is sqrt(AvgSumSqr).

!UPPER EXPONENTIAL SD BAND:
UpExpSD is ExpAvg + numSD*ExpSD.  !PLOT ON CHART

!LOWER EXPONENTIAL SD BAND:
DnExpSD is ExpAvg – numSD*ExpSD.   !PLOT ON CHART

!MIDDLE EXPONENTIAL SD BAND:
MidExpSD is ExpAvg.

!BOLLINGER BANDS FOR COMPARISON:
DnBB is [Lower BB].  !Lower Bollinger Band
UpBB is [Upper BB].  !Upper Bollinger Band
MidBB is simpleavg([close],xlen). !Middle Bollinger Band
!REPORT RULE TO DISPLAY VALUES:
ShowValures if 1.

!TRADING SYSTEM USING EXPPONENTIAL SD BANDS:
UpTrend if MidExpSD > valresult(MidExpSD,1).
BreakUp if [close] > UpExpSD.
BuyExpSD if UpTrend and BreakUp and valrule(Breakup=0,1).
ExitExpSD if [Low] < DnExpSD.  ! or UpTrend=0.

!TRADING SYSTEM USING BOLLINGER BANDS:
UpTrendBB if MidBB > valresult(MidBB,1).
BreakUpBB if [close] > UpBB.
BuyBB if UpTrendBB and BreakUpBB and valrule(BreakupBB=0,1).
ExitBB if [Low] < DnBB.  ! or UpTrend=0.

—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems

Out With The Old (Part 1)

Before moving on to 2017 I want to revisit a couple of “old” ideas I wrote about recently.
One 9/23/16 I wrote this article detailing a very aggressive bond trading strategy.  The model detailed essentially combined two other models that I have used for a number of years – one a “timing” model, the other  a “seasonal” model.  If either model is bullish then ticker TMF (a triple leveraged long-term treasury bond fund) is held.
As shown in Figure 1, the first model turns:
*Bullish for Bonds when the 5-week moving average for ticker EWJ drops below the 30-week moving average for ticker EWJ
*Bearish for Bonds when the 5-week moving average for ticker EWJ rises above the 30-week moving average for ticker EWJ
1a
Figure 1 – Bond Bull and Bear signals using ticker EWJ (Courtesy AIQ TradingExpert)
The second model simply holds bonds during the last 5 trading days of each month
The rules for Jay’s Very Risky Bond Model (JVRBM) are as follows:
Bullish for TMF if:
*Ticker EWJ 5-week MA < Ticker EWJ 30-week MA, OR
*Today is one of the last 5 trading days of the month
Bearish for TMF if:
*EWJ 5-week MA > EWJ 30-week MA AND today IS NOT one of the last 5 trading days of the month
Figure 2 displays the growth of $1,000 invested in TMF if the bullish conditions above apply since 4/16/2009 (when TMF started trading).
1
Figure 2 – Growth  of $1,000 invested in ticker TMF when JVRBM is Bullish (4/16/2009-12/30/2016)
Figure 3 displays the growth of $1,000 invested in TMF is the bearish conditions above apply since 4/16/2009 (when TMF started trading).
2
Figure 3 – Growth  of $1,000 invested in ticker TMF when JVRBM is Bearish (4/16/2009-12/30/2016)
For the record:
*During the Bullish periods in 2016 ticker TMF gained +72%
*During the Bearish periods in 2016 ticker TMF lost -43%
Figure 4 displays the growth of  $1,000 invested in ticker TMF during the Bullish versus Bearish periods in 2016.
3
Figure 4 – Growth of $1,000 invested in TMF during Bullish versus Bearish periods (12/31/2015-12/31/2016)
All in all not a bad year (Just don’t forget high degree of risk).
Summary
Make no mistake, this is a trading method that entails a great deal of risk.  One can reasonably ask if a long position in a triple leveraged fund of any kind is really a good idea.
But, hey, the phrase “high risk, high reward” exists for a reason.
Jay Kaeppel

Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiqsystems.com) client. http://jayonthemarkets.com/

The Trend, the Trend, the Trend

In real estate, it’s “Location, Location, Location.” In the financial markets it’s “the Trend, the Trend, the Trend.”  There is a great deal of certainty about what will happen next in stocks, bonds and gold.  But the key to successfully navigating these turbulent times starts not with predicting the future but rather with identifying the current trend in the here and now and going from there.  So let’s take a look at, well, what else, the trends.

I have certain trend-following models that I follow to help me to determine which way to be leaning in the markets.  Like any trend-following method they are far from perfect (my stock market model for example, suffered not one but two significant whipsaws in the last year+).  But for me there is no expectation that they will be perfect.  The only goal is to catch most of the upside during major bull markets, and miss much of the downside during major bear markets.
Stocks
For stocks I look at the 10-month and 21-month moving averages for the S&P 500 Index and use the following rules:
*A sell signal occurs when the S&P 500 closes 2 consecutive months below its 21-month moving average AND is also below its 10-month moving average
*Following a sell signal a new buy signal occurs when the S&P 500 registers a monthly close above its 10-month moving average
stock-trend
Figure 1 – Stock Market trend-following signals (Courtesy AIQ TradingExpert)
This method avoided much of the 1973-1974, 2000-2002 and 2008 bear market destruction.  That’s the good news.  The bad news is that it sold at the end of September 2015 and at the end of February 2016 – both just prior to powerful upside reversals (like I said, trend-following models ain’t perfect).
The most recent signal was a buy signal on 3/31/2016.  
So the trend for stocks is presently BULLISH
Bonds
I have written several posts about this in the past.  My favorite bond timing indicator is Japanese stocks.  No seriously.  They have a string tendency to trade inversely to the 30-yr US t-bond.  I track ticker EWJ and watch the 5-week and 30-week moving averages.  Because Japanese stocks and t-bonds trade inversely I use the following rules:
*A buy signal for bonds occurs when the 5-week moving average for EWJ drops below the 30-week moving average for EWJ
*A sell signal for bonds occurs when the 5-week moving average for EWJ rises above the 30-week moving average for EWJ
The most recent signal was a sell signal for t-bonds on 6/10/2016
So the trend for bonds is presently BEARISH
bond-trend
Figure 2 – Bond trend-following signals(Courtesy AIQ TradingExpert)
Gold
For gold I use two moving averages on a weekly chart for something I refer to as Jay’s Anti-Gold Index.  Rather than go into a long explanation I will link to the original article on the topic and offer a short explanation.  In AIQ TradingExpert I created a ticker comprised of 4 other tickers (GLL, RYSDX, SPX and YCS) which all trade in a negatively correlated manner to the price of gold (er, usually).
One moving average I call the “FrontWeighted36DayMA” (“FrontWeightedMA” for short.  The calculations are based on someone else’s work – unfortunately I cannot recall the person’s name so cannot give proper credit.  Hopefully Karma will work and somewhere that person will  Have a Nice Day without really knowing why.  The calculations are a bit long-winded so the AIQ TradingExpert code appears at the end of this article.
The other is the 55-week exponential moving average.
(CAVEAT: Because some of these tickers did not exist until 2006 trading signals began on 12/31/1996, so yes, it is by my standards a relatively short test period for a long -term moving average method.  To put it another way, don’t bet the ranch on  gold basedon this one indicator)
The trading rules are as follows:
*When the FrontWeightedMA closes a week BELOW the 55-week MA then a BUY signal for gold occurs.
*When the FrontWeightedMA closes a week ABOVE the 55-week MA then a BUY signal for gold occurs.
gold-signals-3
Figure 3 – Gold Trading Signals (Courtesy AIQ TradingExpert)
The most recent signal was a buy signal on 3/18/16.
So the trend for gold is presently BULLISH.
Summary
These indicators represent “my opinion as to where the markets are headed next” (because the truth is I don’t know).  There are objective, mechanical measures of where things stand today.  Nothing more, nothing less.
Also, none these indicators falls into the “World Beater” or “You Can’t Lose in Investing” categories.  But then again they are not really designed to (BTW if you do posses methods that do fit into either of the aforementioned categories, I would love to hear from you – off the record, of course).  What they do achieve is to offer a decent frame of reference during times of doubt.
And that is one of the most powerful tools any investor can possess.
So in sum, the current trend (at least according to what you’ve seen here) for stocks and gold is bullish and the current trend for bonds is bearish.
How long any of these trends will remain in place is anyone’s guess.  So enjoy them while they last.

Jay Kaeppel

Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiqsystems.com) client

The 3 Days of the Month to Avoid

Some days are just better than others – am I right or am I right?  As a corollary, some days are worse than others.  Wouldn’t it be nice to know in advance which days were going to be which?

Well, when it comes to the stock market, maybe you can.

The 3 Days to Miss

For our purposes we will refer to the very last trading day of the month as TDM -1.  The day before that will be TDM -2, the one before that TDM -3, etc.  Now let’s focus specifically on TDMs -7, -6 and -5.

Let’s now assume that we will buy and hold the Dow Jones Industrials Average every day of every month EXCEPT for those three days – i.e., we will sell at the close of TDM -8 every single month and buy back in 3 days later.  We will refer to this as Jay’s -765 Method.  Granted some may not be comfortable trading this often, but before dismissing the idea please consider the results.

Figure 1 displays the growth of $1,000 invested in the Dow as described above versus the growth of $1,000 from buying and holding the Dow.

*The starting date for this test is 12/1/1933.
*For this test no interest is assumed on the 3 days a month spent out of the market.
1

Figure 1 – Growth of $1,000 invested in Dow Industrials during all days EXCEPT TDM -7,TDM -6 and TDM -5 (blue line) versus $1,000 invested in Dow Industrials using buy-and-hold (red line); 12/1/1933-8/15/2016

For the record:
*Jay’s -765 Method gained +94,190%
*The Dow buy-and-hold gained +18,745%

While these results are compelling, the real “Wow” comes from looking at would have happened if you had been long the Dow ONLY on TDMs -7,-6 and -5 every month since 1933.  These results appear in Figure 2 (but you’d better brace yourself before taking a glance).
2

Figure 2 – Growth of $1,000 invested in the Dow ONLY on the 7th to last, 6th to last and 5th to last trading days of every month since 12/1/1933

The net result is an almost unrelenting 83 year decline of -80%.

Summary

I would guess that some readers would like me to offer a detailed and logical reason as to why this works.  Unfortunately, I will have to go with my stock answer of “It beats me.”  Of course, as a proud graduate of “The School of Whatever Works” (Team Cheer: “Whatever!”) I am not as interested in the “Why” of things as I am the “How Much.”

Sorry, it’s just my nature.

Jay Kaeppel
Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiqsystems.com) client

Hedging Risk Away with Ticker TZA

It pains me to say that I don’t know where the stock market is going next.  You would think that after being in the markets for so long and following a bunch of indicators and systems etc., that by now I would have developed some ability to divine what is coming next.
Alas, I have not.
But I do know three things:
*My trend-following stuff is bullish so I need to give the bullish case the benefit of the doubt (no matter how nervous or cynical I may be).
*Based on a variety of indicators the market is certainly getting overbought
*Based on the calendar, some caution may be in order
So, a thought today for those who might be wishing to hedge away some of their market risk.
Ticker TZA
Ticker TZA is not necessarily one of my favorites.  It is an ETF that tracks 3 times the inverse of the Russell 2000 small-cap index. In other words, if ticker RUT falls 1% today then TZA should rise 3%.  There are two primary concerns to keep in mind before considering buying shares of TZA are:
*The shares are extremely volatile
*The shares have experienced a serious downside bias – even when RUT is headed sideways (See Figure 1).
1
Figure 1 – Ticker TZA (black bars) versus Ticker RUT (Russell 2000) (Courtesy AIQ TradingExpert)
So if you are going to buy TZA you’d better pick your spots. As I discussed here we are entering an “interesting” time for the market.  So let’s explore the possibility of buying a call option on ticker TZA as a hedge against a potential market decline.
Call Option on TZA
Remember, TZA should increase in value if the Russell 2000 declines.  Therefore, a call option on TZA should also increase in value if the Russell 2000 declines.
As you can see in Figure 2, the “implied volatility” (which generally tells you whether there is a lot of time premium built into the price of the options for a given security) for options on TZA is near the low end of the historical range.  This tells us that there is relatively little time premium built into TZA options, therefore they are “cheap”.
2
Figure 2 – Implied option volatility for options on TA near the low end of the historical range (Courtesy www.OptionsAnalysis.com)
Next I ran the “Percent to Double” routine in www.OptionsAnalysis.com (see output in Figure 3.  The phrase “percent to double” tells us what percentage the underlying stock must rise in order for the call option to double in price.
3
Figure 3 – Percent to Double routine suggests buying Sep30 TZA call which will double in price if TZA rises 12.56% (i.e., if RUT declines by roughly -4.19%) (Courtesy www.OptionsAnalysis.com)
Figures 4 and 5 display the particulars and risk curves for buying 10 TZA Sep 30 calls.
4
Figure 4 – TZA Sep30 details (Courtesy www.OptionsAnalysis.com
5
Figure 5 – TZA Sep30 risk curves (Courtesy www.OptionsAnalysis.com)
A few things to note:
*The cost to buy 10 is $2,550.
*TZA is trading at $30.25/share.
*The breakeven price for this trade is $32.25 (if TZA is below $32.25 at expiration and we still hold this position then we will lose -$2,250)
*There are 50 days left until September expiration
*The trade has unlimited profit potential
Regarding potential, in Figure 6 we see that if TZA rallies back to its June low of $33.77 this trade will generate a profit of between $1,500 and $2,400 depending on how soon  that price is reached
6
Figure 6 – A potential 1st profit target for TZA hedge (Courtesy www.OptionsAnalysis.com)
Summary
Is this a good trade?  I can’t say for sure that it is.  In fact, the only way this trade makes money is if the broader market suffers a hit, so a good part of me would prefer to see this trade “not work out”.
But the point of all of this is simply to point out that it is possible to hedge against a significant market decline by buying call options on an inverse leveraged ETF.
Mr. Market, you take it from here.
Jay Kaeppel
Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro (http://www.aiqsystems.com) client