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 cre8able, Yesterday, 01:16 PM
            3 responses
            11 views
            0 likes
            Last Post cre8able  
            Started by Harry, 05-02-2018, 01:54 PM
            10 responses
            3,203 views
            0 likes
            Last Post tharton3  
            Started by ChartTourist, Today, 08:22 AM
            0 responses
            6 views
            0 likes
            Last Post ChartTourist  
            Started by LiamTwine, Today, 08:10 AM
            0 responses
            2 views
            0 likes
            Last Post LiamTwine  
            Started by Balage0922, Today, 07:38 AM
            0 responses
            5 views
            0 likes
            Last Post Balage0922  
            Working...
            X