Trading Expert Pro - Support
stocks

Stocks and Commodities Magazine



EDS


 
HOME
TRADINGEXPERT PRO
OPTIONEXPERT
OPENING BELL
TRAINING
DATA
TECHNICAL SUPPORT
UPGRADES
CONTACT US

 

S&C October 2000

! Normalization procedures
! Simple Moving Average
! {OscCalc,periods} / SimpleAvg(OscCalc,periods)
! Sample Normalized
MACDSMA is [MACD]/SimpleAvg([MACD],9).
! Standard Deviation
! {OscCalc,periods} / Sqrt(Variance(OscCalc,periods)).
! Sample Normalized
MACDStdDev is [MACD]/Sqrt(Variance([MACD],9)).
! Average True Range
! {OscCalc,periods}/ SimpleAvg(ATR,periods)
! Sample
ATR1 is max([high]-[low],[high]-val([close],1)).
ATR is max(ATR1,val([close],1)-[low]).
NormalizedMACDATR is [MACD]/SimpleAvg(ATR,9).
! Own Historical Range
! 100 * ({OscCalc} - LoVal({OscCalc},N)/ (HiVal({OscCalc,N)-LoVal({OscCalc},N)
! Sample
NormalizedMACDHistRange is 100 * ([MACD] - LoVal([MACD],200)) / (HiVal([MACD],200) - LoVal([MACD],200)).

!The following is the AIQ code for the Telechart scan:
Long if ([close]>20) and (SimpleAvg([volume],50)>500) and ([close] > HiVal([close],5,1)) and ([close]>Val([close],1)+1) and
([volume]> 1.5 * SimpleAvg([volume],50)).
Short if ([close]>20) and (SimpleAvg([volume],50)>500) and ([close] < LoVal([close],5,1)) and
([close]< Val([close],1)-1) and ([volume]> 1.5 * SimpleAvg([volume],50)).

Return to Top of Page

S&C April 2003

!!!! Stocks and Commodities April 2003 - Detecting Breakouts - FVE - Marcos Katsanos

C is [close].
H is [high].
L is [low].
V is [volume].
Vneg is -[volume].
AvgVolume is simpleavg([volume], 22).
Typical is (H+L+C) / 3.
Typicalone is valresult(typical, 1).
Inequality is C - (H + L) /2 + Typical - Typicalone.
Greaterthan03 if inequality > (0.3 * C )/ 100.
Lessthan03 if inequality < (0.3 * C) / 100.
Volumeplus is iff(greaterthan03, v, vneg).
Volumenegative is iff(lessthan03, vneg, 0).
sum is sum(volumeplus, 21).

FVE is ((sum / avgvolume) / 21) * 100.

Return to Top of Page

S&C Aug2000 Ehlers Center of Gravity

!! EDS Code for Ehlers Center of Gravity.
! This code is intended for educational purposes only, and is provided as is for
! Stocks and Commodities Traders Tips Extra, August 2002 issue.
define Length 10.
price is ([high] + [low]) / 2.
count is OffsetToDate(Month(),Day(),Year()).
! Non-delayed Ehlers CG Formula num is Sum(price * (count+1),Length).
denom is Sum(price,Length).
Ehlers is -num/denom.

!Since EDS does not store values in arrays like Easy Language, you must create a separate formula
! for the "Delay" used as the signal line.
Since the Count UDF will always return the number of days in
! the sum from the report date, we simple fake it out by not adding the 1 to count as we did above.
! This just zero's out one day of the formula so we can get the "yesterday" value of the real formula.
num1 is Sum(price * count,Length).
denom1 is Sum(price,Length).
Ehlers1 is -num1/denom1.
CG is Ehlers.
CG1 is ValResult(Ehlers1,1).

Return to Top of Page

S&C July 2002

Price is [close].
Price1 is val([close], 1).
Price2 is val([close], 2).
Price3 is val([close], 3).
Price4 is val([close], 4).
Price5 is val([close], 5).
Price6 is val([close], 6).
FIRFilter is (Price + 2 * Price1 + 3 * Price2 + 3 * Price3 + 2 * Price4 + Price5) / 12.
MinLagFIRFilter is (Price + 3.5 * Price1 + 4.5 * Price2 + 3 * Price3 + 0.5 * Price4 - 0.5 * Price5 - 1.5 * Price6) / 10.5.

Return to Top of Page

 

S&C July 2003

!! July 2003 Stocks and Commodities.
"Find Those Market Tops" by David Hawkins.

!! Thrust Oscillator and Arms Ease of Movement
Thrust is ([Dec Issues] * [Dec Volume]) - ([Adv Issues] * [Adv Volume]).
OSC is Thrust / (([Dec Issues]*[Dec Volume]) + ([Adv Issues]*[Adv Volume])).
AvgOSC is expavg(Osc, 22).
CurrentPrice is ([high] + [low]) / 2.
PreviousPrice is (Val([high], 1) + Val([low], 1)) / 2.
CurrentVolume is ([volume] / 10000) / ([high] - [low]).
EMV is (CurrentPrice - PreviousPrice) / CurrentVolume.
EMVAvg is expavg(EMV, 25).



Return to Top of Page

S&C October 2002

!!! Stocks and Commodities - October 2002 Traders Tips. Authored by Mike Kaden, based on the
!!! article written by Paolo Pezzutti
TrendIndicator if [close]> simpleavg([close],13).
SetUp if [close] < val([close],1).
Trigger if [close]> (([high]-[low])/2)+[low] and [close] > [open].
Exit if [close] < val([high],1).
! Note: Set ADX/R to 14days TrendFilter if [adx]>18.
TrueRange is max([high]-[low],max([high]-val([close],1),val([close],1)-[low])).
AvgTrueRange is SimpleAvg(TrueRange,13).

VolatilityFilter if simpleavg([close],13) >0.01


Return to Top of Page

S&C January 2003

define days 20.
data is [close].
fact is (days + 1)/3.
DaysInto is OffsetToDate(month(),day(),year()).
numx is iff( daysInto = 0, 1, DaysInto + 1).
factx is (numx - fact) * data.
Sx is Sum( factx, days).
MoveTrend is (6/(days * (days +1))) * Sx .


Return to Top of Page

S&C August 2000 Stoch RSI

define standarddev 60.
define periods 14.
LLVofRSI is loval([rsi wilder], periods).
HHVofRSI is hival([rsi wilder], periods).
StochRSI is (val([rsi wilder], periods) - LLVofRSI) / (HHVofRSI - LLVofRSI).
RSI is [rsi wilder].
rdp1 is sqrt(variance(stochrsi, standarddev)) / 0.053.
rdp2 is sqrt(variance(stochrsi, standarddev)) / 0.035.

Return to Top of Page

S&C October 2003 - BBB Indicator

!BBB Indicator TASC article by Vadim Gimelfarb !Coded by Rich Denning 8/14/03 - Stocks and Commodities October 2003
C is [close].
C1 is val([close],1).
O is [open].
H is [high].
L is [low].

BullPwr is iff(C<O, iff(C1< )0,max(H-C1,C-L), max(H-O,C-L)), iff(C>O, iff(C1>O, H-L, max(O-C1,H-L)), iff(H-C>C-L, iff(C1<)0, max(H-C1, C-L), H-O, iff(H-C < C-L, iff(C1>O, H-L, max(O-C1,H-L)), iff(C1>O, max(H-O,C-L), iff(C1 < O, max(O-C1, H-L), H-L)))))).
BearPWR is iff(C>O, iff(C1>O, max(C1-O,H-L), H-L), iff(C>O, iff(C1>O, max(C1-L,H-C), max(O-L,H-C)), iff(H-C>C-L, iff(C1>O, max(C1-O,H-L), H-L), iff(H-C < C-L, iff(C1 >O, max(C1-L,H-C), O-L), iff(C1>O, max(C1-O,H-L), iff(C1 < 0, max(O-L, H-C), H-L)))))).
BBB is expavg(BullPwr, 20) - expavg(BearPwr, 20, 30).



Return to Top of Page

S&C August 2004 - Advancing Issues Momentum

! ADVANCING ISSUES MOMENTUM
! "Boosting Profitability" by Lawrence Chan and Louis Lin
! Coded by Rich Denning 6/10/04
M is 20.
AI is iff([close] - val([close],M) > 0,1,0).
Stk1 is TickerUDF("AA",AI).
Stk2 is TickerUDF("AXP",AI).
Stk3 is TickerUDF("BA",AI).
Stk4 is TickerUDF("C",AI).
Stk5 is TickerUDF("CAT",AI).
Stk6 is TickerUDF("DD",AI).
Stk7 is TickerUDF("DIS",AI).
Stk8 is TickerUDF("EK",AI).
Stk9 is TickerUDF("GE",AI).
Stk10 is TickerUDF("GM",AI).
Stk11 is TickerUDF("HD",AI).
Stk12 is TickerUDF("HON",AI).
Stk13 is TickerUDF("HPQ",AI).
Stk14 is TickerUDF("IBM",AI).
Stk15 is TickerUDF("INTC",AI).
Stk16 is TickerUDF("IP",AI).
Stk17 is TickerUDF("JNJ",AI).
Stk18 is TickerUDF("JPM",AI).
Stk19 is TickerUDF("KO",AI).
Stk20 is TickerUDF("MCD",AI).
Stk21 is TickerUDF("MMM",AI).
Stk22 is TickerUDF("MO",AI).
Stk23 is TickerUDF("MRK",AI).
Stk24 is TickerUDF("MSFT",AI).
Stk25 is TickerUDF("PG",AI).
Stk26 is TickerUDF("SBC",AI).
Stk27 is TickerUDF("T",AI).
Stk28 is TickerUDF("UTX",AI).
Stk29 is TickerUDF("WMT",AI).
Stk30 is TickerUDF("XOM",AI).
AIM is Stk1 + Stk2 + Stk3 + Stk4 + Stk5 + Stk6 +Stk7 + Stk8 + Stk9 + Stk10 + Stk11 + Stk12 + Stk13 + Stk14 + Stk15 + Stk16 +Stk17 + Stk18 + Stk19 + Stk20 + Stk21 + Stk22 + Stk23 + Stk24 + Stk25 + Stk26 +Stk27 + Stk28 + Stk29 + Stk30.
!Plot "AIM" as a custom indicator against the ES1600 or SPX.
BuySignal if valresult(AIM,3) > valresult(AIM,2) and valresult(AIM,2) > valresult(AIM,1) and valresult(AIM,1) < AIM and AIM - valresult(AIM,1) < 5 and AIM < 20.
SellSignal if valresult(AIM,3) < valresult(AIM,2) and valresult(AIM,2) < valresult(AIM,1) and valresult(AIM,1) > AIM and valresult(AIM,1) - AIM < 5 and AIM > 10.
List if 1.



Return to Top of Page

S&C August 2005 - WFS Indicators

!! WHAT FLAVOR SMOOTHING WOULD YOU LIKE?
!! Author: Andrew Tomilinson, TASC July 2005
!! Coded by: Richard Denning 6/09/05
!CODING ABREVIATIONS:
H is [high].
H1 is val([high],1).
L is [low].
L1 is val([low],1).
C is [close].
C1 is val([close],1).
O is [open].

! DONCHIAN PRICE CHANNEL BANDS
DonH14 is highresult(H,14,1). DonL14 is lowresult(L,14,1).

! DONCHIAN PRICE BAND OSCILLATOR
DonPBO is 100 * (C - DonL14) / (DonH14 - DonL14).

! STOCHASTIC RAW CHANNEL
StoH14 is highresult(H,14,0).
StoL14 is lowresult(L,14,0).

! STOCHASTIC RAW OSCILATOR or %K
StoRO is (C - StoL14) / (StoH14 - StoL14).

! SMOOTHED STOCHASTIC OSCILATOR USING
! HARRY SCHIRDING SMOOTHING TECHNIQUE
! Quick Stochastic or %D or Slow %K StoQ is 100 * sum(C - StoL14,3) / sum(StoH14 - StoL14,3).
! Slow Stochastic or Slow %D StoS is simpleavg(StoQ,3).



Return to Top of Page

S&C February 2005 - JB Volatility Sys

! JB VOLATILITY INDICATORS & SYSTEM
! Author: Jim Berg, TASC Feb 2005
! Coded by: Richard Denning 12/9/04
!DEFINE PARAMETERS:
Define F1 10.
!ATR average
Define A1 2.
!Number of ATRs
Define W1 7.
!RSI lookback
Define R1 30.
!RSI oversold level
Define D1 5.
!Lookback for oversold
Define P1 20.
!Lowest low
Define P2 15.
!Trailing stop
Define P3 13.
!PT !CODING ABREVIATIONS:
H is [high].
L is [low].
C is [close].
C1 is val([close],1).
!TRENDING INDICATORS
HH20 is highresult(H,20).
HH20x20 is highresult(H,20,20).
LL20 is lowresult(L,20).
LL20x20 is lowresult(L,20,20).
MA34w is simpleavg(C,34*5).
UpTrend if HH20 > HH20x20 and LL20 > LL20x20 and C > MA34w.
!AVERAGE TRUE RANGE
TR is Max(H-L,max(abs(C1-L),abs(C1-H))).
ATR is expAvg(TR,F1).
!WILDER'S RSI INDICATOR
U is C - C1.
D is C1 - C.
L3 is 2 * W1 - 1.
AvgU3 is ExpAvg(iff(U>0,U,0),L3).
AvgD3 is ExpAvg(iff(D>=0,D,0),L3).
RSI is 100-(100/(1+(AvgU3/AvgD3))).

!LONG ENTRY
OS if RSI < R1.
LE if C > lowresult(L,P1) + A1*ATR and countof(OS,D1) >= 1 and UpTrend and C<20 and C>1.
Example Ticker AAPL 7/16/04

!LONG EXIT TRAILING STOP
TS is highresult(C - A1*ATR,P2).
LXTS if countof(C < TS,2) = 2.
!JB VOLATILITY PROFIT TAKER
PT is expavg(H,P3) + A1*ATR.
LXPT if C > PT.
!COMBINED LONG EXIT LX if LXTS or LXPT.



Return to Top of Page

S&C January 2005 - PSBO Sys

!PENNY STOCK BREAK OUT SYSTEM (PSBO) !Author: Markos Katsanos, TASC, "Detecting Breakouts", January 2005
!Coded by: Richard Denning 11/07/2004
!DEFINE PARAMETERS:
Define P1 30.
!SDCN parameter
Define W1 25.
!ADX parameter
Define D2 150.
!StochSDCN parameter
Define P2 14.
!FVE parameter
Define COEF 0.1.
!FVE parameter
Define X1 12.
!MACD parameter
Define X2 25.
!MACD parameter
Define X3 9.
!MACD parameter
Define S1 10.
!Stochastic parameter
Define S2 3.
!Smooothing parameter
!CODING ABREVIATIONS:
H is [high].
H1 is val([high],1).
L is [low].
L1 is val([low],1).
C is [close].
C1 is val([close],1).
O is [open].
Typical is (H + L + C) / 3.
Typical1 is valresult(Typical,1).
V is [volume].
!STANDARD DEVIATION OF THE CLOSE
SDC is sqrt(variance(C,P1)).
!NORMALIZED STANDARD DEVIATION OF CLOSE
SDCN is SDC / simpleavg([close],P1).
!STOCHASTIC OF CLOSE:
Stoch is (C - lowresult(C,S1)) / (highresult(C,S1) - lowresult(C,S1)) * 100.
StochS is simpleavg(Stoch,S2).
!STOCHASTIC OF STANDARD DEVIATION OF CLOSE
StochSDCNr is (SDCN - lowresult(SDCN,D2)) / (highresult(SDCN,D2) - lowresult(SDCN,D2)) * 100. StochSDCNs is simpleavg(StochSDCNr,S2).
!DMI, ATR & ADX INDICATORS BASED ON WELLS WILDERS FORMULAS:
!Wells Wilder's indicators use a 14 day recursive averaging method
!To convert recursive averaging to exponential averaging use the formula:
!ExponentialPeriods = 2 * WilderPeriod - 1.
F1 is 2 * W1 - 1.
rhigh is H - H1.
rlow is L1 - L.
DMp is iff(rhigh > 0 and rhigh > rlow, rhigh, 0).
DMm is iff(rlow > 0 and rlow >= rhigh, rlow, 0).
AvgDMp is expAvg(DMp,F1).
AvgDMm is expavg(DMm,F1).
TR is Max(H - L,max(abs(C1 - L),abs(C1- H))).
ATR is expAvg(TR,F1).
PlusDMI is (AvgDMp/ATR)*100.
MinusDMI is AvgDMm/ATR*100.
DIdiff is PlusDMI - MinusDMI.
Zero if PlusDMI = 0 and MinusDMI = 0.
DIsum is PlusDMI+MinusDMI.
DX is iff(ZERO,100,abs(DIdiff)/DIsum*100).
ADX is ExpAvg(DX,F1).
!SDCN * ADX:
SDCNADX is SDCN * ADX.
!FINITE VOLUME ELEMENT INDICATOR (FVE):
Intra is ln(H) - ln(L).
Vintra is sqrt(variance(Intra,P2)).
Inter is ln(Typical) - ln(Typical1).
Vinter is sqrt(variance(Inter,P2)).
Cutoff is Coef * (Vinter + Vintra) * C.
MF is C - (H + L) / 2 + Typical - Typical1.
FV is iff(MF > Cutoff, V,iff(MF < Cutoff,-V,0)).
FVE is sum(FV,P2) / simpleavg(V,P2) / P2 * 100.
!MOVING AVERAGE CONVERGENCE DIVERGENCE INDICATOR (MACD):
MACD1 is expavg([Close],X1).
MACD2 is expavg([Close],X2).
MACD is MACD1 - MACD2.
MACDH is MACD - expavg(MACD,X3).
!PRICE, VOLUME AND CAPACITY FILTER (PV)
!Added by Richard Denning, not part of original system
!Assumption: position size to be less than 1% of average volume with $10K size
PV if C <= 5 and C > 0.10 and VE >= 500 and (10000 / C) / (VE * 100) < 0.05.
VE is expavg(V,50).
!PSBO SYSTEM RULES:
Buy if PV and hasdatafor(200) >=180 and FVE > -1 and slope2(C,35) / valresult(C,35) * 100 > -0.35 and slope2(C,35) / valresult(C,35) * 100 < 0.40 and slope2(C,70) / valresult(C,70) * 100 > -0.40 and slope2(C,70) / valresult(C,70) * 100 < 0.40 and slope2(C,170) / valresult(C,170) * 100 > -0.20 and MACDH > -0.003 and StochSDCNs < 20 and C > expavg(C,10) and SDCN * ADX < 1.3 and StochS > 30.
PD is {position days}.
Exit1 if C < highresult(C,PD) * (1 -0.18) or PD >= 70.



Return to Top of Page

S&C May 2005 - UCI

!UNIVERSAL CYCLE INDEX !Author: Stuart Belknap, Cycles in Time and Money
!Coded by: Richard Denning 3/14/05
C is [close].
EMA6 is expavg(C,6).
EMA12 is expavg(C,12).
EMA25 is expavg(C,25).
EMA50 is expavg(C,50).
MA12 is simpleavg(C,12).

MA25 is simpleavg(C,25).
MA50 is simpleavg(C,50).
MA100 is simpleavg(C,100).
!VOLATILITY (SIGOM)
yom is 100*(valresult(C,12) - MA25) / MA25.
avyom is sum(yom,50) / 50.
varyom is sum(yom * yom,50) / 50 - avyom * avyom.
som is valresult(sqrt(varyom),12).
sigom is simpleavg(som,25).
!MINOR CYCLE INDEX (25 BARS)
yme is 100 * (EMA6 - EMA12) / EMA12.
ymes is yme + 6 * slope2(yme,6).
!TSF(yme,6).
ymesn is 100 * ymes / sigom.
!Plot "ymesn" as three line indicator with lines at -50 & 50.
!CENTERED MINOR CYCLE INDEX
ym is 100 * (valresult(MA12,6) - valresult(MA25,12)) / valresult(MA25,12).
ymn is 100 * ym / sigom.
!SECONDARY CYCLE INDEX (50 BARS)
yse is 100 * (EMA12 - EMA25) / EMA25.
yses is yse + 6 * slope2(yse,6).
!TSF(yse,6).
ysesn is 100 * yses / sigom.
!Plot "ysesn" as three line indicator with lines at -100 & 100.
!CENTERED SECONDARY CYCLE INDEX
ys is 100 * (valresult(MA25,12-12) - valresult(MA50,25-12)) / valresult(MA50,25-12).
ysn is 100 * ys / sigom.
!INTERMEDIALTE CYCLE INDEX (100 BARS)
yie is 100 * (EMA25 - EMA50) / EMA50.
yies is yie + 6 * slope2(yie,6).
!TSF(yie,6).
yiesn is 100 * yies / sigom.
!Plot "yiesn" as three line indicator with lines at -150 & 150.
!CENTERED INTERMEDIATE CYCLE INDEX
yi is 100 * (valresult(MA50,25-25) - valresult(MA100,50-25)) / valresult(MA100,50-25).
yin is 100 * yi / sigom.
!REAL TIME CHANNEL LINES
upRT is (1 + 2 * sigom / 100) * MA25.
dnRT is (1 - 2 * sigom / 100) * MA25.
!CENTERED CHANNEL LINES
upCCL is (1 + 2 * sigom / 100) * valresult(MA25,12). dnCCL is (1 - 2 * sigom / 100) * valresult(MA25,12).

Return to Top of Page

S&C November 2004 - TR Specified Value

!TRUE RANGE SPECIFIED VALUE (TRsV) !Author: Vadim Gimelfarb, "Using Volume To Detect Shifts In Power, TASC November 2004
!Coded by: Richard Denning 9/6/04
!FORMULAS
!TRsV = Volume / TR
! TR = true range
!TRUE RANGE Dailyrange is [high]-[low].
YcloseL is abs(val([close],1)-[low]).
YcloseH is abs(val([close],1)-[high]).
TR is Max(Dailyrange,Max(YcloseL,YcloseH)).
!TRsV TRsV is [volume] / TR.
!Plot the above user defined functions as a single-line indicator.
!COLOR BAR ALERT Alert if TRsV > valresult(TRsV,1) * 1.5.
!BULL AND BEAR BALANCE INDICATOR !Author: Vadim Gimelfarb, "Bull and Bear Balance Indicator", TASC Oct 2003, pp. 68-72
!Coded by Richard Denning 8/14/03
!ABBREVIATIONS
C is [close].
C1 is val([close],1).
O is [open].
H is [high].
L is [low].
BullPwr is iff(C < O, iff(C1 > O,iff(C1 > O,max(H-C1,C-L),max(H-O,C-L)),
iff(C>O,iff(C1>O,H-L,max(O-C1,H-L)), iff(H-C>C-L,
iff(C1 < O, max(H-C1, C-L, H-O), iff(H-C > C-L,
iff(C1>O,H-L,max(O-C1,H-L)), iff(C1>O, max(H-O,C-L),
iff(C1< O, max(O-C1, H-L), H-L)))))) * 100.
BearPwr is iff(c >O,iff(C1>O,max(C1-O,H-L),H-L), iff(C>O,iff(C1>O,max(C1-L,H-C),max(O-L,H-C)), iff(H-C>C-L,iff(C1>O,max(C1-O,H-L),H-L),
iff(H-C < C-L, iff(C1 > O,max(C1-L,H-C),O-L),
iff(C1>O,max(C1-O,H-L), iff(C1 < O, max(O-L, H-C), H-L)))))) * 100.
s2BullPwr is simpleavg(BullPwr,2).
s2BearPwr is simpleavg(BearPwr,2).
!Plot s2BullPwr & s2BearPwr as a two line indicator and use in conjunction with TRsV to determine direction of signal
BuyAlert if TRsV > valresult(TRsV,1) * 1.5 and s2BullPwr < s2BearPwr.
SellAlert if TRsV > valresult(TRsV,1) * 1.5 and s2BullPwr > s2BearPwr.
!Use the color bar studies to identify the BuyAlerts and SellAlerts on the chart



Return to Top of Page

S&C February 2004 - Heikinashi

O is [open].
H is [high].
L is [low].
C is [close].
YO is val([open], 1).
YC is val([close], 1).
haClose is (O + H + L + C) / 4.
haOpen is (YO + YC) / 2.
ma1 is max(H, haOpen).
ma2 is max(haOpen, haClose).
ma3 is max(haClose, H).
ma4 is max(ma1,ma2).
ma5 is max(ma2,ma3).
haHigh is max(ma4,ma5).
mi1 is min(L, haOpen).
mi2 is min(haOpen, haClose).
mi3 is min(haClose, L).
mi4 is min(mi1,mi2).
mi5 is max(mi2,mi3).
haLow is max(mi4,mi5).
haDiffCO is haClose - haOpen.

Return to Top of Page

S&C January 2004 - TRIX

!!! Stocks and Commodities January 2004 - article written by Jongseon Kim
ema1 is expavg([close], 5).
ema2 is expavg(ema1, 5).
ema3 is expavg(ema2, 5).
TRIX is (ema3 - valresult(ema3, 1)) / (valresult(ema3, 1)).
SignalTrix is expavg(trix, 3).
GoldenCross if valresult(trix, 1) < valresult(signaltrix, 1) and trix > signaltrix.



Return to Top of Page

S&C May 2004 - Inv Fisher Trans

! INVERSE FISHER TRANSFORM OF RSI
! Coded by Richard Denning 3/5/04
! FIVE DAY WILDER RSI
U is [close]-val([close],1).
D is val([close],1)-[close].
AvgU is ExpAvg(iff(U>0,U,0),9).
AvgD is ExpAvg(iff(D>=0,D,0),9).
RSI is 100-(100/(1+(AvgU/AvgD))).
! IFISHER OF RSI Value1 is 0.1 * (RSI - 50).
Value2 is expavg(Value1,9).
!Exponential average substituted for weighted averaging.
!The author has indicated that either is acceptable for smoothing
IFish is (Exp(2 * Value2) - 1) / (Exp(2 * Value2) + 1) * 100.
!Eihler's amount x 100 for ease of plotting
! Plot IFish as a custom indicator with upper and lower supports of +50 and - 50
!CYBER CYCLE WITH INVERSE FISHER TRANSFORM
!Coded by Richard Denning 3/5/04
Price is ([high] + [low]) / 2.
Price1 is valresult(Price,1).
Price2 is valresult(Price,2).
Price3 is valresult(Price,3).
Smooth is (Price + 2 * Price1 + 2 * Price2 + Price3) / 6.
Smooth1 is valresult(Smooth,1).
Smooth2 is valresult(Smooth,2).
alpha is 0.07.
beta is 1-alpha.
gamma is 1 - 0.5 * alpha.
L is 7.
CycleB is (Price - 2 * Price1 + Price2) / 4.
CycleR is gamma * gamma * (Smooth - 2 * Smooth1 + Smooth2) + 2 * beta * valresult(End, 1 ) - beta * beta * valresult(End,2).
Cycle is CycleR + valresult(CycleB,L+1).
DaysInto is RuleDate() then OffsetToDate(month(),day(),year()).
!ReportDate() - RuleDate().
Stop if DaysInto > L.
End is iff(Stop,CycleB, CycleR).
ICycle is (Exp(2 * Cycle) - 1) / (Exp(2 * Cycle) + 1) * 100.
!Eihler's amount x 100 for ease of plotting
!Plot ICycle as a custom indicator with upper and lower supports of +50 and - 50

Return to Top of Page

S&C October 2005 - FRAMA Fractal Adaptive Moving Average

!! FRAMA Fractal Adaptive Moving Average
!! Author: John Ehlers
!! Coded by Richard Denning 8/9/05
!CODING ABREVIATIONS:
H is [high].
L is [low].
C is [close].
O is [open].
Price is (H+L)/2.
Define N 40.
!MUST BE AN EVEN NUMBER
N3 is (highresult(H,N,0) - lowresult(L,N,0)) / N.
N1 is (highresult(H,N / 2 - 1,0) - lowresult(L,N / 2 - 1,0)) / (N / 2).
N2 is (highresult(H,N / 2,N / 2 - 1) - lowresult(L,N / 2,N / 2 - 1)) / (N / 2).
Dimen is iff(N1 > 0 and N2 > 0 and N3 > 0,(ln(N1 + N2) - ln(N3)) / ln(2),0).
Alpha1 is Exp(-4.6 * (Dimen - 1)).
Alpha is iff(Alpha1 < 0.01,0.01,iff(Alpha1 > 1,1,Alpha1)).
Days is ReportDate() - RuleDate().
Stop if Days > N + 2.
Stopesa is iff(stop,Price, FILT).
FILT is iff(ReportDate() - FirstDataDate() < N + 1,Price, Alpha * price +
(1 - Alpha) * valresult(Stopesa, 1 )).
ESAn is expavg(Price,N).
List if 1.

!EXAMPLE SYSTEM USING FRAMA:
LE if Price > FILT and valrule(Price < FILT,1).
LX if Price < FILT and valrule(Price > FILT,1).

!EXAMPLE SYSTEM USING EXPONENTIAL MOVING AVG:
LE1 if Price > ESAn and valrule(Price < ESAn,1).
LX1 if Price < ESAn and valrule(Price > ESAn,1).

Return to Top of Page

S&C November 2005 - Improve Your Trading System With Speed

! IMPROVE YOUR TRADING SYSTEM WITH SPEED
! Author: Gomu Vetrivel, TASC November 2005
! Coded by: Richard Denning 09/18/05
C is [close].
C1 is val([close],1).
X is abs(C - C1).
MA10 is simpleavg(C,10).
MA5 is simpleavg(C,5).
EntryPr is C1.
ExitPr is C1.

! BASE SYSTEM
LE if C > MA10 and valrule(C < MA10,1).
LX if C < MA5. SE if C < MA10 and valrule(C > MA10,1).
SX if C > MA5.

Return to Top of Page

S&C December 2005 - Trin & Brin

!! TRIN & BRIN: Overhauling Market Breadth by J van den Brink, TASC Dec 2003
! Coded by: Rich Denning 10/10/05
! Note: the indicators are scaled and smoothed for display purposes [not in the article].
TRIN is expavg(iff(market(),([Dec Volume] / [Dec Issues]) / ([Adv Volume] / [Adv Issues]),-9999) * 100,10).
BRIN is expavg(iff(market(),(1 - ([Dec Volume] / [Adv Volume]) * ([Adv Issues] / [Dec Issues])) / Max(1,([Dec Volume] / [Adv Volume]) * ([Adv Issues] / [Dec Issues])),-9999)*1000,10).
ILine is expavg(iff(market(),(1 - Power(([Adv Issues] / [Dec Issues]),2)) / max(1,Power(([Adv Issues] / [Dec Issues]),2)),-9999)*1000,10).
VLine is expavg(iff(market(),(1 - Power(([Dec Volume] / [Adv Volume]),2)) / max(1,Power(([Dec Volume] / [Adv Volume]),2)),-9999)*1000,10).

Return to Top of Page

S&C February 2006 - Self-Adjusting RSI

! SELF-ADJUSTING RSI
! Author: David Sepiashvili, TASC February 2006
! Coded by; Richard Denning 12/07/2005
! CLASSIC WELLS WILDER RSI:
! DEFINE THE RSI PARAMETER:
W1 is 14.
! FORMULA TO CONVERT WILDER TYPE RECURSIVE
! AVERAGING TO EXPONENTIAL AVERAGING:
! ExponentialPeriods = 2 * WilderPeriod - 1. L1 is 2 * W1 - 1.
! RSI FORMULA:
Price is [close].
U is Price - valresult(Price,1).
D is valresult(Price,1)-Price.
AvgU is ExpAvg(iff(U>0,U,0),L1).
AvgD is ExpAvg(iff(D>=0,D,0),L1).
RSI is 100-(100/(1+(AvgU/AvgD))).
! SELF-ADJUSTING BANDS FOR OVERBOUGHT
! AND OVERSOLD LEVELS:
! VERSION 1:
SD is sqrt(variance(RSI,W1)).
K is 1.8.
OB1 is 50 + K * SD.
OS1 is 50 - K * SD.
! VERSION 2:
C is 2.0.
SMArsi is simpleavg(RSI,W1).
OB2 is 50 + C * simpleavg(abs(RSI - SMArsi),W1).
OS2 is 50 - C * simpleavg(abs(RSI - SMArsi),W1).
! ENTRY RULES FOR TEST OF INDICATORS:
! CLASSIC RSI ENTRY RULES:
LC if RSI < 30. HC if RSI > 70.
LE if valrule(LC,1) and not LC.
SE if valrule(HC,1) and not HC.
! SELF-ADJUSTING RSI VERSION 1:
LC1 if RSI < OS1. HC1 if RSI > OB1.
LE1 if valrule(LC1,1) and not LC1.
SE1 if valrule(HC1,1) and not HC1.
! SELF-ADJUSTING RSI VERSION 2:
LC2 if RSI < OS2.
HC2 if RSI > OB2.
LE2 if valrule(LC2,1) and not LC2.
SE2 if valrule(HC2,1) and not HC2.

Return to Top of Page

S&C March 2006 - Trading Trends with Bollinger Bands Z

!!! TRADING TRENDS WITH BOLLINGER BANDS Z (BBZ)
!! Author: Jacinta Chan, TASC February 2006
!! Coded by: Richard Denning 01/06/2006
! BOLLINGER BAND CODE
! Set parameters:
Define L 40.
Define Factor1 0.9.
! Standard Deviation is the square root of variance over length L:
Variance is Variance([close]-SMA,L).
StdDev is Sqrt(Variance).
! Middle Band
SMA is simpleavg([close],L).
! Upper Band BB
Upper is SMA + Factor1 * StdDev.
! Lower Band BB
Lower is SMA - Factor1 * StdDev.
!! Plot the above three bands as single line indicators on chart.
! Z-SCORE CODE Z is ([close] - SMA) / StdDev.
! TRADING SYSTEM RULES USING BOLLINGER BANDS
! Long position entry (LE1) and exit (LX1) rules:
LE1 if [close] > BBUpper and valrule([close] < BBUpper,1) and DF. LX1 if [close] < BBUpper.
! Short position entry (SE1) and exit (SX1) rules:
SE1 if [close] < BBLower and valrule([close] > BBLower,1) and DF. SX1 if [close] > BBLower.
! TRADING SYSTEM RULES USING Z-SCORE
! Long position entry (LE2) and exit (LX2) rules:
LE2 if Z > Factor1 and valrule(Z < Factor1,1) and DF.
LX2 if Z < Factor1.
! Short position entry (SE2) and exit (SX2) rules:
SE2 if Z < -Factor1 and valrule(Z > -Factor1,1) and DF.
SX2 if Z > -Factor1.
! MARKET TIMING RULES FOR TRADING NASDAQ 100
SMA20 is expavg([close],20).
SMA100 is expavg([close],100).
SMA200 is expavg([close],200).
LEn100 if TickerRule("NDX",Z > 1) and TickerRule("NDX",slope2(SMA,5)>0).
LXn100 if TickerRule("NDX",Z < 0.1) or TickerRule("NDX",slope2(SMA,5)<0).
SEn100 if TickerRule("NDX",Z < -0.1) and TickerRule("NDX",slope2(SMA,5)<0) and TickerRule("NDX",[close]< SMA100). SXn100 if TickerRule("NDX", Z> -0.1) or TickerRule("NDX",slope2(SMA,5)>0) or TickerRule("NDX",[close]>SMA100).
! TRADING RULES INCLUDING MARKET TIMING FILTERS
LE3 if LE2 and LEn100.
LX3 if LX2.
SE3 if SE2 and SEn100.
SX3 if SX2 or SXn100.
!DATA FILTER FOR TRADING STOCKS
DF if [close] > 5 and HasDataFor(L+10) > L.
!AIQ LONG TERM RELATIVE STRENGTH
length is 236.
Q3 is length/4.
Q2 is (length - Q3) / 3.
Q1 is (length - Q2 - Q3) / 2.
Q0 is length - Q1 - Q2 - Q3.
ROCq3 is (val([close],Q2,(Q1+Q0)) - val([open],Q3,(Q2+Q1+Q0))) / val([open],Q3,(Q2+Q1+Q0)) * 100. ROCq2 is (val([close],Q1,Q0) - val([open],Q2,(Q1+Q0))) / val([open],Q2,(Q1+Q0)) * 100.
ROCq1 is (val([close],Q0,0) - val([open],Q1,Q0)) / val([open],Q1,Q0) * 100.
ROCq0 is ([close] - val([open],Q0,0)) / val([open],Q0,0) * 100.
RS_AIQ is ROCq0 * 0.38 + ROCq1 * 0.21 + ROCq2 * 0.21 + ROCq3 * 0.21.
!AIQ SHORT TERM RELATIVE STRENGTH lengths is 120.
Q3s is lengths/4.
Q2s is (lengths - Q3s) / 3.
Q1s is (lengths - Q2s - Q3s) / 2.
Q0s is lengths - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s)) - val([open],Q3s,(Q2s+Q1s+Q0s))) / val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s) - val([open],Q2s,(Q1s+Q0s))) / val([open],Q2s,(Q1s+Q0s)) * 100. ROCq1s is (val([close],Q0s,0) - val([open],Q1s,Q0)) / val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0)) / val([open],Q0s,0) * 100.
RS_AIQs is ROCq0s * 0.40 + ROCq1s * 0.20 + ROCq2s * 0.20 + ROCq3s * 0.20.

Return to Top of Page

S&C April 2006 AVERAGE PEAK EXCURSION (APE)

!! AVERAGE PEAK EXCURSION (APE), TASC April 2006

!! Author: Chris Young
!! Coded by: Rich Denning 02/06/06

! HIGHEST HIGH OVER N PERIODS HH2 is hival([high],2).
HH5 is hival([high],5).
HH10 is hival([high],10).
HH20 is hival([high],20).
HH25 is hival([high],25).
! LOWEST LOW OVER N PERIODS
LL2 is loval([low],2).
LL5 is loval([low],5). LL10 is loval([low],10).
LL20 is loval([low],20).
LL25 is loval([low],25).
!OVER N PERIODS AGO
O1 is val([open],1).
O5 is val([open],5).
O10 is val([open],10).
O20 is val([open],20).
O25 is val([open],25).

! PEAK EXCURSION OVER N PERIODS
PE1 is max(abs([high] - [open]),abs([open] - [low])).
PE2 is max(abs(HH2 - O1),abs(O1 - LL2)).
PE5 is max(abs(HH5 - O5),abs(O5 - LL5)).
PE10 is max(abs(HH10 - O10),abs(O10 - LL10)).
PE20 is max(abs(HH20 - O20),abs(O20 - LL20)). PE25 is max(abs(HH25 - O25),abs(O25 - LL25)).

!AVERAGE PEAK EXCURSION OVER N PERIODS
avgP is 250.
APE1 is simpleavg(PE1,avgP).
APE2 is simpleavg(PE2,avgP).
APE5 is simpleavg(PE5,avgP).
APE10 is simpleavg(PE10,avgP). APE20 is simpleavg(PE20,avgP).
APE25 is simpleavg(PE25,avgP).

!RATIOS BETWEEN TIME PERIODS
APEr5_1 is APE5 / APE1.
APEr20_1 is APE20 / APE1.
APEr25_5 is APE25 / APE5.
rDIFF is APEr5_1 - APEr25_5.

! APE ALPHA FOR N PERIODS
APEalp10 is (ln(APE10 / APE1)) / ln(10).
APEalp20 is (ln(APE20 / APE1)) / ln(20).
APEalp25 is (ln(APE25 / APE1)) / ln(25).

! REPORT TO SHOW VALUES OF INDICATOR ON ANY CHOOSEN DATE List if hasdatafor(265) >= 255.

Return to Top of Page

S&C May 2006 - Cross Market Evaluations With Normalized Average True Range

!!! CROSS-MARKET EVALUATIONS WITH
!!! NORMALIZED AVERAGE TRUE RANGE
!!! Author: John Forman, TASC May 2006
!! Coded by: Richard Denning 3/08/06

! AVERAGE TRUE RANGE
NN is 14.
TR is max(H - L,max(abs(C1 - L),abs(C1- H))).
ATR is expavg(TR,NN).

! NORMALIZED AVERAGE TRUE RANGE
N_ATR is ATR / C * 100. !CODING ABBREVIATIONS H is [high]. L is [low]. C is [close]. C1 is val([close],1).

Return to Top of Page

S&C June 2006 - Harnessing the MisBehavior of Markets

!!!! HARNESSING THE (MIS)BEHAVIOR OF MARKETS
!!! Author: Rick Martinelli, TASC June 2006
!!! Coded by: Richard Denning 4/9/06

!! SET PARAMETERS
NN is 3. ! LR LINE LENGTH
DD is 7. ! STD DEV LENGTH
! ALPHA SIGNAL VALUE CUTOFF
Cutoff is 1.25.
XCutOff is iff(symbol()="RMBS",1.00,iff(symbol()="F",1.10, iff(symbol()="GM",1.04,iff(symbol()="SYMC",1.31, iff(symbol()="IBM",1.19,iff(symbol()="SUNW",1.19, iff(symbol()="DELL",1.91,iff(symbol()="GE",2.22, iff(symbol()="CSCO",1.04,iff(symbol()="MSFT",1.00, iff(symbol()="ZIMH",2.04,iff(symbol()="ORCL",1.04, iff(symbol()="AMZN",1.00,iff(symbol()="DJ",1.50, iff(symbol()="INTC",1.34,iff(symbol()="SEBL",1.28, iff(symbol()="SIRI",1.30,iff(symbol()="TWX",1.01, iff(symbol()="QQQQ",1.10,iff(symbol()="DJI",1.40, iff(symbol()="KCS",1.65,iff(symbol()="DIA",1.35, iff(symbol()="DUK",1.00,iff(symbol()="AZN",1.02, iff(symbol()="LSI",1.12,iff(symbol()="WFMI",2.42, iff(symbol()="GOOG",1.41,
iff(symbol()="AAPL",1.38, 2.00 )))) )))) )))) )))) )))) )))) )))).
!! CODING ABBREVIATIONS:
YY is [close].
YY1 is val([close],1).
!! FIND FORECASTED PRICE ONE DAY AHEAD USING
!! NN(3) DAY LINEAR REGRESSION LINE (Excel fx FORECAST)
slope is slope2(YY,NN).
intercept is simpleavg(YY,NN) - (slope * (NN + 1) / 2).
ForeCast is intercept + (NN+1) * slope.
deltaPp is ForeCast - YY.
!! CALCULATE THE STANDARD DEVIATION OF THE
!! LAST DD (7) PRICE CHANGES (Excel fx STDEVP)
deltaP is YY - YY1.
SDPdeltaP is sqrt(variance(deltaP,DD) * ( ( DD*(DD-1) ) / (DD*DD) )).
!! CALCULATE ALPHA AS FORECASTED PRICE
!! CHANGE DIVIDED BY THE STANDARD DEVIATION
Alpha is deltaPp / SDPdeltaP.
!! DATA FILTER FOR PRICE (>$4) AND VOLUME (>500k avg)
PV if YY > 4 and expavg([volume],50) > 5000.
!! TRADING BUY AND SELL SHORT RULES BASED
!! ON ALPHA AND CUTOFF
LE if Alpha > CutOff and PV. ! LONG ENTRY BUY SIGNAL
SE if Alpha < -Cutoff and PV. ! SHORT ENTRY SELL SIGNAL
!! ENTER TRADES AT THE CLOSE AND EXIT NEXT
!! DAY AT THE CLOSE
EntryPr is YY1.
ExitPr is YY1.

Return to Top of Page

S&C July 2006 - Wilson Relative Price Channel

!! WILSON RELATIVE PRICE CHANNEL (WRP Channel)
!! Author: Leon Wilson, TASC July 2006
! Coded by: Richard Denning 05/09/2006
! DEFINE PARAMETERS
Define P1 34. ! RSI periods
Define S1 1. ! Smoothing
Define V2 70. ! Upper RSI value
Define V3 30. ! Lower RSI value
Define V4 55. ! Upper RSI neutral value
Define V5 45. ! Lower RSI neutral value
! WILDER RSI INDICATOR
C is [close].
C1 is val([close],1).
U is C - C1.
D is C1 - C.
L1 is 2 * P1 - 1.
AvgU is ExpAvg(iff(U>0,U,0),L1).
AvgD is ExpAvg(iff(D>=0,D,0),L1).
RSIw is 100-(100/(1+(AvgU/AvgD))).
! AIQ RSI INDICATOR (WRP Channel uses RSIe)
AvgUe is ExpAvg(iff(U>0,U,0),P1).
AvgDe is ExpAvg(iff(D>=0,D,0),P1).
RSIe is 100-(100/(1+(AvgUe/AvgDe))).
! SET RSI TYPE
RSI is RSIe.
! WRP CHANNEL
OB is expavg(RSI - V2,S1).
OS is expavg(RSI - V3,S1).
NZU is expavg(RSI - V4,S1).
NZL is expavg(RSI - V5,S1).
OverS is C - (C * (OS/100)).
OverB is C - (C * (OB/100)).
NeutU is C - (C * (NZU/100)).
NeutL is C - (C * (NZL/100)).
! TRADING SYSTEM USING WRP Channels
LE if C > NeutL and valrule(C < NeutL,1).
LE1 if C > NeutL and valrule(C < NeutL,1) and countof([ADX]<15,10)>=1.
LE2 if C > NeutL and valrule(C < NeutL,1) and countof([ADX]>24,10)>=1.
LX if (C < OverB and valrule(C > OverB,1)) or (C < NeutU and valrule(C > NeutU,1)) or countof(C < NeutL,2).
!AIQ RELATIVE STRENGTH 1
length is 60. !60 !80 !120
Q3 is length/4.
Q2 is (length - Q3) / 3.
Q1 is (length - Q2 - Q3) / 2. Q0 is length - Q1 - Q2 - Q3.
ROCq3 is (val([close],Q2,(Q1+Q0)) - val([open],Q3,(Q2+Q1+Q0))) / val([open],Q3,(Q2+Q1+Q0)) * 100.
ROCq2 is (val([close],Q1,Q0) - val([open],Q2,(Q1+Q0))) / val([open],Q2,(Q1+Q0)) * 100. ROCq1 is (val([close],Q0,0) - val([open],Q1,Q0)) / val([open],Q1,Q0) * 100.
ROCq0 is ([close] - val([open],Q0,0)) / val([open],Q0,0) * 100.
RS_AIQ is ROCq0 * 0.38 + ROCq1 * 0.21 + ROCq2 * 0.21 + ROCq3 * 0.20.
!AIQ RELATIVE STRENGTH 2
lengths is 30. !20 !30 !240
Q3s is lengths/4.
Q2s is (lengths - Q3s) / 3.
Q1s is (lengths - Q2s - Q3s) / 2.
Q0s is lengths - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s)) - val([open],Q3s,(Q2s+Q1s+Q0s))) / val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s) - val([open],Q2s,(Q1s+Q0s))) / val([open],Q2s,(Q1s+Q0s)) * 100.
ROCq1s is (val([close],Q0s,0) - val([open],Q1s,Q0)) / val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0)) / val([open],Q0s,0) * 100.
RS_AIQs is ROCq0s * 0.40 + ROCq1s * 0.20 + ROCq2s * 0.20 + ROCq3s * 0.20.

Return to Top of Page

S&C August 2006 - Modeling the Market

!!! MODELING THE MARKET, TASC August 2006
!! Author: John F. Ehlers
!! Coded by: Richard Denning 6/09/06
!! INSTANANEOUS TRENDLINE
C is [close].
H is [high]. L is [low].
Price is (H+L)/2.
LL is 20.
SMA is simpleavg(Price,LL).
Slope is Price - valresult(Price,LL - 1).
sSlope is (Slope + 2 * valresult(Slope,1) + 2 * valresult(Slope,3) + valresult(Slope,3)) / 6. ITrend is SMA + 0.5 * sSlope.
!! CYCLIC COMPONENT
SS is 2 * LL +1.
Alpha is (1 - sin(360 / LL)) / cos(360 / LL).
HP is expavg((1 + alpha) * (Price - valresult(Price,1)),SS).
sHP is (HP + 2 * valresult(HP,1) + 2 * valresult(HP,2) + valresult(HP,3)) / 6.
!! MODELING THE MARKET
Model is ITrend + sHP.

Return to Top of Page

S&C September 2006 - TRADING WITH AN ADAPTIVE PRICE ZONE

!! TRADING WITH AN ADAPTIVE PRICE ZONE
! Author: Lee Leibfarth, TASC September, 2006
! Coded by: Richard Denning 07/06/06
! CODING ABBREVIATIONS:
H is [high].
L is [low].
C is [close].
Price is C.
LL1 is 65.
BB1 is 1.8.
PP1 is round(sqrt(LL1)).
dsEMA is expavg(expavg(Price,PP1),PP1).
RdsEMA is expavg(expavg(H - L,PP1),PP1).
UpAPZ is dsEMA + BB1 * RdsEMA.
DnAPZ is dsEMA - BB1 * RdsEMA.
! COLOR BAR STUDY
Green if L <= DnAPZ and [ADX] < 30.
Red if H >= UpAPZ and [ADX] < 30.
! TRADING SYSTEM ADXco is 30.
! Note: set ADX value to default of 14.
LE if [ADX] <= ADXco and L <= DnAPZ.
LX if [ADX] > ADXco or H >= UpAPZ.
SE if [ADX] <= ADXco and H >= UpAPZ.
SX if [ADX] > ADXco or L <= DnAPZ.
! RANKING ADX is [ADX].
RC30 is (C / valresult(C,30) - 1) * 100.

Return to Top of Page

S&C October 2006 - Relative Strength Spread

!! RELATIVE SPREAD STRENGTH
! Author: Ian Copsey, TASC October 2006
! Coded by Richard Denning 8/10/06
!! RAPID RSI:
A1 is 17.
U is [close]-val([close],1).
D is val([close],1)-[close].
SumU is sum(iff(U > 0,U,0),A1).
SumD is sum(iff(D > 0,D,0),A1).
RSI is 100 - (100 / (1+ (SumU / SumD))).
!! RELATIVE SPREAD STRENGTH
A2 is 14.
E1 is expavg([close],10).
E2 is expavg([close],40).
S1 is E1 - E2.
US is S1 - valresult(S1,1).
DS is valresult(S1,1) - S1.
avgUS is expavg(iff(US > 0,US,0),A2).
avgDS is expavg(iff(DS >= 0,DS,0),A2).
RSS is expavg(100 - (100 / (1 + (avgUS/avgDS))),5).
!! SIMPLE TRADING SYSTEM TO TEST RSS INDICATOR
LE1 if RSS < 30.
LX if RSS > 70 or {position days} >= 5.
SE1 if RSS > 95.
SX if RSS < 30 or {position days} >= 5.

Return to Top of Page

S&C November 2006 - Pivot Finder

!! PIVOTS-FIVE LOW AND FIVE HIGH
! Coded by: Richard Denning 9/12/06
!COMMON SETUP INFORMATION
Define periods 252.
!Total look back period
Define strength 12.
!Number of bars on each side of pivot
OTD is Offsettodate(Month(),Day(),Year()).
LowR is LoVal([low],(2*strength)+1).
LowM is Val([low],strength).
LS if LowR = LowM.
HighR is HiVal([high],(2*strength)+1).
HighM is Val([high],strength).
HS if HighR = HighM.
!FIND FIRST PIVOT LOW
LT1 is scanany(LS,periods) then OTD .
LO1 is ^LT1 + Strength.
LO1dte is SetDate(LO1).
LowLO1 is val([low],^LO1).
!FIND SECOND PIVOT LOW THAT IS BEFORE THE FIRST PIVOT LOW
LT2 is scanany(LS,periods,LO1) then OTD.
LO2 is ^LT2 + Strength.
LO2dte is SetDate(LO2).
LowLO2 is val([low],^LO2).
!FIND THIRD PIVOT LOW THAT IS BEFORE THE SECOND PIVOT LOW
LT3 is scanany(LS,periods,LO2) then OTD.
LO3 is ^LT3 + Strength.
LO3dte is SetDate(LO3).
LowLO3 is val([low],^LO3).
!FIND FORTH PIVOT LOW THAT IS BEFORE THE THIRD PIVOT LOW
LT4 is scanany(LS,periods,LO3) then OTD.
LO4 is ^LT4 + Strength.
LO4dte is SetDate(LO4).
LowLO4 is val([low],^LO4).
!FIND FIFTH PIVOT LOW THAT IS BEFORE THE FORTH PIVOT LOW
LT5 is scanany(LS,periods,LO4) then OTD.
LO5 is ^LT5 + Strength.
LO5dte is SetDate(LO5).
LowLO5 is val([low],^LO5). !__________________________________________________________
!FIND FIRST PIVOT HIGH
HT1 is scanany(HS,periods,0) then OTD .
HO1 is ^HT1 + Strength.
HO1dte is SetDate(HO1).
HighHO1 is val([high],HO1).
!FIND SECOND PIVOT HIGH THAT IS BEFORE THE FIRST PIVOT HIGH
HT2 is scanany(HS,periods,HO1) then OTD.
HO2 is ^HT2 + Strength.
HO2dte is SetDate(HO2).
HighHO2 is val([high],HO2).
!FIND THIRD PIVOT HIGH THAT IS BEFORE THE SECOND PIVOT HIGH
HT3 is scanany(HS,periods,HO2) then OTD.
HO3 is ^HT3 + Strength.
HO3dte is SetDate(HO3).
HighHO3 is val([high],HO3).
!FIND FORTH PIVOT HIGH THAT IS BEFORE THE THIRD PIVOT HIGH
HT4 is scanany(HS,periods,HO3) then OTD.
HO4 is ^HT4 + Strength.
HO4dte is SetDate(HO4).
HighHO4 is val([high],HO4).
!FIND FIFTH PIVOT HIGH THAT IS BEFORE THE FORTH PIVOT HIGH
HT5 is scanany(HS,periods,HO4) then OTD.
HO5 is ^HT5 + Strength.
HO5dte is SetDate(HO5).
HighHO5 is val([high],HO5). !_____________________________________________________________
!MACD VALUES AT PIVOT POINTS
macdLO1 is val([MACD Osc],LO1).
macdLO2 is val([MACD Osc],LO2).
macdLO3 is val([MACD Osc],LO3).
macdLO4 is val([MACD Osc],LO4).
macdLO5 is val([MACD Osc],LO5).
macdHO1 is val([MACD Osc],HO1).
macdHO2 is val([MACD Osc],HO2).
macdHO3 is val([MACD Osc],HO3).
macdHO4 is val([MACD Osc],HO4).
macdHO5 is val([MACD Osc],HO5).
!MACD DIVERGENCE SYSTEM USING PIVOTS
!MACD PARM (12,25,9)
!STOCHASTIC,SK-SD PARM (21,2,2)
PV if [close] > 15 and [Volume ESA] > 10000.
MACDdivgP if PV and [close] < LowLO1 and LowLO1 > LowLO2 and [SK] > [SD] and valrule([SK] < [SD],1) and [MACD Osc] > macdLO1.
MACDdivgN if PV and [close] > HighHO1 and HighHO1 < HighHO2 and [SK] < [SD] and valrule([SK] > [SD],1) and [MACD Osc] < macdHO1.
PD is {position days}.
SX if PD >= 5.
LX if PD >= 17 .
!____________________________________________________________
!REPORTS
ListAll if 1.
Pdates if 1.
Pivots if 1.
POS if 1.

Return to Top of Page

S&C December 2006 - Stochastics with Moving Average Filter

! Enter Long (Buy) at the current daily price close of the S&P 500 Stock Index Futures
! CSI Perpetual Contract when %K Stochastic (with K equal to seven days, and
! smoothed by a three-day simple moving average) is less than 30 and the current
! day's price close is greater than yesterday's 271-day exponential moving average
! of the daily closing prices.
! Close Long (Sell) at the current daily price close of the S&P 500 Stock Index Futures
! CSI Perpetual Contract when %K Stochastic (with K equal to seven days, and smoothed
! by a three-day simple moving average) is greater than 70 or the current day's price
! close is less than yesterday's 271-day exponential moving average of the daily closing prices.
! Enter Short (Sell Short) at the current daily price close of the S&P 500 Stock Index Futures ! CSI Perpetual Contract when %K Stochastic (with K equal to seven days, and smoothed
! by a three-day simple moving average) is greater than 70 and the current day's price close
! is less than yesterday's 271-day exponential moving average of the daily closing prices.
! Close Short (Cover) at the current daily price close of the S&P 500 Stock Index Futures
! CSI Perpetual Contract when %K Stochastic (with K equal to seven days, and smoothed
! by a three-day simple moving average) is less than 30 or the current day's price close
! is greater than yesterday's 271-day exponential moving average of the daily closing prices.
!! STOCHASTICS WITH MOVING AVERAGE FILTER (SMAF)
! Author: Robert Colby, interview, TASC December 2006
! Coded by: Richard Denning 10/09/06
!! STOCHASTICS & SK-SD [%K-%D]
Define L 7.
Define S1 3.
! %K NO SMOOTHING:
Stoch is 100*(([close] - loval([low],L)) / (hival([high],L) - loval([low],L))).
! SMOOTHED %K:
SK is SimpleAvg(Stoch,S1).
! 271-DAY EXPONENTIAL AVERAGE:
EMA271 is expavg([close],271).
! LONG ENTRY RULE:
LE if SK<30 and [close] > valresult(EMA271,1) and hasdatafor(280)>=271.
! LONG EXIT RULE:
LX if SK>70 or [close]< valresult(EMA271,1).
! SHORT ENTRY RULE:
SE if SK>70 and [close]< valresult(EMA271,1) and hasdatafor(280)>=271.
! SHORT EXIT RULE: SX if SK<30 or [close]>valresult(EMA271,1).
! SMAF AS MARKET TIMING:
LE_MKT if TickerRule("NDX",LE).
LX_MKT if TickerRule("NDX",LX).
SE_MKT if TickerRule("NDX",SE).
SX_Mkt if TickerRule("NDX",SX).
! SMAF AS GROUP TIMING:
LE_GRP if TickerRule(RSTicker(),LE).
LX_GRP if TickerRule(RSTicker(),LX).
SE_GRP if TickerRule(RSTicker(),SE).
SX_GRP if TickerRule(RSTicker(),SX).
PV if [close] > 5 and expavg([volume],50) > 5000.
! SMAF AS MARKET, GROUP, & STOCK TIMING:
LE_MGS if LE_MKT and LE_GRP and LE and PV.
LX_MGS if LX_MKT or LX_GRP or LX.
SE_MGS if SE_MKT and SE_GRP and SE and PV.
SX_MGS if SX_MKT or SX_GRP or SX.
! AIQ RELATIVE STRENGTH REPORTS
! Parameters supplied by AIQ for weights were 40%, 20%, 20%, 20%.
Define length 30.
Q3 is length/4.
Q2 is (length - Q3) / 3.
Q1 is (length - Q2 - Q3) / 2.
Q0 is length - Q1 - Q2 - Q3.
ROCq3 is (val([close],Q2,(Q1+Q0)) - val([open],Q3,(Q2+Q1+Q0))) / val([open],Q3,(Q2+Q1+Q0)) * 100.
ROCq2 is (val([close],Q1,Q0) - val([open],Q2,(Q1+Q0))) / val([open],Q2,(Q1+Q0)) * 100. ROCq1 is (val([close],Q0,0) - val([open],Q1,Q0)) / val([open],Q1,Q0) * 100.
ROCq0 is ([close] - val([open],Q0,0)) / val([open],Q0,0) * 100.
RS_AIQ is ROCq0 * 0.40 + ROCq1 * 0.20 + ROCq2 * 0.20 + ROCq3 * 0.20.

Return to Top of Page

S&C January 2007 - Entropic Analysis of Equity Prices

!! ENTROPIC ANALYSIS OF EQUITY PRICES
! Author: Ron McEwan TASC Nov 2006 p. 56
! Coded by: Richard Denning 10/30/06
N is 30.
C is [close].
C1 is val([close],1).
EMA20 is expavg(C,20).
SMA50 is simpleavg(C,50).
LnRC1 is ln(C / C1).
SMAn is simpleavg(LnRC1,N).
RMS is sqrt((sum(LnRC1 * LnRC1,N)) / N).
EP is (((SMAn / RMS) + 1) / 2) * 100.
!! SYSTEM 1:
! Long if above 50 , exit long if less than or equal to 50
LE if countof(EP > 50,2)=2 and countof(EP > 50,10,2)=0 and slope2(EMA20,5)>0 and hasdatafor(100)>=60.
LX if countof(EP <= 50,2)=2.
!! SYSTEM 2:
!Set parameters for bands on EP:
Define L 20.
Define Factor1 2.
Define Factor2 2.5.
!Standard Deviation of EP:
Variance is Variance(EP,L).
StdDev is Sqrt(Variance).
!Middle EP Band
SMA is simpleavg(EP,L).
!Upper EP Bands
UpperEP1 is SMA + Factor1 * StdDev.
UpperEP2 is SMA + Factor2 * StdDev.
!Lower EP Bands
LowerEP1 is SMA - Factor1 * StdDev.
LowerEP2 is SMA - Factor2 * StdDev.
!Use bands on the EP indicatior to generate signals:
LE1 if EP > LowerEP1 and valrule(EP < LowerEP1,1) and TickerRule("NDX",slope2(SMA50,5)>0) and hasdatafor(100)>=60.
LX1 if EP > UpperEP1 or slope2(SMA50,5)<0.
SE1 if EP < UpperEP2 and valrule(EP > UpperEP2,1) and TickerRule("NDX",slope2(SMA50,5)<0) and hasdatafor(100)>=60.
SX1 if EP 0.
!AIQ LONG TERM RELATIVE STRENGTH
!Coded by Rich Denning on 12/14/00
W is 1.
LTL is 120/W.
Q3 is LTL/4.
Q2 is (LTL - Q3) / 3.
Q1 is (LTL - Q2 - Q3) / 2.
Q0 is LTL - Q1 - Q2 - Q3.
ROCq3LT is (val([close],Q2,(Q1+Q0)) - val([open],Q3,(Q2+Q1+Q0))) / val([open],Q3,(Q2+Q1+Q0)) * 100.
ROCq2LT is (val([close],Q1,Q0) - val([open],Q2,(Q1+Q0))) / val([open],Q2,(Q1+Q0)) * 100. ROCq1LT is (val([close],Q0,0) - val([open],Q1,Q0)) / val([open],Q1,Q0) * 100.
ROCq0LT is ([close] - val([open],Q0,0)) / val([open],Q0,0) * 100.
RS_AIQLT is ROCq0LT * 0.40 + ROCq1LT * 0.20 + ROCq2LT * 0.20 + ROCq3LT * 0.20. RS_AIQLT1 is valresult(RS_AIQLT,1).
GRS_AIQLT is TickerUDF(RSticker(),RS_AIQLT).
GRS_AIQLT1 is valresult(GRS_AIQLT,1).
OTC_AIQLT is TickerUDF("OTC",RS_AIQLT).
!AIQ MID TERM RELATIVE STRENGTH
!Coded by Rich Denning on 12/14/00
MTL is 60/W.
Q3m is MTL / 4.
Q2m is (MTL - Q3m) / 3.
Q1m is (MTL - Q2m - Q3m) / 2.
Q0m is MTL - Q1m - Q2m - Q3m.
ROCq3m is (val([close],Q2m,(Q1m+Q0m)) - val([open],Q3m,(Q2m+Q1m+Q0m))) / val([open],Q3m,(Q2m+Q1m+Q0m)) * 100.
ROCq2m is (val([close],Q1m,Q0m) - val([open],Q2m,(Q1m+Q0m))) / val([open],Q2m,(Q1m+Q0m)) * 100.
ROCq1m is (val([close],Q0m,0) - val([open],Q1m,Q0)) / val([open],Q1m,Q0) * 100.
ROCq0m is ([close] - val([open],Q0m,0)) / val([open],Q0m,0) * 100.
RS_AIQmt is ROCq0m * 0.40 + ROCq1m * 0.20 + ROCq2m * 0.20 + ROCq3m * 0.20. RS_AIQmt1 is valresult(RS_AIQmt,1).
GRS_AIQmt is TickerUDF(RSticker(),RS_AIQmt).
GRS_AIQmt1 is valresult(GRS_AIQmt,1).
OTC_AIQmt is TickerUDF("OTC",RS_AIQmt).
!AIQ VERY SHORT TERM RELATIVE STRENGTH
!Coded by Rich Denning on 12/14/00
!Parameters supplied by AIQ for weights were 40%, 20%, 20%, 20%. STL is 30/W. Q3s is STL / 4.
!! Code error discovered 6/28/06 was
LTL / 4 Q2s is (STL - Q3s) / 3.
Q1s is (STL - Q2s - Q3s) / 2.
Q0s is STL - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s)) - val([open],Q3s,(Q2s+Q1s+Q0s))) / val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s) - val([open],Q2s,(Q1s+Q0s))) / val([open],Q2s,(Q1s+Q0s)) * 100.
ROCq1s is (val([close],Q0s,0) - val([open],Q1s,Q0)) / val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0)) / val([open],Q0s,0) * 100.
RS_AIQst is ROCq0s * 0.40 + ROCq1s * 0.20 + ROCq2s * 0.20 + ROCq3s * 0.20. RS_AIQst1 is valresult(RS_AIQst,1).
GRS_AIQst is TickerUDF(RSticker(),RS_AIQst).
GRS_AIQst1 is valresult(GRS_AIQst,1).
OTC_AIQst is TickerUDF("OTC",RS_AIQst).

Return to Top of Page

S&C February 2007 - Anticipating Moving Average Crossovers

!! ANTICIPATING MOVING AVERAGE CROSSOVERS
! Author: Dimitris Tsokakis, TASC, February 2006
! Coded by: Rich Denning 12/06/06
C is [close].
P is 20.
K is 30.
MAP is simpleavg(C,P).
MAK is simpleavg(C,K).
MAP_1 is simpleavg(C,P-1).
MAK_1 is simpleavg(C,K-1).
TC is (P * (K - 1) * MAK_1 - K * (P - 1) * MAP_1) / (K - P).
! MA CROSS OVERS SYSTEM (TRADITIONAL)
LExu if MAP > MAK and valrule(MAP < MAK,1).
SExd if MAP < MAK and valrule(MAP > MAK,1).
! TC CROSS OVER SYSTEM
LEtcxd if TC < C and valrule(TC > C,1).
SEtcxu if TC > C and valrule(TC < C,1).
MA200 is simpleavg(C,200).
MA50 is simpleavg(C,50).
MA10 is simpleavg(C,10).
TFLndx is TickerRule("NDX",slope2(MA50,5) > 0). ! and slope2(MA10,5) > 0).
TFSndx is TickerRule("NDX",slope2(MA50,5) < 0). ! and slope2(MA10,5) < 0).
LExu1 if LExu and TFLndx.
SExd1 if SExd and TFSndx.
LEtcxd1 if LEtcxd and TFLndx.
SEtcxu1 if SEtcxu and TFSndx.
!AIQ VERY SHORT TERM RELATIVE STRENGTH
!Coded by Rich Denning on 12/14/00
!Parameters supplied by AIQ for weights were 40%, 20%, 20%, 20%.
W is 1.
STL is 30/W.
Q3s is STL / 4. !! Code error discovered 6/28/06 was LTL / 4
Q2s is (STL - Q3s) / 3.
Q1s is (STL - Q2s - Q3s) / 2.
Q0s is STL - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s)) - val([open],Q3s,(Q2s+Q1s+Q0s))) / val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s) - val([open],Q2s,(Q1s+Q0s))) / val([open],Q2s,(Q1s+Q0s)) * 100.
ROCq1s is (val([close],Q0s,0) - val([open],Q1s,Q0s)) / val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0)) / val([open],Q0s,0) * 100.
RS_AIQst is ROCq0s * 0.40 + ROCq1s * 0.20 + ROCq2s * 0.20 + ROCq3s * 0.20. RS_AIQst1 is valresult(RS_AIQst,1).
GRS_AIQst is TickerUDF(RSticker(),RS_AIQst).
GRS_AIQst1 is valresult(GRS_AIQst,1).
OTC_AIQst is TickerUDF("OTC",RS_AIQst).

Return to Top of Page

S&C March 2007 - Anticipating Moving Average Crossovers II

!! ANTICIPATING CROSSOVERS
II ! Author: Dimitris Tsokakis, TASC, March 2007
! Coded by: Richard Denning 01/09/07
C is [close].
P is 20.
K is 30.
! STOCHASTICS & SK-SD [%K-%D]
Define L 21. !(Default=21)
Define S2 10. !(Default=10)
Define S3 10. !(Default=10)
Stoch is 100*(([close] - loval([low],L)) / (hival([high],L) - loval([low],L))).
SK is SimpleAvg(Stoch,S2). !Smoothed %K,
SD is SimpleAvg(SK,S3). !Smoothed %D
SK_1 is simpleavg(Stoch,K-1).
SP_1 is simpleavg(Stoch,P-1).
TC1 is (P * (K - 1) * SK_1 - K * (P - 1) * SP_1) / (K - P).
! TREND FILTER
MA50 is simpleavg(C,50).
TFLndx is TickerRule("NDX",slope2(MA50,5) > 0).
TFSndx is TickerRule("NDX",slope2(MA50,5) < 0).
! MA CROSS OVERS SYSTEM (TRADITIONAL)
LExu2 if SK > SD and valrule(SK < SD,1).
SExd2 if SK < SD and valrule(SK > SD,1).
! TC1 CROSS OVER SYSTEM
LEtc1xd if TC1 < SD and valrule(TC1 > SD,1).
SEtc1xu if TC1 > SD and valrule(TC1 < SD,1).
! TRADING SYSTEM WITH TREND FILTER
LExu3 if LExu2 and TFLndx.
SExd3 if SExd2 and TFSndx.
LEtcxd3 if LEtc1xd and TFLndx.
SEtcxu3 if SEtc1xu and TFSndx.


Return to Top of Page

S&C April 2007 - Two Point Rate of Change

!! TWO-POINT RATE OF CHANGE, TASC April 2007
! Authors: Martti Luoma & Jussi Nikkinen
! Coded by: Richard Denning 02/05/07
! TRADITIONAL RATE OF CHANGE INDICATORS:
Pr is [close].
ROC1 is (Pr / valresult(Pr,1) - 1) * 100.
ROC20 is (Pr / valresult(Pr,20) - 1) * 100.
ROCn is (Pr / valresult(Pr,N) - 1) * 100.
ROCn2 is (Pr / valresult(Pr,N2) - 1) * 100.
! ADJUSTED RATE OF CHANGE INDICATOR:
N is 20.
N2 is 5.
ROCadj is expavg(ROC1,N) * N.
ROCadj2 is expavg(ROC1,N2) * N2.
! TRADING SYSTEMS USING ROC AND ROCadj:
! LONG ENTRY AND EXIT RULES:
PD is {position days}.
LE1 if ROCn > 0 and valrule(ROCn < 0,1) and TickerRule("NDX",slope2(simpleavg(Pr,50),5) > 0).
LX1 if PD >=3 .
LE2 if ROCadj > 0 and valrule(ROCadj < 0,1) and TickerRule("NDX",slope2(simpleavg(Pr,50),5) > 0).
LX2 if PD >=3.
! SHORT SALE ENTRY AND EXIT RULES:
SE1 if ROCn2 < 0 and valrule(ROCn2 > 0,1) and ROCn < 0 and TickerRule("NDX",slope2(simpleavg(Pr,50),5) < 0 and slope2(Pr,10)>0).
SX1 if PD >=3.
SE2 if ROCadj2 < 0 and valrule(ROCadj2 > 0,1) and ROCadj < 0 and TickerRule("NDX",slope2(simpleavg(Pr,50),5) < 0 and slope2(Pr,10)>0).
SX2 if PD >=3.

Return to Top of Page

S&C May 2007 - Moving Averages

!! MOVING AVERAGES
! Author: Anthony Trongone, TASC May 2007
! Coded by: Richard Denning 3/12/07
! ABBREVIATIONS:
C is [close].
C1 is valresult(C,1).
O is [open].
L is [low].
H is [high].
V is [volume].
! INDICATORS:
SMA34 is simpleavg(O,34).
Space is O - SMA34.
ONS is O - C1.
V1 is valresult(V,1).
MAV is simpleavg(V,50).
MAV1 is valresult(simpleavg(V,50),1).
! NOTE: System is set to run on daily bars:
! TRADING SYSTEM WITHOUT FILTERS
LE1 if Space > 0 and symbol() = "QQQQ".
LEpr is O.
! Entry price is open
! EXIT IS ALWAYS TRUE FORCES AN EXIT AT CLOSE
LX if 1.
LXpr is C.
! Exit price is close
! TRADING SYSTEM WITH TMA FILTERS:
LE2 if LE1 and V1 > 10000*100 and ONS < 0.
! MODIFIED TMA TRADING SYSTEM:
LE3 if Space > 0 and V1 > MAV1 * 1.1 and ONS < 0.
!AIQ RELATIVE STRENGTH:
STL is 30.
Q3s is STL / 4.
Q2s is (STL - Q3s) / 3.
Q1s is (STL - Q2s - Q3s) / 2.
Q0s is STL - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s)) - val([open],Q3s,(Q2s+Q1s+Q0s))) / val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s) - val([open],Q2s,(Q1s+Q0s))) / val([open],Q2s,(Q1s+Q0s)) * 100.
ROCq1s is (val([close],Q0s,0) - val([open],Q1s,Q0s)) / val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0)) / val([open],Q0s,0) * 100.
RS_AIQst is ROCq0s * 0.40 + ROCq1s * 0.20 + ROCq2s * 0.20 + ROCq3s * 0.20. RS_AIQst1 is valresult(RS_AIQst,1).

Return to Top of Page

S&C June 2007 - Rectangles

!!! RECTANGLE PATTERN SCAN USING PIVOT POINTS
!! PIVOTS-FIVE LOW AND FIVE HIGH
! Coded by: Richard Denning 9/12/06; 4/16/07

!COMMON SETUP INFORMATION
Define periods 252. !Total look back period
Define strength 12. !Number of bars on each side of pivot
OTD is Offsettodate(Month(),Day(),Year()).
LowR is LoVal([low],(2*strength)+1).
LowM is Val([low],strength).
LS if LowR = LowM.
HighR is HiVal([high],(2*strength)+1).
HighM is Val([high],strength).
HS if HighR = HighM.

!FIND FIRST PIVOT LOW
LT1 is scanany(LS,periods) then OTD .
LO1 is ^LT1 + Strength.
LO1dte is SetDate(LO1).
LowLO1 is val([low],^LO1).

!FIND SECOND PIVOT LOW THAT IS BEFORE THE FIRST PIVOT LOW
LT2 is scanany(LS,periods,LO1) then OTD.
LO2 is ^LT2 + Strength.
LO2dte is SetDate(LO2).
LowLO2 is val([low],^LO2).

!FIND THIRD PIVOT LOW THAT IS BEFORE THE SECOND PIVOT LOW
LT3 is scanany(LS,periods,LO2) then OTD.
LO3 is ^LT3 + Strength.
LO3dte is SetDate(LO3).
LowLO3 is val([low],^LO3).

!FIND FORTH PIVOT LOW THAT IS BEFORE THE THIRD PIVOT LOW
LT4 is scanany(LS,periods,LO3) then OTD.
LO4 is ^LT4 + Strength.
LO4dte is SetDate(LO4).
LowLO4 is val([low],^LO4).

!FIND FIFTH PIVOT LOW THAT IS BEFORE THE FORTH PIVOT LOW
LT5 is scanany(LS,periods,LO4) then OTD.
LO5 is ^LT5 + Strength.
LO5dte is SetDate(LO5).
LowLO5 is val([low],^LO5).
!__________________________________________________________
!FIND FIRST PIVOT HIGH
HT1 is scanany(HS,periods,0) then OTD .
HO1 is ^HT1 + Strength.
HO1dte is SetDate(HO1).
HighHO1 is val([high],HO1).

!FIND SECOND PIVOT HIGH THAT IS BEFORE THE FIRST PIVOT HIGH
HT2 is scanany(HS,periods,HO1) then OTD.
HO2 is ^HT2 + Strength.
HO2dte is SetDate(HO2).
HighHO2 is val([high],HO2).

!FIND THIRD PIVOT HIGH THAT IS BEFORE THE SECOND PIVOT HIGH
HT3 is scanany(HS,periods,HO2) then OTD.
HO3 is ^HT3 + Strength.
HO3dte is SetDate(HO3).
HighHO3 is val([high],HO3).

!FIND FORTH PIVOT HIGH THAT IS BEFORE THE THIRD PIVOT HIGH
HT4 is scanany(HS,periods,HO3) then OTD.
HO4 is ^HT4 + Strength.
HO4dte is SetDate(HO4).
HighHO4 is val([high],HO4).

!FIND FIFTH PIVOT HIGH THAT IS BEFORE THE FORTH PIVOT HIGH
HT5 is scanany(HS,periods,HO4) then OTD.
HO5 is ^HT5 + Strength.
HO5dte is SetDate(HO5).
HighHO5 is val([high],HO5).
!_____________________________________________________________

!!RECTANGLE PATTERN SCAN
! USE THE RULES BELOW THAT HAVE "RECTANGLE" IN THE NAME TO
! FIND EMERGING RECTANGLE PATTERNS

! DF SETS THE ALLOWED VARIANCE BETWEEN PIVOT HIGHS & LOWS
DF is 0.03.

NoBreak if hival([high],60) < HighHO1 * (1+DF)
and loval([low],60) > LowLO1 * (1-DF).

FlatBottom3P if ((LowLO1 < LowLO2 and LowLO1 / LowLO2 > 1-DF) or
(LowLO1 > LowLO2 and LowLO1 / LowLO2 < 1+DF))
and ((LowLO2 < LowLO3 and LowLO2 / LowLO3 > 1-DF) or
(LowLO2 > LowLO3 and LowLO2 / LowLO3 < 1+DF)).

FlatTop3p if ((HighHO1 < HighHO2 and HighHO1 / HighHO2 > 1-DF) or
(HighHO1 > HighHO2 and HighHO1 / HighHO2 < 1+DF))
and ((HighHO2 < HighHO3 and HighHO2 / HighHO3 > 1-DF) or
(HighHO2 > HighHO3 and HighHO2 / HighHO3 < 1+DF)).

Rectangle3P if FlatBottom3p and FlatTop3p and NoBreak.


FlatBottom4P if ((LowLO1 < LowLO2 and LowLO1 / LowLO2 > 1-DF) or
(LowLO1 > LowLO2 and LowLO1 / LowLO2 < 1+DF))
and ((LowLO2 < LowLO3 and LowLO2 / LowLO3 > 1-DF) or
(LowLO2 > LowLO3 and LowLO2 / LowLO3 < 1+DF))
and ((LowLO3 < LowLO4 and LowLO3 / LowLO4 > 1-DF) or
(LowLO3 > LowLO4 and LowLO3 / LowLO4 < 1+DF)).

FlatTop4p if ((HighHO1 < HighHO2 and HighHO1 / HighHO2 > 1-DF) or
(HighHO1 > HighHO2 and HighHO1 / HighHO2 < 1+DF))
and ((HighHO2 < HighHO3 and HighHO2 / HighHO3 > 1-DF) or
(HighHO2 > HighHO3 and HighHO2 / HighHO3 < 1+DF))
and ((HighHO3 < HighHO4 and HighHO3 / HighHO4 > 1-DF) or
(HighHO3 > HighHO4 and HighHO3 / HighHO4 < 1+DF)).

Rectangle4P if FlatBottom4p and FlatTop4p and NoBreak.


FlatBottom5P if ((LowLO1 < LowLO2 and LowLO1 / LowLO2 > 1-DF) or
(LowLO1 > LowLO2 and LowLO1 / LowLO2 < 1+DF))
and ((LowLO2 < LowLO3 and LowLO2 / LowLO3 > 1-DF) or
(LowLO2 > LowLO3 and LowLO2 / LowLO3 < 1+DF))
and ((LowLO3 < LowLO4 and LowLO3 / LowLO4 > 1-DF) or
(LowLO3 > LowLO4 and LowLO3 / LowLO4 < 1+DF))
and ((LowLO4 < LowLO5 and LowLO4 / LowLO5 > 1-DF) or
(LowLO4 > LowLO5 and LowLO4 / LowLO5 < 1+DF)).

FlatTop5p if ((HighHO1 < HighHO2 and HighHO1 / HighHO2 > 1-DF) or
(HighHO1 > HighHO2 and HighHO1 / HighHO2 < 1+DF))
and ((HighHO2 < HighHO3 and HighHO2 / HighHO3 > 1-DF) or
(HighHO2 > HighHO3 and HighHO2 / HighHO3 < 1+DF))
and ((HighHO3 < HighHO4 and HighHO3 / HighHO4 > 1-DF) or
(HighHO3 > HighHO4 and HighHO3 / HighHO4 < 1+DF))
and ((HighHO4 < HighHO5 and HighHO4 / HighHO5 > 1-DF) or
(HighHO4 > HighHO5 and HighHO4 / HighHO5 < 1+DF))
and NoBreak.


Return to Top of Page

S&C July 2007 - Price and Volume

!! CONNECITON & AFFINITY BETWEEN PRICE & VOLUME
! Author: Buff Dormeier, TASC July 2007
! Coded by: Richard Denning 5/11/07

! PARAMETERS
Price is [close].
LT is 50.
ST is 10.
S is 5.
SS is 10.

! SIMPLE MOVING AVERAGE OF PRICE (SMA)
SMA_L is sum(Price,LT) / LT.
SMA_S is sum(Price,ST) / ST.
V is [volume].

! VOLUME-WEIGHTED MOVING AVERAGE (VWMA)
VTOT_L is sum(V,LT).
VWMA_L is sum(Price * (V / ^VTOT_L),LT).

VTOT_S is sum(V,ST).
VWMA_S is sum(Price * (V / ^VTOT_S),ST).

! VOLUME-PRICE CONTRADICITION/CONFIRMATION (VPC + / - )
VPC is VWMA_L - SMA_L.

! VOLUME PRICE RATIO (VPR)
VPR is VWMA_S / SMA_S.

! VOLUME MULTIPLIER (VM)
VMA_S is sum(V,ST) / ST.
VMA_L is sum(V,LT) / LT.
VM is VMA_S / VMA_L.

! VOLUME-PRICE CONFIRMATION INDICATOR (VPCI)
VPCI is VPC * VPR * VM.

! SMOOTHED VOLUME-PRICE CONFIRMATION INDICATOR(sVPCI)
sVPCI is sum(VPCI,S) / S.
ssVPCI is sum(VPCI,SS) / SS.

! INDICATOR FOR HISTORIGRAM PLOTTING.
dsVPCIss is sVPCI - ssVPCI..



Return to Top of Page

S&C August 2007 - System Management - Barrier Trailing Stop

!!! SYSTEM MANAGEMENT (CONSTRUCTING A TEMPLATE FOR)
! Author: Giorgos E. Siligardos, TASC Aug 2007
! Coded by: Richard Denning 5/10/07

! The article deals with a barrier trailing stop (SB) which
! will be coded and tested below.

!Formula for the trailing stop barrier (SB):
! SB = P - (( PT - P) / minDRR )
! P is the current price of the security as of today
! PT is the profit target
! minDRR is the minimum dynamic reward/risk set by the trader
! the author suggests setting the minDRR to 3.00

! TEST OF STOP USING CHANNEL BREAKOUT ON ETFs
! System rules:
! Enter a long on the first breakout from a 30 day channel
! Use a 60 day rate of change, descending, to select signals
! Set profit target to 8 ATRs, initial stop loss at 2.0 ATRs
! Set a trailing stop at the highest mid channel since
! the position was opened (MCT)
! Compare the MCT to the SB type trailing stop
! Reverse the rules for a short position

! ABBREVIATIONS:
C is [close].
C1 is valresult(C,1).
L is [low].
H is [high].
PEP is {position entry price}.
PD is {position days}.

! AVERAGE TRUE RANGE
TR is max(H-L,max(abs(H-C1),abs(L-C1))).
ATR is simpleavg(TR,60).

! BARRIER TRAILING STOP
! Set minimum risk to reward
minDRR is 2.0.
! Set initial stop loss and trailing amount in ATRs
noATRs is 2.0.

! FOR LONG POSITIONS
PT is PEP + 8 * ATR.
SB is C - ((PT- C) / minDRR).
SB1 is valresult(SB,1).

! FOR SHORT POSITIONS
SPT is PEP - noATRs * minDRR * ATR.
SSB is C + ((C - SPT) / minDRR).
SSB1 is valresult(SSB,1).

! CHANNELS
TopChan is highresult(H,30).
TopChan1 is valresult(TopChan,1).
BotChan is lowresult(L,30).
BotChan1 is valresult(BotChan,1).
! Mid channel for long trailing stops
MidChan is TopChan - (TopChan - Botchan) / 2.
MidChan1 is valresult(MidChan,1).
! Mid channel for short trailing stops
MidChanS is BotChan + (TopChan - Botchan) / 2.
MidChanS1 is valresult(MidChan,1).

! ENTRY RULES
! Long entry rule
LE if C > TopChan1 and countof(C > TopChan1,29,1) = 0 .
! Short entry rule
SE if C < BotChan1 and countof(C < Botchan1,29,1) = 0 .

! EXIT RULES
! Initial stop loss for longs
LLX is PEP - noATRs * ATR. ! For long positions
! Initial stop loss for shorts
LSX is PEP + noATRs * ATR. ! For short positions

! Mid-Channel trailing stop
! For longs
MidChLX is highresult(MidChan,PD) .
! For shorts
MidChSX is lowresult(MidChanS,PD) .

! Trailing stop using auhor's SB concept with
! MidChLX For longs
TrailLXmidSB is max(SB1,MidChLX).
! MidChSX for shorts
TrailSXmidSB is min(SSB1,MidChSX).

! Combo exit to use as benchmark using MidChLX/SX
! For longs
LXmid if C >= PT or C <= LLX or C <= MidChLX.
! For shorts
SXmid if C <= SPT or C >= LSX or C >= MidChSX.

! Combo exit that includes SB trailing stop
! with mid channel for longs
LXmidSB if C >= PT or C <= LLX or C <= TrailLXmidSB.
! with mid channel for shorts
SXbotSB if C <= SPT or C >= LSX or C >= TrailSXmidSB.

! Signal selection - 60 day rate of change percent
RC60 is (C / valresult(C,60) - 1) * 100.

Return to Top of Page

S&C September 2007 - Trading Trendline Breakouts

! TRADING TRENDLINE BREAKS
! Using AIQ's new chart pattern service
! to test trendline breakouts
! Coded by: Paul Denning, 4/4/2007
! Richard Denning, 7/12/2007

! breakUP of a down Channel (no shorts)
chanDwn is [Channel Down] .
chanBOlong if chanDwn > 0 .

! breakDOWN of an up Channel (no longs)
lenChan is ChartPatternLength([Channel Up]).
chanUp is [Channel Up].
chanBOshort if chanUp > 2 or chanUp < 0.

! Flag up and down
FLAG is [Flag] .
upFLAG if FLAG > 0 .
dwnFLAG if FLAG < 0 .

! pennant up and down
pennant is [Pennant].
upPennant if pennant > 0 .
dwnPennant if pennant < 0 .

! ascending triangle (long)
AT is [Ascending Triangle] .
ascTri if AT > 0 .

! descending triangle breakdown (short)
DT is [Descending Triangle] .
descTri if DT < 0 .

! TRIANGLE long and short
tri is [Triangle] .
triLNG if tri > 0 .
triSRT if tri < 0 .

! LONG FALLING wedges
FW is [Falling Wedge] .
fallWdg if FW > 0 .

! SHORT FALLING wedges
fallWdgSRT if FW < 0 .

! SHORT RISING wedges
RW is [Rising Wedge] .
riseWdg if RW < 0 .

! LONG RISING wedges
riseWdgLNG if RW > 0 .

! long on double bottom
doubBot is [Double Bottom] .
doubleBt if doubBot > 0 .

! short on double top
doubTop is [Double Top] .
doubleTp if doubTop < 0 .

! rectangle up and down
rect is [Rectangle] .
upRect if rect > 0 .
dwnRect if rect < 0 .

! COMBINED PATTERNS FOR TESTING TRENDLINE BREAKS
ALL_Long if chanBOlong or upFLAG or upPennant or ascTri
or triLNG or fallWdg or riseWdgLNG or doubleBt or upRect.
LX if {position days}=3.

NDXrule1 if TickerRULE("NDX",[close] > simpleavg([close],30)).
NDX_SPX is expavg(TickerUDF("NDX",[close])
/ TickerUDF("SPX",[close]),3).
rcNDXspx is (NDX_SPX / valresult(NDX_SPX,5) - 1) * 100.

ALL_LongM4 if (chanBOlong or upFLAG or upPennant or ascTri
or triLNG or fallWdg or riseWdgLNG or doubleBt or upRect)
and (NDXrule1 or (NDXrule1=0 and rcNDXspx > 1)).

ALL_Short if chanBOshort or dwnFLAG or dwnPennant
or descTri or triSRT or fallWdgSRT or riseWdg
or doubleTp or dwnRect.
SX if {position days}=3.

ALL_ShortM4 if (chanBOshort or dwnFLAG or dwnPennant
or descTri or triSRT or fallWdgSRT or riseWdg
or doubleTp or dwnRect)
and (NDXrule1=0 or (NDXrule1 and rcNDXspx < -1)).

!AIQ RELATIVE STRENGTH (for signal ranking)
STL is 32.
Q3s is STL / 4.
Q2s is (STL - Q3s) / 3.
Q1s is (STL - Q2s - Q3s) / 2.
Q0s is STL - Q1s - Q2s - Q3s.
ROCq3s is (val([close],Q2s,(Q1s+Q0s))
- val([open],Q3s,(Q2s+Q1s+Q0s)))
/ val([open],Q3s,(Q2s+Q1s+Q0s)) * 100.
ROCq2s is (val([close],Q1s,Q0s)
- val([open],Q2s,(Q1s+Q0s)))
/ val([open],Q2s,(Q1s+Q0s)) * 100.
ROCq1s is (val([close],Q0s,0)
- val([open],Q1s,Q0s))
/ val([open],Q1s,Q0s) * 100.
ROCq0s is ([close] - val([open],Q0s,0))
/ val([open],Q0s,0) * 100.
RS_AIQst is ROCq0s * 0.40 + ROCq1s * 0.20
+ ROCq2s * 0.20 + ROCq3s * 0.20.

Return to Top of Page

S&C October 2007 - Tandem Studies on Market Movement

!!! TANDEM STRUDIES ON MARKET MOVEMENT
! Author: Dima Vonko, TASC October 2007
! Coded by: Richard Denning 8/10/07

! COMMON SETUP INFORMATION
Define periods 400. !Total look back period
Strength is 26. !Number of bars on each side of pivot
OTD is Offsettodate(Month(),Day(),Year()).
LowR is LoVal([low],(2*strength)+1).
LowM is Val([low],strength).
LS if LowR = LowM.
HighR is HiVal([high],(2*strength)+1).
HighM is Val([high],strength).
HS if HighR = HighM.

! FIND FIRST PIVOT LOW
LT1 is scanany(LS,periods) then OTD .
LO1 is ^LT1 + Strength.
LO1dte is SetDate(LO1).
LowLO1 is ^val([low],^LO1).

! FIND SECOND PIVOT LOW THAT IS BEFORE
! THE FIRST PIVOT LOW
LT2 is scanany(LS,periods,LO1) then OTD.
LO2 is ^LT2 + Strength.
LO2dte is SetDate(LO2).
LowLO2 is ^val([low],LO2).

! FIND FIRST PIVOT HIGH
HT1 is scanany(HS,periods,0) then OTD .
HO1 is ^HT1 + Strength.
HO1dte is SetDate(HO1).
HighHO1 is ^val([high],HO1).

! FIND SECOND PIVOT HIGH THAT IS BEFORE
! THE FIRST PIVOT HIGH
HT2 is scanany(HS,periods,HO1) then OTD.
HO2 is ^HT2 + Strength.
HO2dte is SetDate(HO2).
HighHO2 is ^val([high],HO2).

!FIND PIVOT POINTS FOR THE S&P500 INDEX
LO1spx is TickerUDF("SPX",LowLO1).
LO1dteSPX is TickerUDF("SPX",LO1dte).
HO1spx is TickerUDF("SPX",HighHO1).
HO1dteSPX is TickerUDF("SPX",HO1dte).

LO2spx is TickerUDF("SPX",LowLO2).
LO2dteSPX is TickerUDF("SPX",LO2dte).
HO2spx is TickerUDF("SPX",HighHO2).
HO2dteSPX is TickerUDF("SPX",HO2dte).

!CHECK THAT FIRST PIVOT HIGH IS HIGHEST HIGH
HH1 is ^highresult([high],HO1+1).
HHO1 is scanany([high] = ^HH1,HO1+1) then OTD.
HH1dte is scanany([high]=^HH1,HO1+1).

! MAXIMUM CORRECTION - MOVING AVERAGE OF THE
! CURRENT PHASE LENGTH
SMALMT is simpleavg([close],max(2,^LO2) * 1.5).
SMALO1 is valresult(SMALMT,LO1).
SMALO2 is valresult(SMALMT,LO2).
!REPORTS TO SHOW VALUES FOR UPTRENDING TICKERS
UpTrend if LowLO1 > LowLO2 and resetdate()
and HighHO1 > HighHO2 and resetdate()
and LO1dte < HO1dte and resetdate()
and LO2dte < HO2dte and resetdate()
and loval([low],^HHO1) > SMALMT and resetdate()
and LowLO1 > SMALO1 and resetdate()
and LowLO2 < SMALO2 and resetdate()
and LO2 <= TickerUDF("SPX",LO2) and resetdate().

UpTrndSPX if UpTrend and symbol() = "SPX".

!REPORTS TO SHOW PIVOTS FOR ALL TICKERS IN LIST
StockPivots if stock().
SPXpivots if symbol() = "SPX".

! INDICATORS TO CALCULATE THE LAST TWO PRIMARY
! AND SECONDARY PHASE VALUES
P1st is sum([high] - LowLO2,LO2 - HO2,HO2).
P2nd is sum(HighHO2 - [low],HO2 - LO1,LO1).
P3rd is sum([high] - LowLO1,LO1 - ^HHO1,^HHO1).
Pcur is iff(^HHO1 > 10, sum(HH1 - [low],^HHO1,0),HH1 - [low]).

! ACCUMULATED RANGE RATIO BULL INDICATOR
! For previous primary and secondary phases
ARRB1 is P2nd / P1st * 100.
! For the most recent primary and secondary phases
ARRB is Pcur / P3rd * 100.

Return to Top of Page

S&C November 2007 - Short Term Volume and Price Oscillator

!!! 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).

Return to Top of Page

 


HOME     TRADINGEXPERT PRO     OPTIONEXPERT     OPENING BELL     TRAINING     DATA     TECHNICAL SUPPORT     UPGRADES     CONTACT US