Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create a moving average from point A to point B

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

    Create a moving average from point A to point B

    Good afternoon!! Is it possible with NinjaScript to make a moving average start at point A and end at point B as indicated?
    Beforehand thank you very much!

    #2
    Hello BIOK.NT,

    It depends on what you mean. Is this an indicator or a custom method?

    You could supply a Series<double> object that only has values set on bars between a time range and then supply this as the input series to the SMA() indicator.

    Or you could make a custom method that loops through SMA() values between certain bars using the primary series.

    Or you could make a custom method that loops through specific bars and divides by the number of bars.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot for your repy! In this case I need do as indicador but how I can supplu a Series<double> object that only has values set on bars between a time range?

      Comment


        #4
        Hello BIOK.NT,

        if (ToTime(Time[0]) >= 90000 && ToTime(Time[0]) < 100000) // if the bar time is equal to or greater than 9:00 am and is less than 10:00 am
        {
        MySeries[0] = 100; // a value is set to the series
        }
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X