PDA

View Full Version : February 08 S&C article "Trading Divergences"


NinjaTrader_Ray
01-23-2008, 01:29 PM
Attached is the "Zero-Lagging Exponential Moving Average" indicator as discussed in the February 08 S&C article authored by Sylvain Vervoort titled "Trading Divergences".

This indicator is for NinjaTrader Version 6.5 or greater.

To install:

1. Download the file to your desktop
2. Start NinjaTrader
3. Select the menu File > Utilities > Import NinjaScript
4. Select the downloaded file saved to your Desktop

thrunner
01-23-2008, 04:59 PM
Thank you very much for the contribution NT Ray. However, the attached indicator seems to be only for the zerolag exponential average. Do you have the code for the trailing stop and SVAPO indicators described in the article by Vervoort ?

http://www.traders.com/Documentation/FEEDbk_docs/TradersTips/TradersTips.html



Editor's note: Code in MetaStock language for "Trading Medium-Term Divergences" in the February 2008 issue was provided by the article's author, Sylvain Vervoort. It is reprinted here for readers' convenience.20-BAR zero-lagging EMA for MetaStock

Period:= Input("What Period?",1,100,20);

EMA1:= Mov(CLOSE,Period,E);

EMA2:= Mov(EMA1,Period,E);

Difference:= EMA1 - EMA2;

ZeroLagEMA:= EMA1 + Difference;

ZeroLagEMA

Trailing-stop reversal for MetaStock

stop:= Input("Trailing Stop",0,20,7);

trail:= If(C=PREV,PREV,

If(((Ref(C,-1)<PREV) AND (C<PREV)),

Min(PREV,C*(1+stop/100)),

If((Ref(C,-1)>PREV) AND (C>PREV),

Max(PREV,C*(1-stop/100)),

If(C>PREV,C*(1-stop/100),C*(1+stop/100)))));

trail

SVAPO price-only indicator for MetaStock

{calculate heikin ashi closing average haCl and get the input variables}

haO:=(Ref((O+H+L+C)/4,-1) + PREV)/2;

haC:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haOpen))/4;

{input SVAPO period}

period:= Input("SVAPO period :", 2, 20, 8);

{input minimum per thousand price change}

cutoff:= Input("Minimum %o price change :",0.0,10,1);

{Inputs for standard deviation bands}

devH:= Input("Standard Deviation High :", 0.1, 5, 1.5);

devL:= Input("Standard Deviation Low :", 0.1, 5, 1.3);

stdevper:= Input("Standard Deviation Period :", 1, 200, 100);

{Smooth HaCl closing price}

haC:=Tema(haCl,period/1.6);

{MA divisor}

vave:=Ref(Mov(C,period*5,S),-1);

{Basic trend}

vtr:=Tema(LinRegSlope(C,period),period);

{SVAPO result of price only}

SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000))

AND Alert(vtr>=Ref(vtr,-1),2),C,If(haC<(Ref(haC,-1)*(1-cutoff/1000))

AND Alert(vtr>Ref(vtr,-1),2),-C,0)),period)/(vave+1),period);

devH*Stdev(SVAPO,stdevper);

-devL*Stdev(SVAPO,stdevper);

zeroref:=0;

zeroref;

SVAPO --Sylvain Vervoort

NinjaTrader_Ray
01-23-2008, 05:13 PM
No I do not.