DALE !! SHORT-TERM VOLUME & PRICE OSCILLATOR ! Author: Sylvain Vervoort, TASC November 2007 ! Coded by: Richard Denning 9/12/07 ! Background re Heikin-Ashi bars used to compute the tripple ! exponential moving average: ! A type of candlestick chart that shares many characteristics ! with standard candlestick charts, but differs because of the ! values used to create each bar. Instead of using the ! open-high-low-close (OHLC) bars like standard candlestick ! charts, the Heikin-Ashi technique uses a modified formula: ! Formula: ! HAClose = (Open+High+Low+Close) / 4 ! HAOpen = [HAOpen (previous bar) + HAClose (previous bar)] / 2 ! HAHigh = Max (High,HAOpen,HAClose) ! HALow = Min (Low,HAOpen, HAClose) ! Background reTEMA: ! The TEMA is a smoothing indicator with less lag than a ! straight exponential moving average. TEMA is an acronym ! for Triple Exponential Moving Average, but the calculation ! is more complex than that. The TEMA was developed by ! Patrick Mulloy and is described in his articles in the January ! & February1994 issues of TASC magazine. ! Formula: ! TEMA=3xEMA(input)-3 x EMA(EMA(input)+EMA(EMA(EMA(input))) ! CODING ABBREVIATIONS: H is [high]. L is [low]. C is [close]. O is [open]. V is [volume]. ! INPUTS: P1 is 8. !Min=2 , max = 20, default=8 cutoff is 1. !Min=0, max=10, default=1 devH is 1.5. !Min=0.1, max=5, default=1.5 devL is 1.3. !Min=0.1, max=5, default=1.3 devP is 100. !Min 1, max=200, default=100 haC is (O + H +L + C) / 4. DaysInto is ReportDate() - RuleDate(). Stop if DaysInto > 100. stopHAO is iff(stop,O, haO). haO is (valresult(stopHAO,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. P2 is P1 / 1.6. haTemaCL is 3 * (expavg(haCL,P2)) - 3*(expavg(expavg(haCL,P2),P2)) + expavg(expavg(expavg(haCL,P2),P2),P2). haTemaCL1 is valresult(haTemaCL,1). vavg is simpleavg(V,P1 * 5,1). vmax is vavg * 2. vc is iff(V < vmax,V,vmax). vLRs is slope2(vc,P1). vtr is 3 * (expavg(vLRs,P1)) - 3 * (expavg(expavg(vLRs,P1),P1)) + expavg(expavg(expavg(vLRs,P1),P1),P1). vtr1 is valresult(vtr,1). temp1 is iff(haTemaCL > haTemaCL1*(1+cutoff/1000) and countof(vtr >= vtr1,2)>=1 ,vc, iff(haTemaCL < haTemaCL1*(1-cutoff/1000) and countof(vtr > vtr1,2)>=1, -vc,0)). temp2 is sum(temp1,P1) / (vavg+1). SVAPO is 3 * (expavg(temp2,P1)) - 3 * (expavg(expavg(temp2,P1),P1)) + expavg(expavg(expavg(temp2,P1),P1),P1). stdev is sqrt(variance(SVAPO,devP)). upBand is devH * stdev. !Upper band for SVAPO loBand is -devL * stdev. !Lower band for SVAPO ! TEST OF INDICATOR: ! LONG ENTRY RULES: LE if SVAPO < loBand and SVAPO > valresult(SVAPO,1). ! SHORT ENTRY RULES: SE if SVAPO > upBand and SVAPO < valresult(SVAPO,1). !!!-----------------TASC code ends here------------------------------------------- List if 1. OTD is offsetToDate(month(),day(),year()). xDos is scanany(SVAPO < 0 and valresult(SVAPO,1) > 0,50) then OTD. xUos is scanany(SVAPO > 0 and valresult(SVAPO,1) < 0,50) then OTD. daysBlw is countof(SVAPO < 0,^xDos+1). daysAbv is countof(SVAPO > 0,^xUos+1). trndSVAPO is iff(SVAPO < 0, -daysBlw,daysAbv).  Rule Library CCodeViewLE CReportViewSymbol<SESymbol<List Symbol<COhaCOhaCLOhaTemaCOHOhaHOLOhaLOOOhaOO!ABRBUBBBBffBBRBBAAR Bk BrX B.B BrB\ B\ B BrBAAI$A{&A֍&A,&A'A'A$A$AR&A'AAAP(BzBiBG BB9 BBBB9 BAAPLCGCCSDC C C3sCCqCCABBA{A.AAGAzAHAHA33AzAABIQBBgBA)\B)\B{BA)\BAABIXQ@Q@K @sY@Q@@Q@Q@Q@@ABMDGAA@ApBAKAApAADA ?A ?A ?ADAABP(\@Q\@bI_@=h@\@>b@[@[@\@>b@ABTGPB> PBOBSXOBzPBzPBpOBpOBOB0PBABTLA@ C@:C@=G@E@E@A@{A@E@{A@ABXBBoBuBBB(B BB BACASzBRBkB!BB.[BBBB.[BACF ׅA33AAzApApAAA ׅAAACHxBxBSq{BtsB zB~B33wB33wByB~BACIAAA}AHAHAףAA(AAACLSH@@+z@]@@@H@<@33@<@ACN B B B!BG!BG!B{ B{ B B*!BACO= Bp=B9lB ApBB= B= BpBBACSq=HBQHB=HBFBHBHBHBHBHBHBACY= kAQnA iAaA33sA33sA= kA%aAqA%aAADATp?p?L?̦?p?(?p?p?p?(?ADBEp.B-BM-BA(Bp.Bp.Bq=,Bq=,BH,B`-BADCTpAQAϞAXAAA̠A A= A AADIHBBBBq=B:BGBGBRB:BADLR s@zt@Bs@\Am@= w@= w@p@p@= w@?s@ADMzBRxBB*<BB!B33B33B33B!BADPT(l@*\k@)l@li@{n@'*n@h@h@q=j@'*n@ADS{B͌B;B4BBBkBBBBADSK7B= 7B7B^d6B9B9Bp5Bp5B= 6B8BADTNA)AAARAtA33A33AAtAAEIS {A~A$RAAGAxA{zA{zAAxA9nas100 CBackTestPropertyLE1PP(;0SVAPO LENDXPnas100 85@5@~@ 5@SE!PP(;0SVAPO SENDXPnas100 85@5@~@ 5@00:00