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 samish18, 04-17-2024, 08:57 AM
      16 responses
      55 views
      0 likes
      Last Post samish18  
      Started by arvidvanstaey, Today, 02:19 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by jordanq2, Today, 03:10 PM
      2 responses
      8 views
      0 likes
      Last Post jordanq2  
      Started by traderqz, Today, 12:06 AM
      10 responses
      18 views
      0 likes
      Last Post traderqz  
      Started by algospoke, 04-17-2024, 06:40 PM
      5 responses
      47 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X