Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

February 08 S&C article "Trading Divergences"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    February 08 S&C article "Trading Divergences"

    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
    Attached Files
    RayNinjaTrader Customer Service

    #2
    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 ?


    Code:
     
    
    [I]Editor's note:[/I] 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.[INDENT][B]20-BAR zero-lagging EMA for MetaStock[/B] [/INDENT]
    [INDENT]Period:= Input("What Period?",1,100,20); [/INDENT]
    [INDENT]EMA1:= Mov(CLOSE,Period,E); [/INDENT]
    [INDENT]EMA2:= Mov(EMA1,Period,E); [/INDENT]
    [INDENT]Difference:= EMA1 - EMA2; [/INDENT]
    [INDENT]ZeroLagEMA:= EMA1 + Difference; [/INDENT]
    [INDENT]ZeroLagEMA [/INDENT]
    [INDENT][B]Trailing-stop reversal for MetaStock[/B] [/INDENT]
    [INDENT]stop:= Input("Trailing Stop",0,20,7); [/INDENT]
    [INDENT]trail:= If(C=PREV,PREV, [/INDENT]
    [INDENT]If(((Ref(C,-1)<PREV) AND (C<PREV)), [/INDENT]
    [INDENT]Min(PREV,C*(1+stop/100)), [/INDENT]
    [INDENT]If((Ref(C,-1)>PREV) AND (C>PREV), [/INDENT]
    [INDENT]Max(PREV,C*(1-stop/100)), [/INDENT]
    [INDENT]If(C>PREV,C*(1-stop/100),C*(1+stop/100))))); [/INDENT]
    [INDENT]trail [/INDENT]
    [INDENT][B]SVAPO price-only indicator for MetaStock[/B] [/INDENT]
    [INDENT]{calculate heikin ashi closing average haCl and get the input variables} [/INDENT]
    [INDENT]haO:=(Ref((O+H+L+C)/4,-1) + PREV)/2; [/INDENT]
    [INDENT]haC:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haOpen))/4; [/INDENT]
    [INDENT]{input SVAPO period} [/INDENT]
    [INDENT]period:= Input("SVAPO period :", 2, 20, 8); [/INDENT]
    [INDENT]{input minimum per thousand price change} [/INDENT]
    [INDENT]cutoff:= Input("Minimum %o price change :",0.0,10,1); [/INDENT]
    [INDENT]{Inputs for standard deviation bands} [/INDENT]
    [INDENT]devH:= Input("Standard Deviation High :", 0.1, 5, 1.5); [/INDENT]
    [INDENT]devL:= Input("Standard Deviation Low :", 0.1, 5, 1.3); [/INDENT]
    [INDENT]stdevper:= Input("Standard Deviation Period :", 1, 200, 100); [/INDENT]
    [INDENT]{Smooth HaCl closing price} [/INDENT]
    [INDENT]haC:=Tema(haCl,period/1.6); [/INDENT]
    [INDENT]{MA divisor} [/INDENT]
    [INDENT]vave:=Ref(Mov(C,period*5,S),-1); [/INDENT]
    [INDENT]{Basic trend} [/INDENT]
    [INDENT]vtr:=Tema(LinRegSlope(C,period),period); [/INDENT]
    [INDENT]{SVAPO result of price only} [/INDENT]
    [INDENT]SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000)) [/INDENT]
    [INDENT]AND Alert(vtr>=Ref(vtr,-1),2),C,If(haC<(Ref(haC,-1)*(1-cutoff/1000))[/INDENT]
    [INDENT]AND Alert(vtr>Ref(vtr,-1),2),-C,0)),period)/(vave+1),period); [/INDENT]
    [INDENT]devH*Stdev(SVAPO,stdevper); [/INDENT]
    [INDENT]-devL*Stdev(SVAPO,stdevper); [/INDENT]
    [INDENT]zeroref:=0; [/INDENT]
    [INDENT]zeroref; [/INDENT]
    [INDENT]SVAPO [I]--Sylvain Vervoort[/I][/INDENT]

    Comment


      #3
      No I do not.
      RayNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      1 view
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,770 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      944 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      11 views
      0 likes
      Last Post Max238
      by Max238
       
      Working...
      X