Recording of an hour-long session with Steve Hill, CEO of AIQ Systems. It’s one of the longest-running AI-based systems in the world. Like any AI it isn’t perfect. In this session, Steve covered leveraging these ratings for effective trading decisions. Includes an EDS file that scans for unusual rating patterns of 11-59, 16-56, and 76-5.
The importable AIQ EDS file based on Markos Katsanos’ article in the April issue of Stocks & Commodities, “Detecting High-Volume Breakouts,” can be obtained on request via email to info@TradersEdgeSystems.com.
Excerpt “Is there anything more satisfying for a trader than capturing a huge breakout? The usual practice for breakout entries is to simply buy new highs. This method, when used in isolation, will often result in false breakouts. It is, therefore, better to wait for volume confirmation before entering the trade, as high-volume breakouts usually last much longer. In this article, I will show you how to detect breakouts using only volume, sometimes even before price breaks out, by introducing a new volume breakout indicator. “
The code is also available here:
!Detecting High-Volume Breakouts !Author: Markos Katsanos, TASC April 2021 !Coded by: Richard Denning, 02/18/2021 !INPUTS: period is 30. smoLen is 3. vpnCrit is 10. maLen is 30. V is [volume].
!FORMULAS: MAVol is simpleavg(V,period). MAV is iff(MAVol>0,MAVol,1). Avg is ([High]+[Low]+[Close])/3. MF is Avg - valresult(Avg,1). ATR is simpleavg(max( [high]-[low],max(val([close],1)-[low],[high]-val([close],1))),period). MC is 0.1*ATR. VMP is iff(MF > MC, V, 0). VP is sum(VMP,period). VMN is iff(MF < -MC, V, 0). VN is sum(VMN,period). VPN is (expavg(((VP - VN) / MAV / period),smoLen))*100. MAVPN is simpleavg(VPN,maLen).
Code for the VPN indicator is set up in the AIQ code file. Figure 9 shows the indicator on a chart of Tesla Motors Inc (TSLA).
FIGURE 9: AIQ. The VPN indicator is shown on a chart of Tesla Motors Inc. (TSLA).
The importable AIQ EDS file based on Richard Poster’s article in February 2021 issue, of Stocks & Commodities “Trend Strength: Measuring The Duration Of A Trend,” Getting a good reading on trend strength is an important and useful metric to have when trading. Here, we introduce a new technique that makes use of a less common approach to measuring the strength of a trend… can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown here:
!Trend Strength: Measuring The Duratioin of A Trend !Author: Richard Poster, TASC Feb 2021 !Coded by: Richard Denning 12/12/2020 !INPUTS: TPRlen is 20. SMAlen is 5. ThrshFixed is 1.0. MULT is 10. C is [close]. _point is 0.01.
!FORMULAS: sma1 is simpleavg(C,SMAlen,0). sma2 is simpleavg(C,SMAlen,1). smadiff is (sma1 - sma2)/(MULT*_point). up if smadiff>ThrshFixed. dn if smadiff<-ThrshFixed. countP is countof(up,TPRlen). countM is countof(dn,TPRlen). tpr is abs(100*(countP-countM)/TPRlen). ListValues if 1.
Code for the TPR indicator is set up in the AIQ code file for stocks with point value equal to 0.01. Figure 7 shows the indicator on a chart of Apple Inc. (AAPL).
FIGURE 7: AIQ. The TPR indicator is shown on a chart of Apple Inc. (AAPL).
Relative strength has more information embedded within it than meets the eye. Here is a way to identify and compress several dimensions of relative strength into one single scalable value, the RS4r, which allows you to compare and then rank securities for robustness across timeframes and shifting market conditions…
The importable AIQ EDS file based on James Garofallou’s article in Stocks & Commodities magazine September 2020 issue, “The RS4r: Tracking Relative Strength In Four Dimensions,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also available here:
! The RS4r: Tracking Relative Strength in Four Dimensions
! Author: James Garofallou, PhD, TASC Sept 2020
! Coded by: Richard Denning, 7/18/2020
!INPUTS
C is [close].
len1 is 10.
len2 is 15.
NumIndx is 4.
BuyLvl is 80.
!FORMULAS
SPYc is TickerUDF("SPY",C). !SP500
QQQc is TickerUDF("QQQ",C). !NASDAQ100
MDYc is TickerUDF("MDY",C). !SP400
IWMc is TickerUDF("IWM",C). !Russel2000
RS1spy is C/SPYc.
RS1qqq is C/QQQc.
RS1mdy is C/MDYc.
RS1iwm is C/IWMc.
FastSPY is Expavg(RS1spy,len1).
MedSPY is Simpleavg(FastSPY,7).
SlowSPY is Simpleavg(FastSPY,15).
VSlowSPY is Simpleavg(SlowSPY,30).
FastQQQ is Expavg(RS1qqq,Len1).
MedQQQ is Simpleavg(FastQQQ,7).
SlowQQQ is Simpleavg(FastQQQ,15).
VSlowQQQ is Simpleavg(SlowQQQ,30).
FastMDY is Expavg(RS1mdy,Len1).
MedMDY is Simpleavg(FastMDY,7).
SlowMDY is Simpleavg(FastMDY,15).
VSlowMDY is Simpleavg(SlowMDY,30).
FastIWM is Expavg(RS1iwm,Len1).
MedIWM is Simpleavg(FastIWM,7).
SlowIWM is Simpleavg(FastIWM,15).
VSlowIWM is Simpleavg(SlowIWM,30).
Tier1spy is iff(FastSPY>=MedSPY and MedSPY>=SlowSPY and SlowSPY>=VslowSPY,10,0).
Tier1qqq is iff(FastQQQ>=MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ>=VslowQQQ,10,0).
Tier1mdy is iff(FastMDY>=MedMDY and MedMDY>=SlowMDY and SlowMDY>=VslowMDY,10,0).
Tier1iwm is iff(FastIWM>=MedIWM and MedIWM>=SlowIWM and SlowIWM>=VslowIWM,10,0).
Tier2spy is iff(FastSPY>=MedSPY and MedSPY>=SlowSPY and SlowSPY<VslowSPY,9,0).
Tier2qqq is iff(FastQQQ>=MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ<VslowQQQ,9,0).
Tier2mdy is iff(FastMDY>=MedMDY and MedMDY>=SlowMDY and SlowMDY<VslowMDY,9,0).
Tier2iwm is iff(FastIWM>=MedIWM and MedIWM>=SlowIWM and SlowIWM<VslowIWM,9,0).
Tier3spy is iff(FastSPY<MedSPY and MedSPY>=SlowSPY and SlowSPY>=VslowSPY,9,0).
Tier3qqq is iff(FastQQQ<MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ>=VslowQQQ,9,0).
Tier3mdy is iff(FastMDY<MedMDY and MedMDY>=SlowMDY and SlowMDY>=VslowMDY,9,0).
Tier3iwm is iff(FastIWM<MedIWM and MedIWM>=SlowIWM and SlowIWM>=VslowIWM,9,0).
Tier4spy is iff(FastSPY<MedSPY and MedSPY>=SlowSPY and SlowSPY<VslowSPY,5,0).
Tier4qqq is iff(FastQQQ<MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ<VslowQQQ,5,0).
Tier4mdy is iff(FastMDY<MedMDY and MedMDY>=SlowMDY and SlowMDY<VslowMDY,5,0).
Tier4iwm is iff(FastIWM<MedIWM and MedIWM>=SlowIWM and SlowIWM<VslowIWM,5,0).
RS2spy is Tier1spy + Tier2spy + Tier3spy + Tier4spy.
RS2qqq is Tier1qqq + Tier2qqq + Tier3qqq + Tier4qqq.
RS2mdy is Tier1mdy + Tier2mdy + Tier3mdy + Tier4mdy.
RS2iwm is Tier1iwm + Tier2iwm + Tier3iwm + Tier4iwm.
RS3x is (RS2spy+RS2qqq+RS2mdy+RS2iwm).
RS4 is (RS3x/NumIndx)*10.
RS4osc is simpleavg(RS4,3).
mvSig is simpleavg(RS4osc,5).
RS4r is round(RS4).
mvRS4 is expavg(RS4r,4).
RS4up is iff(RS4r >= 80 or RS4r > mvRS4,1,0).
X is iff(RS4 >= 80,1,0).
R5 is iff(RS4up =1,round(simpleavg(X,len2)*100),0).
Buy if R5 >= BuyLvl.
ExitBuy if R5 < BuyLvl.
ShowValues if 1.
Code for the RS4r is included in the EDS file. I also coded a system that uses the RS4r (R5). I used four independent ETFs as indexes rather than the 11 mutual funds that the author used. I used SPY, QQQQ, MDY, and IWM. The trading system buys (long only) when the R5 >= 80 and exits the long position when RS4r < 80. The summary EDS backtest report for trading this system on the Nasdaq 100 stocks (commission & slippage not subtracted) is shown in Figure 13 and a sample trade on DISH with the R5 indicator is shown in Figure 12.
FIGURE 12: AIQ. Chart of DISH with R5 indicator and sample trade using R5 indicator >= 80 to buy.
FIGURE 13: AIQ. Summary EDS backtest report for the R5 system that trades the Nasdaq 100 stocks over the last 4 years.
The bond market was very quiet in the 3rd quarter. Figure 1 displays ticker IEF (7-10 year treasuries ETF) in the to clip and ticker AGG (Aggregate Bond Index ETF) in the bottom clip.
Essentially the entire bond market has been flat since early June. The market seems to be assuming that “the Fed will take of everything” and keep interest rates low and stable for the foreseeable future so…..ZZZZZZZZ.
But this type of activity often breeds complacency. I am not making any predictions here but I do want to raise a question that investors might wish to ponder, i.e., “what would be more shocking that a spike in interest rates?” OK, yes, I realize it is 2020 and it is pretty much hard to be shocked by anything anymore. But still, on a relative basis how many investors are even thinking about the potential risk of higher interest rates at the moment?
Could it Happen?
The Bond Market VIX (ticker MOVE) recently fell to its lowest level ever (before spiking sharply higher on 10/5/20). As you can see in Figure 2 this type of “quietness” often precedes a significant move in the bond market. For the record, low readings in MOVE can be followed by large up moves in price as easily as large down moves in price. So, a low MOVE reading is not “bearish” per se, but rather merely suggests that we are experiencing the “calm before the storm.”
So why is my “Spidey sense” tingling? Figure 3 displays the yield on 30-year treasuries (ticker TYX) on the bottom and an indicator I refer to as VFAA on the bottom (the calculation appears at the end of this piece). VFAA is a derivative on a Larry William’s indicator he calls VixFix.
Figure 3 – 30-year treasury yields with VFAA suggesting a potential bottoming area (Courtesy AIQ TradingExpert)
As you can see in Figure 3, peaks in the VFAA indicator often occur near intermediate term lows in bond yields (reminder: bond prices move inversely to yield, so a bottom in interest rates indicates a top in bond prices). As you can also see on the far-right hand side, the stage clearly appears to be set for “the next go round.”
Why does this matter? If interest rates do rise in the months ahead bond prices – particularly long-term bond prices can get hit hard. To illustrate the potential risks, Figure 4 displays the action of treasury security ETFs of various maturity during a 5-month rise in rates back in 2016.
Figure 4 – Bond ETF action during rate rise in 2016
Summary
It is possible for long and short-term bonds to “de-couple”. In other words, the possibilities are:
*Short-term rates remain stable (as the Fed keeps pumping) while long-term rates rise (as inflation fears arise as a result of all the Fed pumping)
*Short-term rates remain stable while long-term rates plummet (if the economy appears to be weakening). This would result in gains for long-term bonds only
*None of the above
The bottom line: Bonds have fallen asleep – but DO NOT fall asleep on bonds.
VFAA Formula
Below is the code for VFAA
VixFix is an indicator developed many years ago by Larry Williams which essentially compares the latest low to the highest close in the latest 22 periods (then divides the difference by the highest close in the latest 22 periods). I then multiply this result by 100 and add 50 to get VixFix.
*Next is a 3-period exponential average of VixFix
*Then VFAA is arrived at by calculating a 7-period exponential average of the previous result (essentially, we are “double-smoothing” VixFix)
Are we having fun yet? See code below:
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
vixfixaverage is Expavg(vixfix,3).
vixfixaverageave is Expavg(vixfixaverage,7).
VFAA = vixfixaverageave
Jay Kaeppel
Disclaimer: The information, opinions and ideas expressed herein are for informational and educational purposes only and are based on research conducted and presented solely by the author. The information presented represents the views of the author only and does not constitute a complete description of any investment service. In addition, nothing presented herein should be construed as investment advice, as an advertisement or offering of investment advisory services, or as an offer to sell or a solicitation to buy any security. The data presented herein were obtained from various third-party sources. While the data is believed to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. International investments are subject to additional risks such as currency fluctuations, political instability and the potential for illiquid markets. Past performance is no guarantee of future results. There is risk of loss in all trading. Back tested performance does not represent actual performance and should not be interpreted as an indication of such performance. Also, back tested performance results have certain inherent limitations and differs from actual performance because it is achieved with the benefit of hindsight.
Truth be told I am not much of a “stock picker”. Oh, I can pick ‘em alright just like anyone else. They just to don’t go the right way as often as I’d like. I also believe that the way to maximize profitability is to follow a momentum type approach that identifies stocks that are performing well and buying them when they breakout to the upside (ala O’Neil, Minervini, Zanger, etc.) and then riding them as long as they continue to perform. Unfortunately, I’m just not very good at it.
Back when I started out, there was such a thing as a “long-term investor.” People would try to find good companies selling at a decent price and they would buy them and hold them for, well, the long-term. Crazy talk, right? As I have already stated, I am not claiming that that is a better approach. I am just pointing out that it was “a thing.”
An Indicator
There is an indicator (I will call it VFAA, which is short for vixfixaverageave, which – lets face it – is a terrible name) that I follow that was developed as an extension of Larry William’s VixFix Indicator. There is nothing magic about it. Its purpose is to identify when price has reached an exceptionally oversold level and “may” be due to rally. The code for this indicator appears later.
For the record, I DO NOT systematically use this indicator in the manner I am about to describe, nor am I recommending that you do. Still, it seems to have some potential value, so what follows is merely an illustration for informational purposes only.
The Rules
*We will look at a monthly bar chart for a given stock
*A “buy signal” occurs when VFAA reaches or exceeds 80 and then turns down for one month
*A “sell (or exit) signal” occurs when VFAA subsequently rises by at least 0.25 from a monthly closing low
Seeing as how this is based solely on monthly closes it obviously this is not going to be a “precision market timing tool.”
Some “Good Companies” with “Troubled Stocks”
So now let’s apply this VFAA indicator to some actual stocks. Again, I AM NOT recommending that anyone use this approach mechanically. The real goal is merely to try to identify situations where a stock has been washed out, reversed and MAY be ready to run for a while.
Ticker BA
Figure 1 displays a monthly chart for Boeing (BA) with VFAA at the bottom. The numbers on the chart represent the hypothetical + (-) % achieved by applying the rules above (although once again, to be clear I am not necessarily suggesting anyone use it exactly this way).
From March 2019 into March 2020 BA declined -80%. It has since bounced around and VFAA has soared to 110.88. VFAA has yet to rollover on a month-end basis, so nothing to do here except exhibit – what’s that word again – oh right, “patience.”
Ticker GD
Figure 2 displays a monthly chart for General Dynamics (GD) with VFAA at the bottom.
Are these “world-beating numbers”? Not really. But in terms of helping to identify potential opportunities, not so bad. VFAA gave a “buy signal” for GD at the end of July. So far, not so good as the stock is down about -6%.
Ticker WFC
Figure 3 displays a monthly chart for Wells Fargo (WFC) with VFAA at the bottom.
There are not many “signals” but the ones that occurred have been useful. Between 2018 and 2020 WFC declined -65%. It has since bounced around and VFAA has soared to 102.44. VFAA has yet to rollover on a month-end basis. But at some point it will, and a potential opportunity may arise.
VFAA Formula
Below is the code for VFAA
VixFix is an indicator developed many years ago by Larry Williams which essentially compares the latest low to the highest close in the latest 22 periods (then divides the difference by the highest close in the latest 22 periods). I then multiply this result by 100 and add 50 to get VixFix.
*Next is a 3-period exponential average of VixFix
*Then VFAA is arrived at by calculating a 7-period exponential average of the previous result (essentially, we are “double-smoothing” VixFix)
Are we having fun yet? See code below:
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
vixfixaverage is Expavg(vixfix,3).
vixfixaverageave is Expavg(vixfixaverage,7).
VFAA = vixfixaverageave
EDITORS NOTE: The AIQ Expert Design Studio code for the indicator is available to download from here. Save this file to your /wintes32/EDS Strategies folder https://aiqeducation.com/VFAA.EDS
Summary
One thing to note is that VFAA “signals” on a monthly chart don’t come around very often. So, you can’t really sit around and wait for a signal to form on your “favorite company”. You have to look for opportunity wherever it might exist.
One last time let me reiterate that I am not suggesting using VFAA as a standalone systematic approach to investing. But when a signal does occur – especially when applied to quality companies that have recently been “whacked”, it can help to identify a potential opportunity.
Jay Kaeppel
Disclaimer: The information, opinions and ideas expressed herein are for informational and educational purposes only and are based on research conducted and presented solely by the author. The information presented represents the views of the author only and does not constitute a complete description of any investment service. In addition, nothing presented herein should be construed as investment advice, as an advertisement or offering of investment advisory services, or as an offer to sell or a solicitation to buy any security. The data presented herein were obtained from various third-party sources. While the data is believed to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. International investments are subject to additional risks such as currency fluctuations, political instability and the potential for illiquid markets. Past performance is no guarantee of future results. There is risk of loss in all trading. Back tested performance does not represent actual performance and should not be interpreted as an indication of such performance. Also, back tested performance results have certain inherent limitations and differs from actual performance because it is achieved with the benefit of hindsight.
The importable AIQ EDS file based on Vitali Apirine’s article in the August, 2020 issue of Stocks & Commodities magazine, “The Compare Price Momentum Oscillator (CPMO),” can be obtained on request via email to info@TradersEdgeSystems.com.
… Here is a way you can compare at a glance the momentum of two different market indexes or securities in the same chart. It could also be used to help generate trading signals. In this first part of a three-part series, we’ll look at comparing index momentums…
The code is also available here:
!Author: Vitali Aprine, TASC August 2020
!Coded by: Richard Denning, 6/20/20
!www.TradersEdgeSystems.com
!Custom smoothing multiplier: 2 / time period
!PMO line: 20-period custom EMA of (10 × 35-period
!custom EMA of ((Today’s price – Yesterday’s price) /
!Yesterday’s price × 100))
!PMO signal line: 10-period EMA of the PMO line
Len1 is 20.
Len2 is 35.
Len3 is 10.
Ticker1 is “QQQ”.
Ticker2 is “SPY”.
C is [close].
C1 is valresult(C,1).
RC1 is (C/C1*100)-100.
custSmoLen1 is Len1 – 1.
custSmoLen2 is Len2 – 1.
CustEma is 10*expavg(RC1,custSmoLen2).
PMO is expavg(CustEma,custSmoLen1).
PMOsig is expavg(PMO,Len3).
Ticker1C is tickerUDF(Ticker1,C).
RC1ticker1 is (Ticker1C/valresult(Ticker1C,1)*100)-100.
CustEmaTicker1 is 10*expavg(RC1ticker1,custSmoLen2).
PMOticker1 is expavg(CustEmaTicker1,custSmoLen1).
Ticker2C is tickerUDF(Ticker2,C).
RC1ticker2 is (Ticker2C/valresult(Ticker2C,1)*100)-100.
CustEmaTicker2 is 10*expavg(RC1ticker2,custSmoLen2).
PMOticker2 is expavg(CustEmaTicker2,custSmoLen1).
CPMO is PMOTicker1 – PMOTicker2.
List if hasdatafor(1000) >= 900.
I coded the indicator described by the author. Figure 10 shows the indicator (QQQ,SPY,20,35) on chart of IWM. When the white line is above the red line on the CPMO indicator, this indicates that the QQQ is stronger than the SPY. Generally, it is considered bullish when the QQQ is leading in strength.
FIGURE 10: AIQ. The CPMO indicator is shown on a chart of IWM with parameters (QQQ,SPY,20,35).
To say that there is has been and remains a great deal of angst in the financial markets is a bit of an understatement. This is especially true when it comes to the financial sector. The financial sector has a fairly high correlation to treasury yields (ticker FSRBX – Fidelity Select Banking Portfolio has a 0.52 correlation to ticker TNX – which tracks 10-year treasury yields). As yields have plummeted so has the financial sector. During the recent decline, FSRBX plunged -51% from its December 2019 peak. With little expectation of higher rates anytime soon a lot of investors are understandably wary of diving into this sector.
But much like with the energy sector, the old adage that the time to buy is when there is “blood in the streets”, should give one pause before they turn their back completely on the financial sector. For the time being I am keeping my eye on a little-known indicator called “Vixfixaverageave” (yes, I agree it is a really bad name). The calculations for this indicator appear at the end of this article. The reason I am watching it right now is that it recently reached a very oversold level that has helped to highlight some useful buying opportunities for financials in the past.
Ticker FSRBX
Figure 1 displays a monthly chart for FSRBX in the top clip and the Vixfixaverageave indicator in the bottom clip. Note that the indicator rose above 72 at the end of April 2020. As you can see there have been four previous occasions when this indicator, a) exceeded 72 and then b) reversed lower for one month. For arguments sake we will call that a buy signal.
Figure 2 displays the 1 to 5 year % + (-) for FSRBX following the four previous signals. As you can see, they all proved to be exceptional buying opportunities.
Figure 2 – FSRBX returns 1 to 5 years after signal
Now for the disappointing news: if you are thinking that all we have to do is wait for this indicator to finally top out and that big profits are “guaranteed” to roll in, you are making a mistake. As they say, “past performance is no guarantee of future results.” (Sorry, I don’t make the rules). So, when the Vixfixaverageave monthly reading for FSRBX does finally roll over, the proper course of action would be to:
*Decide if you really want to act based on the signal
*Decide how much capital you are willing to commit
*Decide how much of that capital you are actually willing to risk – i.e. will you stop out if a loss exceeds x%, or do you plan to simply hold it for 1 to 5 years regardless?
Summary
There are a million and one ways to trigger an entry signal. The one discussed herein is just one more. What really separates the winners from the losers is the answers to the three questions just posed.
Vixfixaverageave Calculations
EDITTORS NOTE: The code sections can be copied and pasted into AIQ EDS or you can download the indicator code in an EDS file from here and save it to your /wintes32/EDS Strategies folder.
This indicator is based on another indicator called VixFix which was developed many years ago by Larry Williams.
hivalclose is hival([close],22). <<<<<The high closing price in that last 22 periods
vixfix is (((hivalclose-[low])/hivalclose)*100)+50. <<<(highest closing price in last 22 periods minus current period low) divided by highest closing price in last 22 periods (then multiplied by 100 and 50 added to arrive at vixfix value)
vixfixaverage is Expavg(vixfix,3). <<< 3-period exponential average of vixfix
vixfixaverageave is Expavg(vixfixaverage,7). <<<7-period exponential average of vixfixaverage
Jay Kaeppel
Disclaimer: The information, opinions and ideas expressed herein are for informational and educational purposes only and are based on research conducted and presented solely by the author. The information presented represents the views of the author only and does not constitute a complete description of any investment service. In addition, nothing presented herein should be construed as investment advice, as an advertisement or offering of investment advisory services, or as an offer to sell or a solicitation to buy any security. The data presented herein were obtained from various third-party sources. While the data is believed to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. International investments are subject to additional risks such as currency fluctuations, political instability and the potential for illiquid markets. Past performance is no guarantee of future results. There is risk of loss in all trading. Back tested performance does not represent actual performance and should not be interpreted as an indication of such performance. Also, back tested performance results have certain inherent limitations and differs from actual performance because it is achieved with the benefit of hindsight.
In “A Simple Way To Trade Seasonality” in the September 2019 Stocks & Commodities, author Perry Kaufman describes methods he uses for measuring the seasonality in markets and approaches he uses for trading these patterns
Editors note: The full article can be obtained from Stocks & Commodities magazine at http://technical.traders.com/sub/sublog2.asp#Sep the system rules are from the article and are based on these rules
1. Average the monthly frequency of the past 4 years.
2. Find the last occurrence of the highest frequency and the last occurrence of the lowest frequency using the average frequency in step 1. That is, if both March and April have a frequency of 70, we use April.
3. Only trade if the high frequency is 75% or greater and the low frequency is 25% or lower.
4. If the high frequency comes first, sell short at the end of the month with the high frequency. Cover the short at the end of the month with the low frequency.
5. If the low frequency comes first, buy at the end of the month with the low frequency. Sell to exit at the end of the month with the high frequency
The importable AIQ EDS file and Excel spreadsheet for Perry Kaufman’s article can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown below
!A Simple Way to Trade Seasonality
!Author: Perry Kaufman, TASC September 2019
!Coded by: Richard Denning, 07/21/2019
!www.TradersEdgeSystem.com
C is [close].
year is 2019.
len is 4000.
OSD is offsettodate(month(),day(),year()).
FirstDate is firstdatadate().
EOM1 if Month()=2 and valresult(month(),1)=1 and year()=year.
EOMos1 is scanany(EOM1,len) then OSD+1.
EOMc1 is valresult(C,^EOMos1).
EOM2 if Month()=3 and valresult(month(),1)=2 and year()=year.
EOMos2 is scanany(EOM2,len) then OSD+1.
EOMc2 is valresult(C,^EOMos2).
EOM3 if Month()=4 and valresult(month(),1)=3 and year()=year.
EOMos3 is scanany(EOM3,len) then OSD+1.
EOMc3 is valresult(C,^EOMos3).
EOM4 if Month()=5 and valresult(month(),1)=4 and year()=year.
EOMos4 is scanany(EOM4,len) then OSD+1.
EOMc4 is valresult(C,^EOMos4).
EOM5 if Month()=6 and valresult(month(),1)=5 and year()=year.
EOMos5 is scanany(EOM5,len) then OSD+1.
EOMc5 is valresult(C,^EOMos5).
EOM6 if Month()=7 and valresult(month(),1)=6 and year()=year.
EOMos6 is scanany(EOM6,len) then OSD+1.
EOMc6 is valresult(C,^EOMos6).
EOM7 if Month()=8 and valresult(month(),1)=7 and year()=year.
EOMos7 is scanany(EOM7,len) then OSD+1.
EOMc7 is valresult(C,^EOMos7).
EOM8 if Month()=9 and valresult(month(),1)=8 and year()=year.
EOMos8 is scanany(EOM8,len) then OSD+1.
EOMc8 is valresult(C,^EOMos8).
EOM9 if Month()=10 and valresult(month(),1)=9 and year()=year.
EOMos9 is scanany(EOM9,len) then OSD+1.
EOMc9 is valresult(C,^EOMos9).
EOM10 if Month()=11 and valresult(month(),1)=10 and year()=year.
EOMos10 is scanany(EOM10,len) then OSD+1.
EOMc10 is valresult(C,^EOMos10).
EOM11 if Month()=12 and valresult(month(),1)=11 and year()=year.
EOMos11 is scanany(EOM11,len) then OSD+1.
EOMc11 is valresult(C,^EOMos11).
EOM12 if Month()=1 and valresult(month(),1)=12 and valresult(year(),1)=year.
EOMos12 is scanany(EOM12,len) then OSD+1.
EOMc12 is valresult(C,^EOMos12).
YEARavg is (EOMc1+EOMc2+EOMc3+EOMc4+EOMc5+EOMc6+EOMc7+EOMc8+EOMc9+EOMc10+EOMc11+EOMc12)/12.
AR1 is (EOMc1 / YEARavg-1)*100.
AR2 is (EOMc2 / YEARavg-1)*100.
AR3 is (EOMc3 / YEARavg-1)*100.
AR4 is (EOMc4 / YEARavg-1)*100.
AR5 is (EOMc5 / YEARavg-1)*100.
AR6 is (EOMc6 / YEARavg-1)*100.
AR7 is (EOMc7 / YEARavg-1)*100.
AR8 is (EOMc8 / YEARavg-1)*100.
AR9 is (EOMc9 / YEARavg-1)*100.
AR10 is (EOMc10 / YEARavg-1)*100.
AR11 is (EOMc11 / YEARavg-1)*100.
AR12 is (EOMc12 / YEARavg-1)*100.
EOMc if firstdate < makedate(1,20,2019-20).
AR if EOMc.
The EDS code is not a trading system but a way to get the data needed into an Excel spreadsheet to enable you to make the seasonal calculations. The EDS file should be run on a date after the end of the year being calculated. Each year for which data is needed must be run separately by setting the “year” variable. Multiple symbols can be run at the same time by using a list of the desired symbols. Each time a year is run, the “AR” report must be saved as a “.csv” file. Once all the years needed have been run and saved to separate “.csv” files, they all should be cut and pasted to a single Excel sheet. They then can be sorted by symbol and each symbol can be copied and pasted to a tab for that symbol.
Figure 6 shows the rolling four-year frequency for the S&P 500 ETF (SPY) and Figure 7 shows the annual trades resulting from applying the seasonal rules to the frequency data.
FIGURE 6: AIQ. Shown here is the rolling four-year frequency for the SPY.
FIGURE 7: AIQ. Shown here are the annual trades resulting from applying the seasonal rules to the frequency data for SPY.
I keep seeing headlines about the “imminent” re-emergence of commodities as a viable investment as an asset class. And as I wrote about here, I mostly agree wholeheartedly that “the worn will turn” at some point in the years ahead, as commodities are historically far undervalued relative to stocks.
The timing of all of this is another story. Fortunately, it is a fairly short and simple story. In a nutshell, it goes like this:
*As long as the U.S. Dollar remains strong, don’t bet heavy on commodities.
The End
Well not exactly.
The 2019 Anomaly
The Year 2019 was something of an anomaly as both the U.S. Dollar and precious metals such as gold and silver rallied. This type of action is most unusual. Historically gold and silver have had a highly inverse correlation to the dollar. So, the idea that both the U.S. Dollar AND commodities (including those beyond just precious metals) will continue to rise is not likely correct.
Commodities as an Asset Class
When we are talking “commodities as an asset class” we are talking about more than just metals. We are also talking about more than just energy products.
The most popular commodity ETFs are DBC and GSG as they are more heavily traded than most others. And they are fine trading vehicles. One thing to note is that both (and most other “me too” commodity ETFs) have a heavy concentration in energies. This is not inappropriate given the reality that most of the industrialized world (despite all the talk of climate change) still runs on traditional fossil fuel-based energy.
But to get a broader picture of “commodities as an asset class” I focus on ticker RJI (ELEMENTS Linked to the Rogers International Commodity Index – Total Return) which diversifies roughly as follows:
Agriculture 40.90%
Energy 24.36%
Industrial Metals 16.67%
Precious Metals 14.23%
Livestock 3.85%
Note that these allocations can change over time, but the point is that RJI has much more exposure beyond the energy class of assets than alot of other commodity ETFs.
RJI vs. the Dollar
As a proxy for the U.S. Dollar we will use ticker UUP (Invesco DB US Dollar Index Bullish Fund). Figure 1 displays the % gain/loss for UUP (blue line) versus RJI (orange line) since mid-2008.
Figure 1 – UUP versus RJI; Cumulative Return using weekly closing prices; May-2008-Sep-2019
*Since May of 2008 UUP has gained +17.2%
*Since May of 2008 RJI has lost -60%
The correlation in price action between these two ETFs since 2008 is -0.76 (a correlation of -1.00 means they are perfectly inverse), so clearly there is (typically) a high degree of inverse correlation between the U.S. dollar and “commodities”.
Next, we will apply an indicator that I have dubbed “MACD4010501” (Note to myself: come up with a better name). The calculations for this indicator will appear at the end of the article (but it is basically a 40-period exponential average minus a 105-period exponential average). In Figure 2 we see a weekly chart of ticker UUP with this MACD indicator in the top clip and a weekly chart of ticker RJI in the bottom clip.
Figure 2 – UUP with Jay’s MACD Indicator versus ticker RJI (courtesy AIQ TradingExpert )
Interpretation is simple:
*when the MACD indicator applied to UUP is declining, this is bullish for RJI
*when the MACD indicator applied to UUP is rising, this is bearish for RJI.
Figure 3 displays the growth of equity achieved by holding RJI (using weekly closing price data) when the UUP MACD Indicator is declining (i.e., RJI is bullish blue line in Figure 3) versus when the UUP MACD Indicator is rising (i.e., RJI is bearish orange line in Figure 3).
Figure 3 – RJI cumulative performance based on whether MACD indicator for ticker UUP is falling (bullish for RJI) of rising (bearish for RJI)
In sum:
*RJI gained +45.8% when the UUP MACD indicator was falling
*RJI lost -72.3% when the UUP MACD indicator was rising
The bottom line is that RJI rarely makes much upside headway when the UUP MACD Indicator is rising (i.e., is bearish for RJI).
Summary
Commodities as an asset class are extremely undervalued on a historical basis compared to stocks. However, the important thing to remember is that “the worm is unlikely to turn” as long as the U.S. Dollar remains strong.
So, keep an eye on the U.S. Dollar for signs of weakness. That will be your sign that the time may be coming for commodities.
FYI: Code for Jay’s MACD4010501 Indicator (AIQ TradingExpert EDS)
The indicator is essentially a 40-period exponential average minus a 105-period exponential average as shown below:
Define ss3 40.
Define L3 105.
ShortMACDMA3 is expavg([Close],ss3)*100.
LongMACDMA3 is expavg([Close],L3)*100.
MACD4010501 is ShortMACDMA3-LongMACDMA3.
Jay Kaeppel
Disclaimer: The information, opinions and ideas expressed herein are for informational and educational purposes only and are based on research conducted and presented solely by the author. The information presented does not represent the views of the author only and does not constitute a complete description of any investment service. In addition, nothing presented herein should be construed as investment advice, as an advertisement or offering of investment advisory services, or as an offer to sell or a solicitation to buy any security. The data presented herein were obtained from various third-party sources. While the data is believed to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. International investments are subject to additional risks such as currency fluctuations, political instability and the potential for illiquid markets. Past performance is no guarantee of future results. There is risk of loss in all trading. Back tested performance does not represent actual performance and should not be interpreted as an indication of such performance. Also, back tested performance results have certain inherent limitations and differs from actual performance because it is achieved with the benefit of hindsight.
The importable AIQ EDS file based on Vitali Apirine’s article in July 2019 Stocks & Commodities issue, “Exponential Deviation Bands,”
and a recreated Excel spreadsheet similar to the one shown in the article can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown here:
Exponential deviation (ED) bands are plotted above and below a moving average (MA) from which the bands are calculated. An exponential deviation from the moving average is used to set the bands. ED bands can be used with either a simple moving average (SMA) or an exponential moving average (EMA). The moving average dictates direction, and the exponential deviation sets band width. Breakouts from the band and changes in the band’s direction can help identify price trends and price reversals. These bands can be used on a variety of securities with its standard settings.
!EXPONENTIAL DEVIATION BANDS
!Author: Vitali Apirine, TASC July 2019
!Coded by: Richard Denning, 5/15/2019
!www.TradersEdgeSystems.com
C is [close].
Periods is 20.
MA20 is simpleavg(C,Periods). !expavg(C,Periods). !or simpleavg(C,Periods).
MDev20 is (Abs(MA20-C)+Abs(MA20-valresult(C,1))+Abs(MA20-valresult(C,2))+Abs(MA20-valresult(C,3))
+Abs(MA20-valresult(C,4))+Abs(MA20-valresult(C,5))+Abs(MA20-valresult(C,6))+Abs(MA20-valresult(C,7))
+Abs(MA20-valresult(C,8))+Abs(MA20- valresult(C,9))+Abs(MA20- valresult(C,10))+Abs(MA20- valresult(C,11))
+Abs(MA20- valresult(C,12))+Abs(MA20- valresult(C,13))+Abs(MA20- valresult(C,14))+Abs(MA20- valresult(C,15))
+Abs(MA20- valresult(C,16)) +Abs(MA20- valresult(C,17))+Abs(MA20- valresult(C,18))+Abs(MA20- valresult(C,19)))/20.
Dev is Abs(MA20-C).
Rate is 2/( Periods +1).
DaysInto is ReportDate() - RuleDate().
Stop if DaysInto >= 200.
stopEXD is iff(Stop,Mdev20, EXD).
EXD is Dev*Rate + valresult(stopEXD,1)*(1-Rate).
UpperExp is MA20+2*EXD.
MidExp is MA20.
LowerExp is MA20-2*EXD.
ShowValues if 1.
Figure 9 shows the exponential deviation bands centered on a 20-bar simple moving average on a chart of the New York Composite Index (NYA).
FIGURE 9: AIQ. Here are exponential deviation bands centered on a 20-bar simple moving average on a chart of the New York Composite Index (NYA).
The importable AIQ EDS file based on Anthony Garner’s article in May 2019 Stocks & Commodities “Backtesting A Mean-Reversion Strategy In Python,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown below.
I backtested the author’s mean-reversion system (MeanRev.eds) using both the EDS module, which tests every trade on a one-share basis, and also via the Portfolio Manager, which performs a trading simulation.
The short side strategy showed a loss overall in the EDS test so I tested only the long side in the Portfolio Manager. I selected trades using the z-score, taking the lowest values.
For capitalization, I used max of three trades per day with a max total of 10 open trades at one time, 10% allocated to each position. I did not deduct slippage but did deduct commissions. I used a recent list of the NASDAQ 100 stocks to run the test. The equity curve and account statistics report are shown in Figure 7.
FIGURE 7: AIQ. This shows the equity curve (blue line) from long-only trading the NASDAQ 100 list of stocks from 1999 to March 15, 2019. The red line is the NDX index.
!Backtesting a Mean-Reversion Strategy In Python !Author: Anthony Garner, TASC May 2019 !Coded by: Richard Denning 3/14/19 !www.TradersEdgeSystems.com
!ABBREVIATIONS: C is [close].
!INPUTS: meanLen is 10. longZmult is -1. shortZmult is 1. meanMult is 10.
!FORMULAS:
SMA is simpleavg(C,meanLen). LMA is simpleavg(C,meanLen*meanMult). STD is sqrt(variance(C,meanLen)). zScore is (C - SMA) / STD.
!TRADING SIGNALS & EXITS:
buyLong if zScore < longZmult and SMA > LMA. sellShort if zScore > shortZmult and SMA < LMA. exitLong if valresult(zScore,1) < -0.5 and zScore > 0.5. exitShort if valresult(zScore,1) > 0.5 and zScore < -0.5.
Some industries are cyclical in nature. And there is not a darned thing you – or they – can do about it. Within those industries there are individual companies that are “leaders”, i.e., well run companies that tend to out earn other companies in that given industry and whose stock tends to outperform other companies in that industry.
Unfortunately for them, even they cannot avoid the cyclical nature of the business they are in. Take Halliburton (ticker HAL) for example. Halliburton is one of the world’s largest providers of products and services to the energy industry. And they do a good job of it. Which is nice. It does not however, release them from the binds of being a leader in a cyclical industry.
A Turning Point at Hand?
A quick glance at Figure 1 clearly illustrates the boom/bust nature of the performance of HAL stock.Figure 1 – Halliburton (HAL) (Courtesy AIQ TradingExpert)
Which raises an interesting question: is there a way to time any of these massive swings? Well here is where things get a little murky. If you are talking about “picking timing tops and bottoms with uncanny accuracy”, well, while there are plenty of ads out there claiming to be able to do just that, in reality that is not really “a thing”. Still, there may be a way to highlight a point in time where:
*Things are really over done to the downside, and
*For a person who is not going to get crazy and “bet the ranch”, and who understands how a stop-loss order works and is willing to use one…
..there is at least one interesting possibility.
It’s involves a little-known indicator that is based on a more well-known another indicator that was developed by legendary trader Larry Williams roughly 15 or more years ago. William’s indicator is referred to as “VixFix” and attempts to replicate a VIX-like indicator for any market. The formula is pretty simple, as follows (the code is from AIQ Expert Design Studio):
*hivalclose is hival([close],22).
*vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
In English, it is the highest close in the last 22-periods minus the current period low, which is then divided by the highest close in the last 22-periods. The result then gets multiplied by 100 and 50 is added.
Figure 2 displays a monthly chart of HAL with William’s VixFix in the lower clip. In a nutshell, when price declines VixFix rises and vice versa.
Figure 2 – HAL Monthly with William’s VixFix (Courtesy AIQ TradingExpert)
Now let’s go one more step as follows by creating an exponentially smoothed version as follows (the code is from AIQ Expert Design Studio):
*hivalclose is hival([close],22).
*vixfix is (((hivalclose-[low])/hivalclose)*100)+50. <<<Vixfix from above
*vixfixaverage is Expavg(vixfix,3). <<<3-period exponential MA of Vixfix
*Vixfixaverageave is Expavg(vixfixaverage,7). <<<7-period exp. MA
I refer to this as Vixfixaverageave (Note to myself: get a better name) because it essentially takes an average of an average. In English (OK, sort of), first Vixfix is calculated, then a 3-period exponential average of Vixfix is calculated (vixfixaverage) and then a 7-period exponential average of vixfixaverage is calculated to arrive at Vixfixaverageave (got that?)
Anyway, this indicator appears on the monthly chart for HAL that appears in Figure 3.Figure 3 – HAL with Vixaverageave (Courtesy AIQ TradingExpert)
So here is the idea:
*When Vixfixaverageave for HAL exceeds 96 it is time to start looking for a buying opportunity.
OK, that last sentence is not nearly as satisfying as one that reads “the instant the indicator reaches 96 it is an automatic buy signal and you can’t lose”. But it is more accurate. Previous instances of a 96+ reading for Vixfixaverageave for HAL appear in Figure 4.
Figure 4 – HAL with previous “buy zone” readings from Vixfixaverageave (Courtesy AIQ TradingExpert)
Note that in previous instances, the actual bottom in price action occurred somewhere between the time the indicator first broke above 96 and the time the indicator topped out. So, to reiterate, Vixfixaverageave is NOT a “precision timing tool”, per se. But it may be useful in highlighting extremes.
This is potentially relevant because with one week left in May, the monthly Vixfixaverageave value is presently above 96. This is NOT a “call to action”. If price rallies in the next week Vixfixaverageave may still drop back below 96 by month-end. Likewise, even if it is above 96 at the end of May – as discussed above and as highlighted in Figure 4, when the actual bottom might occur is impossible to know.
Let me be clear: this article is NOT purporting to say that now is the time to buy HAL. Figure 5 displays the largest gain, the largest drawdown and the 12-month gain or loss following months when Vixfixaverageave for HAL first topped 96. As you can see there is alot of variation and volatility.
Figure 5 – Previous 1st reading above 96 for HAL Vixfixaverageave
So HAL may be months and/or many % points away from an actual bottom. But the main point is that the current action of Vixfixaverageave suggests that now is the time to start paying attention.
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
Trend-following is essentially a “tried and true’ approach to investing. But overbought/oversold (i.e., attempting to buy low/sell high) – that’s where the “excitement” is. Of course, when it comes to trading and investing, “excitement” can be highly overrated. Nevertheless, in this piece I want to talk about a relatively obscure indicator that may be useful in identifying vastly oversold situations.
EDITORS NOTE: The AIQ EDS file for Jay Kaeppel’s indicator is available to download at
Part of the reason this indicator is obscure is because I think I “invented” it – but only by mashing together an indicator from Larry Williams and an indicator from Welles Wilder. The first part is the standard Welles Wilder 14-day Relative Strength Index, more commonly referred to as “RSI”.
The 2nd part of VixRSI14 is an indicator created by famed trader Larry Williams which he dubbed “VixFix”. This indicator is an effort to create a “Vix Index-like” indicator for any security.
AIQ TradingExpert code for these indicators appears at the end of the article.
A Few Notes
*For the record, VixRSI14 is calculated by taking a 3-day exponential average of VixFix and dividing that by a 3-day exponential average of RSI14 (are we having fun yet?). Please see code at the end of the article.
*I prefer to use VixRSI14 using weekly data rather than daily data
*(Unfortunately) There are no “magic numbers” that indicate that a completely risk-free, you can’t lose, just buy now and watch the money roll in” buying opportunity is at hand (Disclaimer: If there was, I would probably just keep it to myself and not bother writing the article – sorry, it’s just my nature). That being said, a decent “rule of thumb” is to look for a reading above 3.5 followed by a downside reversal.
(Click any chart below to enlarge)
With those thoughts in mind, Figure 1 displays a weekly chart of Wynn Resorts (WYNN) with the two indicators plotted separately below the bar chart.
Figure 1 – WYNN with William’s VixFix and Wilder’s RSI 14-day (Courtesy AIQ TradingExpert)
Note that as price declines, VixFix tends to rise and RSI14 tends to fall. VIXRSI14 essentially identifies “extremes” in the difference between these two. Figure 2 displays WYNN with VixRSI14 plotted below the bar chart.
As always, I merely present “ideas” here at JOTM. So, do not assume from the charts above that you have found the “keys to the kingdom”. But if used in conjunction with other confirming indicators – and remembering to employ some sort of risk control for those instances when a stock price decline fails to arrest itself even after VixRSI4 peaks above 3.5 – VixRSI14 may hold some value.
Indicator Code
EDITORS NOTE: The AIQ EDS file for Jay Kaeppel’s indicator is available to download at
Below is the code for VixFix, RSI14 and VixRSI14 from AIQ Expert Design Studio.
!#######################################
!VixFix indicator code
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
!#######################################
!#######################################
!RSI14 code
Define days14 27.
U14 is [close]-val([close],1).
D14 is val([close],1)-[close].
AvgU14 is ExpAvg(iff(U14>0,U14,0),days14).
AvgD14 is ExpAvg(iff(D14>=0,D14,0),days14).
RSI14 is 100-(100/(1+(AvgU14/AvgD14))).
!#######################################
!#######################################
!VixRSI14 code
VixRSI14 is expavg(vixfix,3)/expavg(RSI14,3).
!#######################################
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
So, the big question on every investor’s mind is “What Comes Next?” Since this is not an advisory service (and given the fact that I am not too good at predicting the future anyway) I have avoided commenting on “the state of the markets” lately. That being said, I do have a few “thoughts”:
*The major averages (as of this exact moment) are still mostly above their longer-term moving averages (200-day, 10-month, 40-week, and so on and so forth). So, on a trend-following basis the trend is still “up”.
*We are in the most favorable 15 months of the 48-month election cycle (though off to a pretty awful start obviously) which beings Oct.1 of the mid-term year and ends Dec. 31st of the pre-election year.
*Investors should be prepared for some volatility as bottoms following sharp drops usually take at least a little while to form and typically are choppy affairs. One day the market is up big and everyone breathes a sigh of relief and then the next day the market tanks. And so on and so forth.
An Indicator to Watch
At the outset let me state that there are no “magical” indicators. Still, there are some that typically are pretty useful. One that I follow I refer to as Nasdaq HiLoMA. It works as follows:
A = Nasdaq daily new highs
B = Nasdaq daily new lows
C = (A / (A+B)) * 100
D = 10-day moving average of C
C can range from 0% to 100%. D is simply a 10-day average of C.
Nasdaq HiLoMA = D
Interpretation: When Nasdaq HiLoMA drops below 20 the market is “oversold”.
Note that the sentence above says “the market is oversold” and NOT “BUY NOW AGGRESSIVELY WITH EVERY PENNY YOU HAVE.” This is an important distinction because – like most indicators – while this one may often give useful signals, it will occasionally give a completely false signal (i.e., the market will continue to decline significantly).
A couple of “finer points”:
*Look for the indicator to bottom out before considering it to be “bullish”.
*A rise back above 20 is often a sign that the decline is over (but, importantly, not always). Sometimes there may be another retest of recent lows and sometimes a bear market just re-exerts itself)
*If the 200-day moving average for the Dow or S&P 500 is currently trending lower be careful about using these signals. Signals are typically more useful if the 200-day moving average for these indexes is rising or at least drifting sideways rather than clearly trending lower (ala 2008).
Figures 2 through 8 displays the S&P 500 Index with the Nasdaq HiLoMA indicator. Click to enlarge any chart.
The stock market is in a favorable seasonal period and is oversold. As long as the former remains true, react accordingly (with proper risk controls in place of course).
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
The AIQ code based on Markos Katsanos’ article in this issue, “A Technical Method For Rating Stocks,” is shown below.
Synopsis from Stocks & Commodities June 2018
I’s it possible to create a stock rating system using multiple indicators or other technical criteria? If so, how does it compare with analyst ratings? Investors around the world move billions of dollars every day on advice from Wall Street research analysts. Most retail investors do not have the time or can’t be bothered to read the full stock report and rely solely on the bottom line: the stock rating. They believe these ratings are reliable and base their investment decisions at least partly on the analyst buy/sell rating. But how reliable are those buy/sell ratings? In this article I will present a technical stock rating system based on five technical criteria and indicators, backtest it, and compare its performance to analyst ratings.
!A TECHNICAL METHOD FOR RATING STOCKS
!Author: Markos Katsanos, TASC June 2018
!Coded by: Richard Denning, 4/18/18
!www.TradersEdgeSystems.com
!INPUTS:
MAP is 63.
STIFFMAX is 7.
VFIPeriod is 130.
MASPY is 100.
MADL is 100.
SCORECRIT is 5.
W1 is 1.
W2 is 1.
W3 is 1.
W4 is 1.
W5 is 2.
!VFI FORMULA:
COEF is 0.2.
VCOEF is 2.5.
Avg is ([high]+[low]+[close])/3.
inter is ln( Avg ) - ln( Valresult( Avg, 1 ) ).
vinter is sqrt(variance(inter, 30 )).
cutoff is Coef * Vinter * [Close].
vave is Valresult(simpleavg([volume], VFIPeriod ), 1 ).
vmax is Vave * Vcoef.
vc is Min( [volume], VMax ).
mf is Avg - Valresult( Avg, 1 ).
vcp is iff(MF > Cutoff,VC,iff(MF < -Cutoff,-VC,0)).
vfitemp is Sum(VCP , VFIPeriod ) / Vave.
vfi is expavg(VFItemp, 3 ).
!STIFFNESS
ma100 is Avg.
CLMA if [close] < MA100.
STIFFNESS is countof(CLMA,MAP).
!CONDITIONS:
! MONEY FLOW:
COND1 is iff(VFI>0,1,0).
!SIMPLEAVG:
SMA is simpleavg([close],MADL).
COND2 is iff([close]>SMA,1,0).
!SIMPLEAVG DIRECTION:
COND3 is iff(SMA>valresult(SMA,4),1,0).
!STIFFNESS:
COND4 is iff(STIFFNESS<= STIFFMAX,1,0).
!MARKET DIRECTION:
SPY is TickerUDF("SPY",[close]).
COND5 is iff(EXPAVG(SPY,MASPY)>=
valresult(EXPAVG(SPY,MASPY),2),1,0).
SCORE is W1*COND1+W2*COND2+W3*COND3+
W4*COND4+W5*COND5.
buy if Score>=SCORECRIT and hasdatafor(300)>=268.
Figure 11 shows the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018. Figure 12 shows the backtest using the same list of NASDAQ 100 stocks during a period that had two bear markets (April 1999 to April 2009). The average results are similar except that there are fewer trades during the period that contained the two bear markets. Both backtests use a fixed 21-bar exit.
FIGURE 11: AIQ, BULL MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018.
FIGURE 12: AIQ, BEAR MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a period from April 1999 to April 2009 that contained two bear markets.
The AIQ code based on Vitali Apirine’s article in Stocks & Commodities issue, “Weekly & Daily Percentage Price Oscillator,” Modifying a traditional indicator can make you look at a chart differently. You can compare indexes, look at price movements during extended periods of time, and make trading decisions based on your observations is provided here:
!WEEKLY & DAILY PPO
!Author: Vitali Apirine, TASC Feb 2018
!Coded by: Richard Denning 12/17/17
!www.TradersEdgeSystems.com
!INPUTS:
S is 12.
L is 26.
EMA1 is expavg([Close],S).
EMA2 is expavg([Close],L).
EMA3 is expavg([Close],S*5).
EMA4 is expavg([Close],L*5).
DM is (EMA1 - EMA2)/EMA4*100.
WM is (EMA3 - EMA4)/EMA4*100.
WD_PPO is WM + DM.
Figure below shows the daily and weekly PPO indicator on a chart of the Nasdaq 100 index (NDX) from 2015 to 2017.
Here, the daily & weekly PPO is displayed on a chart of the NDX.
2018 sure was a great year for the stock market. For almost a month anyway. Since then, not so much. And on the heels of last week’s selloff a lot of pundits and prognosticators are suggesting more loudly that the Great Bull Run is dead. And maybe they are right. But maybe not.
It is almost always a mistake to hang your hat on one indicator to guide your actions going forward. But at the same time, sometimes one indicator generates a signal so clear it perhaps should grab your attention. Let’s look at one that is on the verge of sending an important signal.
The VixRSIRatio Indicator
This is an indicator that I developed a number of years ago by basically – I am going to use some highly technical terms here to describe the process I followed so please try to stay with me – mashing together several other indicators from other people. If you are interested in the actual calculations they appear at the end of the article. For now, just know that I refer to it as VixRSIRatio. As I follow it, it gives meaningful signals very infrequently. But that is OK as the signals it does give often prove to be useful.
For our purposes we will apply it to ticker SPY – an ETF that tracks the S&P 500 Index. The rule is simple:
*A “Bullish Alert” occurs when VixRSIRatio drops to -210 or below and then turns up.
That’s it. Now please note the use of the phrase “Bullish Alert” and the lack of the words “You”, “Can’t” and “Lose”, as well as the lack of the phrase “by putting all of your money in the market at the exact moment a signal occurs.”
This is key. Also note that there is nothing “magic” about the value -210. Nothing scientific about it. It just seems like a useful cutoff. Now let’s look at the “Bullish Alert” signals in recent years. They appear in Figures 1 through 4.
a) Readings below -210 tend to be followed by – at the least – decent trading opportunities.
b) Often these readings presage significant market advances
c) And alas, sometimes the signals come too soon and/or are not followed by much of an advance.
The Here and Now
As of 3/23/18 the VixRSIRatio for ticker SPY stood -354. So clearly “Buy Alert” is at hand. So the obvious question is “What comes next”? Will it be a, b, or c above?
As always, time will tell.
Calculations
In a nutshell, VixRSIRatio combines Larry Williams’ Vixfix indicator with Welles Wilder’s 3-day and 14-day RSI indicators to create two more indicators – VixRSI3 and VixRSI14. We then divide VixRSI3 by VixRSI14 and invert the whole thing (so that we get an indicator that gives negative readings when the market goes down).
Now you see why I put this at the end….
Below is the code for AIQ Expert Design Studio
############## Larry Williams Vixfix #################
xx is 15.
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
VixRSIRatio is -((((VixRSI3/VixRSI14)-1)*100)-50).
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
In this article I wrote about an index I follow that combines the biotech sector with the gold stock sector. I also wrote about “one way” to trade that index. This article builds on that piece and adds a new “rule” to create more trading opportunities.
The BIOGOLD Index
Figure 1 displays the index that I created using AIQ TradingExpert. It combines ticker FBIOX (Fidelity Select Biotech) with ticker FSAGX (Fidelity Select Gold).
*The RSI32 drops below 50 (but not as low as 32) and then reverses to the upside for one month
After either of the buy signals above occurs, buy BOTH FBIOX and FSAGX
*After a buy signal, sell both funds when RSI32 rises to 64 or higher
Figure 2 displays the BIOGOLD Index with various buy and sell signals marked.
Figure 2 – Jay’s BIOGOLD Index with RSI32 signals (Courtesy AIQ TradingExpert)
To test results we will:
*Assume that after a buy signal both FBIOX and FSAGX are bought in equal amounts
*We will assume that both funds are held until RSI32 reaches 64 or higher (i.e., there is no stop-loss provision in this test)
For testing purposes we will not assume any interest earned while out of the market, in order to highlight only the performance during active buy signals. Figure 3 displays the hypothetical growth of $1,000 (using monthly total return data) using the “system”.
Figure 3 – Hypothetical Growth of $1,000 using Jay’s BIOGOLD System (1986-present)
Summary
For the record, I am not “recommending” that anyone go out and initiate trading biotech and gold based on what I have written here. Before trading using any approach it is essential for a trader to do their own homework and carefully consider all of the pro’s and con’s associated with any specific approach. For example, while the trade-by-trade results for the above look reasonably good, it should be noted that there have been 4 separate drawdown’s in excess of -19% along the way, including a maximum drawdown of -37% in 2008. In considering any approach to trading it is essential to first think long and hard about how well one would “weather the storms”, BEFORE focusing on potential profitability.
To put it more succinctly is the simple phrase “Don’t cross the river if you can’t swim the tide.”
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
In this article I detailed an indicator I refer to as VixRSI14 using monthly charts. Today let’s apply the same method to weekly bar charts. Before we do that a quick look at how this indicator functions.
VixRSI combines two indicators – Larry William’s VixFix and Welles Wilder’s Relative Strength Index (RSI). In Figure 1 you see a weekly bar chart for YHOO. Notice that as price declines the VixFix indicator rises and RSI falls. VixRSI14 essentially measures the difference between the two and looks for extremes as a sign of a potential reversal. See Figure 5 for YHOO with VixRSI14.
Figure 1 – YHOO with Williams VixFix (with 3-day exponential smoothing) and Wilder’s 14-period RSI (Courtesy AIQ TradingExpert)
The Weekly Version of VixRSI14
We will use the same method I described in the previous article, i.e.:
*We will calculate the VixRSI14 indicator (see code at end of article) on a weekly basis
*A “buy alert” occurs when VixRSI14 drops below 3.00 after first rising to 3.50 or higher
Once again, please note that:
*There is nothing magic about 3.50 or 3.00
*Not every “buy alert” is followed by an immediate rally (or even any rally at all for that matter)
*Any actually trading”results” will depend heavily on what you trade, how much of it you trade, when you actually get in, when you get out with a profit and/or when you get out with a loss.
*This VixRSI14 alert signal is simply serving notice that a given security may be overdone on the downside and may be ready soon to reverse to the upside. Nothing more, nothing less.
In 2018 I intend to try to share a few more trading “ideas” that maybe are not quite “finished products”. VixRSI14 fits neatly into the “Idea” category. Sometimes the alerts are early. Sometimes the alerts are late. Sometime the alerts don’t really pan out at all. Sometimes alerts are followed by one more sharp decline which is then followed by a major rally. So maybe some sort of trend reversal confirmation would be helpful. I don’t know.
Hey, that gives me an idea….
Code:
William’s VixFix is simply the 22-period high price minus today’s low price divided by the 22-day period price (I then multiply by 100 and then add 50). That may sound complicated but it is not.
The code for AIQ TradingExpert appears below.
########## VixFix Code #############
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
###############################
####### 14-period RSI Code ###########
Define periods14 27.
U14 is [close]-val([close],1).
D14 is val([close],1)-[close].
AvgU14 is ExpAvg(iff(U14>0,U14,0),periods14).
AvgD14 is ExpAvg(iff(D14>=0,D14,0),periods14).
RSI14 is 100-(100/(1+(AvgU14/AvgD14))).
###############################
VixRSI14 is then calculated by dividing the 3-period exponential average of VixFix by the 3-period exponential average of RSI14
####### VixRSI14 Code ###########
VixRSI14 is expavg(vixfix,3)/expavg(RSI14,3).
###############################
Jay Kaeppel
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.