# The V-Trade, Part 5: Technical Analysis—Moving Average Support & Resistance And Volatility Bands

The AIQ EDS file for Sylvain Vervoort’s July 2018 article in S&C, “The V-Trade, Part 5: Technical Analysis—Moving Average Support & Resistance And Volatility Bands,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also available below.

```!THE V-TRADE, PART 5
!Author: Sylvain Vervoort, TASC July 2018
!Coded by: Richard Denning 11/15/18

!ABBREVIATIONS:
C is [close].
C1 is valresult(C,1).
C2 is valresult(C,2).
C3 is valresult(C,3).
C4 is valresult(C,4).
C5 is valresult(C,5).
C6 is valresult(C,6).
C7 is valresult(C,7).
C8 is valresult(C,8).
C9 is valresult(C,9).
C10 is valresult(C,10).
C11 is valresult(C,11).
C12 is valresult(C,12).
C13 is valresult(C,13).
C14 is valresult(C,14).
C15 is valresult(C,15).
C16 is valresult(C,16).
C17 is valresult(C,17).
C18 is valresult(C,18).
C19 is valresult(C,19).
PD is {position days}.
PEP is {position entry price}.

!MOVING AVERAGES:
!SIMPLE MOVING AVERAGES:
smaLen1 is 50.
smaLen2 is 100.
smaLen3 is 200.
esaLen is 20.
esaBandPct is 10.

sma1 is simpleavg(C,smaLen1).
sma2 is simpleavg(C,smaLen2).
sma3 is simpleavg(C,smaLen3).

!LINEAR WEIGHTED
LWMA is (C*20+C1*19+C2*18+C3*17+C4*16
+C5*15+C6*14+C7*13+C8*12+C9*11
+C10*10+C11*9+C12*8+C13*7+C14*6
+C15*5+C16*4+C17*3+C18*2+C19*1)/210.

!ESA BANDS:
esa is expavg(C,esaLen).
upperESA is esa*(1+esaBandPct/100).
lowerESA is esa*(1-esaBandPct/100).

!BOLLINGER BANDS:
!SET PARAMETERS FOR BANDS:
BBlen 	is 20.!Default is 20
Mult1 	is 2. !Default is 2
Mult2 	is 2. !Default is 2

Variance is Variance([close],BBlen).
StdDev is Sqrt(Variance).
SMA is simpleavg([close],BBlen).
UpperBB is SMA + StdDev *  Mult1.
LowerBB is SMA - StdDev *  Mult2.

ShowValues if 1.

Squeeze if upperESA > UpperBB and lowerESA < LowerBB.

SqIndicator is iff(Squeeze,1,iff(not Squeeze,0,-1)).

Buy if upperESA < UpperBB  and valrule(Squeeze,1)
and C > sma3 and C<LWMA.
Sell if (PD>=3 and  LWMA < valresult(LWMA,1)) or C < PEP.```

The EDS file contains the code for the various moving averages mentioned in the article as well as code for the Bollinger Bands and exponential bands. I did not code the SVE bands discussed by Vervoort in his article. I coded a system that uses the concept of a squeeze, as discussed in the article.

A squeeze occurs when the Bollinger Bands are inside the exponential bands. Figure 8 shows a sample trade from the system on NVDA.

Figure 9 shows the EDS summary report for a four-year backtest using the NASDAQ 100 list of stocks.

FIGURE 8: AIQ. This shows a sample trade from the squeeze system.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7111548,"math_prob":0.98431945,"size":2531,"snap":"2020-10-2020-16","text_gpt3_token_len":864,"char_repetition_ratio":0.15710329,"word_repetition_ratio":0.016483517,"special_character_ratio":0.3279336,"punctuation_ratio":0.20268007,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96394485,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-10T09:17:35Z\",\"WARC-Record-ID\":\"<urn:uuid:2ddb7b10-2e3c-4ffd-8061-61e1ef067a6d>\",\"Content-Length\":\"43906\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5d56c1b5-c426-43b4-a39b-c47b541d55a7>\",\"WARC-Concurrent-To\":\"<urn:uuid:1d32a6b1-8479-4eb1-a76d-45dbcd3fbd6b>\",\"WARC-IP-Address\":\"107.180.51.15\",\"WARC-Target-URI\":\"http://www.aiqeducation.com/the-v-trade-part-5-technical-analysis-moving-average-support-resistance-and-volatility-bands/\",\"WARC-Payload-Digest\":\"sha1:ZJX5KI6GMCN53QVWOLQ3HHBARGMMKUSZ\",\"WARC-Block-Digest\":\"sha1:J25PEYOIAKAM2YSAHVBCISQQ55GRTCBB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585371893683.94_warc_CC-MAIN-20200410075105-20200410105605-00364.warc.gz\"}"}