Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Nested moving averages?

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

  • Burga1
    replied
    Thanks for the response. Actually the code is VT Trader...

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Metastock code? I am not too familiar with metastock functions, but the code you have produced looks correct to me.

    Leave a comment:


  • Burga1
    started a topic Nested moving averages?

    Nested moving averages?

    Greetings,

    I'm trying to convert the following line of code to NT, it's a bit confusing because it uses "nested" EMA's:

    SMI:= 100 * (Mov(Mov(C-(0.5 * (HHV(H,lp) + LLV(L,lp))),sm,E),dsmp,E) / (0.5 * Mov(Mov(HHV(H,lp) - LLV(L,lp),sm,E),dsmp,E)));

    Here's what I wrote, it compiles just fine but my question is whether the logic has been properly duplicated?

    FirstInside.Set(Close[0] - (0.5 * (MAX(High, Lp)[0] + MIN(Low, Lp)[0])));
    Inside1 = EMA(FirstInside, Sm)[0];
    FirstInside2.Set(Inside1);
    Inside12 = EMA(FirstInside2, Dsmp)[0];
    SecondInside.Set(MAX(High, Lp)[0] - MIN(Low, Lp)[0]);
    Inside2 = EMA(SecondInside, Sm)[0];
    SecondInside2.Set(Inside2);
    Inside22 = 0.5 * (EMA(SecondInside2, Dsmp)[0]);

    SMI_VALUE = 100 * (Inside12 / Inside22);

    Thanks in advance for any confirmation/comments..etc...

Latest Posts

Collapse

Topics Statistics Last Post
Started by AveryFlynn, Today, 04:57 AM
1 response
10 views
0 likes
Last Post NinjaTrader_Erick  
Started by Max238, Today, 01:28 AM
4 responses
37 views
0 likes
Last Post Max238
by Max238
 
Started by r68cervera, Today, 05:29 AM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by geddyisodin, Today, 05:20 AM
1 response
11 views
0 likes
Last Post NinjaTrader_Gaby  
Started by timko, Today, 06:45 AM
2 responses
14 views
0 likes
Last Post NinjaTrader_ChristopherJ  
Working...
X