Category Archives: Uncategorized

Sylvain Vervoort’s color study – An Expert Of A System

The AIQ code for Sylvain Vervoort’s color study and system described in his article in the October issue of Stocks and Commodities, “An Expert Of A System,” is provided at www.TradersEdgeSystems.com/traderstips.htm.

Figure 1 is a chart of Netflix (NFLX) with a color bar study that shows when the expert system is in a buy mode (green bars). A buy mode occurs when the typical price exponential moving average (typEMA) is above the heinkin-ashi close exponential moving average (haEMA), and the close is above the open after having been in the sell mode. For the sell to be true (red bars), the typEMA must be below the haEMA and the close must be below the open for the initial signal to go short after having been in the buy mode.

FIGURE 1: AIQ, TYPEMA AND HAEMA. Here is a sample chart of NFLX with typEMA (yellow) and haEMA (green), with the color study showing buys (green bars with up white arrows) and sells (red bars with down white arrows).

Figure 1 also shows the two moving averages typEMA in yellow and the haEMA in green. White arrows show the signal dates for the sample trade on NFLX. The entries & exits are the next day at the open. I simplified the system and did not code the stop-loss or the breakeven exits. I ran a test on the NASDAQ 100 from August 11, 2000 to August 9, 2013.

The long-side test results are summarized in Figure 2. The average return for all 13,295 trades is 0.64% per trade before commissions & slippage. This return assumes that all trades are taken. I tested the short side over this same period, and there were 13,256 trades averaging a loss of 1.00% per trade (summary not shown).

FIGURE 8: AIQ, BACKTEST RESULTS. Here is a summary of the backtest results of the long side on the NASDAQ 100 list of stocks from August 11, 2000 to August 9, 2013.

The code and EDS file can be downloaded from www.TradersEdgeSystems.com/traderstips.htm, and is shown below.

! AN EXPERT OF A SYSTEM
! Author: Sylvain Vervoort, TASC, October 2013
! Coded by: Richard Denning
! www.TradersEdgeSystems.com 
! INPUTS:
H is [high].
L is [low].
C is [close].
O is [open].
OSD is offsettodate(month(),day(),year()).
typLen is 5.
haLen is 8.
!----------------HEIKIN-ASHI-----------------    
haC is (O + H +L + C) / 4.
DaysInto is ReportDate() - RuleDate().
end if DaysInto >  30.
endHAO is iff(end,O, haO).
haO is (valresult(endHAO,1)
+valresult(haC,1))/2.
haH is Max(H,max(haO,haC)).
haL is Min(L,min(haO,haC)).
haCL is (haC + haO + haH + haL) / 4.
haEMA is expavg(haCL,haLen).  !PLOT
!---------------end HEIKIN-ASHI---------------
!---------------TYPICAL PRICE ----------------
TYP is (H+L+C)/3.
typEMA is expavg(TYP,typLen). !PLOT
!-----------------end TYPICAL-----------------
!--------------COLOR STUDY--------------------
G if (typEMA >  haEMA and C >  O).
Gos is scanany(G,200) then OSD.
R if typEMA <  haEMA and C <  O.
Ros is scanany(R,200) then OSD.
GREEN if G or ^Gos <  ^Ros. 
RED if  R or ^Ros <  ^Gos.
!-------------end COLOR STUDY-----------------
!-------------TRADING SYSTEM------------------
Buy if G.
ExitBuy if R.
Sell if R.
ExitSell if G.
!-------------end TRADING SYSTEM--------------
—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems http://aiqsystems.com

Oscillator, Smoothed

The AIQ code based on Sylvain Vervoort’s article in the September issue of Stocks & Commodities, “Oscillators, Smoothed,” is provided at www.TradersEdgeSystems.com/traderstips.htm and is also shown below.

In the chart of Sanderson Farms (SANF) with a color bar study that shows potential buys (green bars) when both oscillators are moving up and they are both oversold (below 20). It sells (red bars) when both oscillators are moving down and they are both overbought (above 80). The bands shown are based on the modified Bollinger Bands that are used in the calculation of the modified Percent b oscillator. For comparison purposes, I have also provided the formula for John Bollinger’s original Percent b indicator as well as for the original smoothed %K indicator.

!OSCILLATORS, SMOOTHED
!Author: Sylvain Vervoort, TASC Sept 2013
!Coded by: Richard Denning 7/6/13
!www.TradersEdgeSystems.com
!INPUTS:
C is [close].
H is [high].
L is [low].
smaLen is 2.
smoLen is 3.
sdLen is 18.
kLen is 3.
!CODE FOR MODIFIED PERCENT B INDICATOR:
SMA1 is simpleavg(C,smaLen).
SMA2 is simpleavg(SMA1,smaLen).
SMA3 is simpleavg(SMA2,smaLen).
SMA4 is simpleavg(SMA3,smaLen).
SMA5 is simpleavg(SMA4,smaLen).
SMA6 is simpleavg(SMA5,smaLen).
SMA7 is simpleavg(SMA6,smaLen).
SMA8 is simpleavg(SMA7,smaLen).
SMA9 is simpleavg(SMA8,smaLen).
SMA10 is simpleavg(SMA9,smaLen).
rainbow is (5*SMA1 + 4*SMA2 + 3*SMA3 + 2*SMA4
+ SMA5 + SMA6 + SMA7 + SMA8 + SMA9
+SMA10) / 20.
EMA1 is expavg(rainbow,smoLen).
EMA2 is expavg(EMA1,smoLen).
diff is EMA1 – EMA2.
ZLRB is EMA1 + diff.
EMAZ1 is expavg(ZLRB,smoLen).
EMAZ2 is expavg(EMAZ1,smoLen).
EMAZ3 is expavg(EMAZ2,smoLen).
TEMAZ is 3*EMAZ1 – 3*EMAZ2 + EMAZ3.
SDTEMAZ is sqrt(variance(TEMAZ,sdLen)).
TEMAZ18 is valresult(TEMAZ,18).
TEMAZ17 is valresult(TEMAZ,17).
TEMAZ16 is valresult(TEMAZ,16).
TEMAZ15 is valresult(TEMAZ,15).
TEMAZ14 is valresult(TEMAZ,14).
TEMAZ13 is valresult(TEMAZ,13).
TEMAZ12 is valresult(TEMAZ,12).
TEMAZ11 is valresult(TEMAZ,11).
TEMAZ10 is valresult(TEMAZ,10).
TEMAZ9 is valresult(TEMAZ,9).
TEMAZ8 is valresult(TEMAZ,8).
TEMAZ7 is valresult(TEMAZ,7).
TEMAZ6 is valresult(TEMAZ,6).
TEMAZ5 is valresult(TEMAZ,5).
TEMAZ4 is valresult(TEMAZ,4).
TEMAZ3 is valresult(TEMAZ,3).
TEMAZ2 is valresult(TEMAZ,2).
TEMAZ1 is valresult(TEMAZ,1).
WMA18TEMAZ is (18*TEMAZ + 17*TEMAZ1 + 16*TEMAZ2
+ 15*TEMAZ3 + 14*TEMAZ4 + 13*TEMAZ5
+ 12*TEMAZ6 + 11*TEMAZ7 + 10*TEMAZ8
+ 9*TEMAZ9 + 8*TEMAZ10  + 7*TEMAZ11 
+ 6*TEMAZ12 + 5*TEMAZ13  + 4*TEMAZ14 
+ 3*TEMAZ15 + 2*TEMAZ16 + 1*TEMAZ17 ) /
(18+17+16+15+14+13+12+11+10+9+8+7+6+5+4+3+2+1).
!Plot the following as single line indicator with 50 line:
PBmod is (TEMAZ + 2*SDTEMAZ – WMA18TEMAZ) / (4*SDTEMAZ)*100.
!CODE FOR MODIFIED BOLLIGER BANDS:
BBupMod is TEMAZ + 2*SDTEMAZ. !Plot on chart area
BBdnMod is TEMAZ – 2*SDTEMAZ. !Plot on chart area
!CODE FOR STANDARD PERCENT B:
sdC is sqrt(variance(C,sdLen)).
!For comparison the following is the percent B:
pctB is (C+2*sdC-simpleavg(C,sdLen))/(4*sdC)*100.
!CODE FOR MODIFIED SLOW STOCHASTIC:
typ is (H+L+C)/3.
RBC is (rainbow + typ) / 2.
nom is RBC – lowresult(RBC,kLen).
den is highresult(RBC,kLen) – lowresult(RBC,kLen).
fastKmod is min(100,max(0,100*nom / den)).
Kmod is simpleavg(fastKmod,smoLen).
!CODE FOR STANDARD SLOW STOCHASTIC:
n is (C – lowresult(L,kLen)).
d is (highresult(H,kLen)-lowresult(L,kLen)).
fastK is min(100,max(0,100*n / d)).
slowK is simpleavg(fastK,smoLen).
!COLOR STUDY FOR MODIFIED OSCILLATORS
Green if PBmod >  valresult(PBmod,1)
and Kmod >  valresult(Kmod,1)
and PBmod <  20 and Kmod <  20.
Red if PBmod <  valresult(PBmod,1)
and Kmod <  valresult(Kmod,1)
and PBmod >  80 and Kmod >  80.

—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems

Looking to VXX – Just in Case

In Figure 1 below you will see a chart of ticker VXX, an ETF that tracks the VIX Index. 

jotm20130917-01  
Figure 1 – Ticker VXX (Chart courtesy of AIQ TradingExpert)

Given:

  • The fact that September and October have historically been the scene of a lot of stock market wreckage.
  • That the Fed is due to say “something” about tapering soon
  • The fact that VXX is at about its lowest level in years
  • And the fact that VXX “spikes” to higher ground when the stock market stumbles.

Does it seem at all possible that VXX might be about ready for its next “spike”?  Now understand that that is not a prediction but merely an observation that the possibility seems “ripe”.  So it might be time to consider what I sometimes refer to as a “throwaway” trade.

My definition of a “throwaway” trade is one whereby based on the “possibility” of “something” in particular occurring, one enters into a very low cost trade that has the prospect of paying off in a big way based.  But do not confuse this with a “lottery ticker” mentality, because the trade is based on some realistic expectation that the “something” might actually occur.  Is it really that hard to picture a VIX spike sometime in the September/October timeframe?

So here is one example possibility (though not necessarily a recommendation) using an option on VXX.  This trade was found using software at www.OptionsAnalysis.com.  It involves simply buying 1 November VXX 14 strike price call option for $161.  The particulars appear in Figures 2 and 3.

 20130916-02

Figure 2 – VXX November 14 Call Option (courtesy www.optionsanalysis.com)

jotm20130917-03

Figure 3 – VXX November 14 Call Option (courtesy www.optionsanalysis.com)

If VXX were merely to return to its August 30th high of 17.34, this trade would essentially double in value.  If “something” really crazy happens and VXX soars to sharply higher levels the profit could be quite a bit more.

Again, I am not saying that VXX is sure to soar between now and the end of November.  I’m only saying that I might be willing to risk $161 just in case.

Jay Kaeppel

Chief Market Analyst at JayOnTheMarkets.com and AIQ TradingExpert Pro client

http://jayonthemarkets.com/

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.

The experts are saying.

Here’s August 6th chart of the DJIA with the AIQ Experts say…
we had a 3-97 to the downside. The internal technical metrics feeding this rating were as follows

The 21 day stochastic has declined below the 80% line. The price phase indicator is decreasing. In the current sideways market, this is a weak bearish signal indicating a possible decline in short term price movements.

The exponentially smoothed advance/decline line has turned negative when the up/down volume oscillator and the advance/decline oscillator are already negative. In this market, this is viewed as a bearish signal that could precede a downward price movement.

The up/down volume oscillator has turned negative when the exponentially smoothed advance/decline line and the advance/decline oscillator are already negative. In this market, this is viewed as a bearish signal that could precede a downward price movement.

This rating was confirmed by Price Phase indicator moving down the same day. Phase confirmation eliminates rogue ratings as Price Phase is not a part of the AI rating. Sine August 6th the market has corrected more than 400 points, and up ratings were generated, however the Price Phase has continued declining and has not confirmed these ratings.

Within the Volatility Band

Original article by Sylvain Vervoort Stocks & Commodities August 2013

In Figure 1, I show a chart of CVR Partners LP (UAN) with the setup (yellow circle), the buy signal (green circle) and the exit (red circle). The author indicates that a valid buy signal does not occur unless the closing price has penetrated the lower band and then it closes above the upper band.

On 10/3/11, the close of 20.25 is below the lower band of 20.81 and then we have to wait until 1/3/12 for the close of 26.48 to be above the upper band of 25.36. We would enter the next day at the opening price of 26.57.

We would stay in the trade until the closing price is below the lower band. The exit does not occur for several months on 5/9/12 when the close of 24.45 is below the lower band of 27.76. We would then exit the next day at the open of 24.41 for a loss of $2.07 plus commission and slippage.

The highest close of the trade occurred on 2/2/12, just a few weeks after the entry, for a high open profit of $4.35. The trade would have been profitable if we had used the middle band as the exit. Note that I did not code the suggested trading system as the author indicates that more is to come in future parts of the article series.

Figure 1 – chart of UAN with SVE Volatility Bands and setup (yellow), entry (green) and exit (red) signals for the period 10/3/11 to 5/10/12.
 
EDS Code:Vola Band.EDS
(right click and choose Save As)
 
—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems