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

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 RookieTrader, Today, 09:37 AM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by kulwinder73, Today, 10:31 AM
            0 responses
            5 views
            0 likes
            Last Post kulwinder73  
            Started by terofs, Yesterday, 04:18 PM
            1 response
            22 views
            0 likes
            Last Post terofs
            by terofs
             
            Started by CommonWhale, Today, 09:55 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by Gerik, Today, 09:40 AM
            2 responses
            7 views
            0 likes
            Last Post Gerik
            by Gerik
             
            Working...
            X