|Average 12mo % +/-||17.8||11.2|
|Median 12mo % +/-||14.9||15.0|
|Worst 12mo %||(11.9)||(43.2)|
|Max. Drawdown %||(17.8)||(48.4)|
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.”
- 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.
- Sell when the low is less than the lower band.
and is also shown here:
!Author: Vitali Apirine, TASC February 2017
!Coded by: Richard Denning 12/11/2016
xlen is 20.
numSD is 2.
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.
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.
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.
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).
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%.
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.
! ZERO IN ON THE MACD ! Author: Barbara Star, TASC May 2016 ! Coded by: Richard Denning 3/14/16 ! www.TradersEdgeSystems.com ! INPUTS: macd1 is 12. macd2 is 26. macdSig is 1. ! INDICATORS: emaST is expavg([Close],macd1). emaLT is expavg([Close],macd2). MACD is emaST - emaLT. ! MACD line SigMACD is expavg(MACD,macdSig). ! MACD Signal line MACDosc is MACD - SigMACD. ! MACD Oscillator HD if hasdatafor(macd2) = macd2. MACDhist is MACD. ! plot as historigram MACDblue if MACDhist > 0. ! use these rules to color MACDhist MACDred if MACDhist < 0. ! use these rules to color MACDhist MACDcolor is iff(MACDblue and HD,"Blue",iff(MACDred and HD,"Red","White")). !for report list List if 1. !ALERTS: EMA1 is expavg([close],34). EMA2 is expavg([close],55). xupEMA1 if [close] > EMA1 and valrule([close] < EMA1,1). xdnEMA1 if [close] < EMA1 and valrule([close] > EMA1,1). xupEMA2 if [close] > EMA2 and valrule([close] < EMA2,1). xdnEMA2 if [close] < EMA2 and valrule([close] > EMA2,1). xupMACD if MACDhist > 0 and valrule(MACDhist < 0,1). xdnMACD if MACDhist < 0 and valrule(MACDhist > 0,1). UpAlerts is iff(xupEMA1,"xupEMA1",iff(xupEMA2,"xupEMA2",iff(xupMACD,"xupMACD"," "))). DnAlerts is iff(xdnEMA1,"xdnEMA1",iff(xdnEMA2,"xdnEMA2",iff(xdnMACD,"xdnMACD"," "))).