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

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 AlphaOptions, 06-18-2013, 08:24 AM
        5 responses
        2,167 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by JTizz, 04-08-2020, 08:59 AM
        2 responses
        211 views
        0 likes
        Last Post betsuni_123  
        Started by bortz, 11-06-2023, 08:04 AM
        53 responses
        2,023 views
        0 likes
        Last Post muchacha  
        Started by NickyD, 10-26-2023, 04:41 PM
        5 responses
        192 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by janio973, Yesterday, 07:24 PM
        4 responses
        26 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X