This Traders’ Tip is based on “Within The Volatility Band,” which is the fourth part of a seven-part series by Sylvain Vervoort. In this issue, Vervoort discusses volatility bands above and below a median average as levels for a buy & sell swing trading strategy. Breakouts from the upper volatility band signal long positions, and breaks from the lower volatility band indicate short signals. All parameters can be optimized within the system optimizer to determine the most profitable combinations. See Figure 10.
FIGURE 10: UPDATA. This chart shows the volatility band system as applied to the S&P 500 index of daily resolution.
The Updata code for this system has been made available in the Updata library and may be downloaded by clicking the custom menu and then system library. Those who cannot access the library due to a firewall may paste the code into the Updata custom editor and save it.
PARAMETER "Band Period" #BANDPERIOD=8 PARAMETER "Vol. Period" #VOLPERIOD=13 PARAMETER "Deviation Factor" @FACTOR=3.55 PARAMETER "Low Band Adjust" @ADJUST=0.9 NAME "" "" DISPLAYSTYLE 3LINES INDICATORTYPE TOOL PLOTSTYLE LINE RGB(128,0,128) PLOTSTYLE2 DOT RGB(128,0,128) PLOTSTYLE3 DOT RGB(128,0,128) @TypicalPrice=0 @Typical=0 @Deviation=0 @DevHigh=0 @DevLow=0 @MedianAverage=0 FOR #CURDATE=0 TO #LASTDATE @TypicalPrice=(HIGH+LOW+CLOSE)/3 IF @TypicalPrice>HIST(@TypicalPrice,1) @Typical=@TypicalPrice-LOW(1) ELSE @Typical=HIST(@TypicalPrice,1)-LOW ENDIF @Deviation=SGNL(@Typical,#VOLPERIOD,M)*@FACTOR @DevHigh=SGNL(@Deviation,#BANDPERIOD,E) @DevLow=SGNL(@Deviation,#BANDPERIOD,E)*@ADJUST @MedianAverage=SGNL(@TypicalPrice,#BANDPERIOD,E) 'Entries & Exits Upon Band Crossing IF HASX(CLOSE,@MedianAverage+@DevHigh,UP) COVER CLOSE BUY CLOSE ELSEIF HASX(CLOSE,@MedianAverage-@DevLow,DOWN) SELL CLOSE SHORT CLOSE ENDIF 'Line Plots @PLOT=@MedianAverage @PLOT2=@MedianAverage+@DevHigh @PLOT3=@MedianAverage-@DevLow NEXT