Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IDataSeries with Start and End

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

    IDataSeries with Start and End

    Is it possible to feed an IDataSeries into standard functions with a start and end, instead of a lookback period from the current bar?

    I read a couple of posts and it does not seem possible.

    So has anyone written a piece of code that does this and is willingly to share?

    Basically I'm trying to do basic functions on bars in the past, but starting and ending in the past, not starting from the current bar and looking back.

    Some of the functions I want to use include: Max, Min, StdDev etc.

    #2
    Can you provide a use case of something you would want to do?
    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      Can you provide a use case of something you would want to do?
      For example I want to find the highest high between bars 5 and 10.
      OR
      Work out the StdDev of bars 20 to 30.
      etc etc.

      Comment


        #4
        Wouldn't something like this work?

        double highestHigh = MAX(High, 5)[CurrentBar - 10];
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          Wouldn't something like this work?

          double highestHigh = MAX(High, 5)[CurrentBar - 10];
          Sorry I'm new to NinjaScript.
          but yes that will work nicely.
          Thanks!

          Comment


            #6
            Excellent!
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            332 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