Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MA on ADV/DECL

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

    MA on ADV/DECL

    hi ... I have 2 separate feeds 'added' in my program as such:

    Add("^ADV", PeriodType.Minute, 1); // BarsInProgress = 1 Add("^DECL", PeriodType.Minute, 1); // BarsInProgress = 2

    I need to calculate the difference (Adv - Decl) then internally calculate a moving average based on that difference. Can you provide any direction or guidance on this?

    #2
    Hello pman777,

    If you are looking to do the difference here then you would want to take
    double diff = Closes[1][0] - Closes[2][0];

    You could then pass the double through your plot data series and SMA to get a Moving Average.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X