• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA of a calculated value

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

    EMA of a calculated value

    hello, need some help. I have an indicator that charts a fast EMA and a slow EMA. I want to calculate a third EMA of the difference between these two EMAs. my ninjascript coding skills are average ... so any assitance is greatly appreciated! An example would be awesome. thanks

    #2
    Hello pman777,

    Thank you for your post.

    You could use something similar to the following:
    Code:
            protected override void Initialize()
            {
    			Add(new Plot(Color.Blue, "MADiff"));
            }
    
            protected override void OnBarUpdate()
            {
    			Value.Set(EMA(30)[0]-EMA(15)[0]);
            }
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
    7 responses
    35 views
    0 likes
    Last Post DaveS
    by DaveS
     
    Started by scfnkysx, Today, 12:30 AM
    0 responses
    4 views
    0 likes
    Last Post scfnkysx  
    Started by jimloforkocv, Today, 12:16 AM
    0 responses
    4 views
    0 likes
    Last Post jimloforkocv  
    Started by claxxical, Yesterday, 10:00 PM
    0 responses
    8 views
    0 likes
    Last Post claxxical  
    Started by ct, Yesterday, 08:13 PM
    0 responses
    9 views
    0 likes
    Last Post ct
    by ct
     
    Working...
    X