Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anything like "lowest 95%"?

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

    Anything like "lowest 95%"?

    Hi,

    I'm looking for an easy way out. I'm currently using High/Low within my logic, but I'm working with 30 minute bars... and sometimes these values can be skewed by a really short burst in one direction or the other.

    So, I want to filter some of this out... by looking at the lowest value for "almost all" previous bars.

    Is there an easy function that I can call, within my 30 minute OnBarUpdate()... that would give me the value that X% (say, 95%) of previous 1-minute bars were higher than?

    #2
    You can try the real-time tick filter if you feel the data is erroneous. Tools->Options->Data.

    If you feel the data is valid and still want to proceed you will need to roll your own function.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      The data is valid, I just wanted to find an easy way out. I was hoping DataSeries would have an easy function for this.

      Comment


        #4
        Unfortunately not.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi there, it may not be a built in function, but I am fairly confident C# can handle it and it sounds like you're coding this in C#. And this isn't a precise thing, just something to eliminate the extreme data. The basics are simple: if you wanted to eliminate the most extreme data, get your data in an array, sort it, and remove the highest value.

          I am learning C# now so I don't have the syntax on this but basically it would be something like:

          get an array of values you want to check
          sort that array
          take off the top x values or lowest x values
          read the last hightest or lowest value

          As an example, and for easier math, use 100 minutes, or 100 bars of 1 minute data. Copy that into an array. Sort that array say from low to high so that the lowest value is at 0, i.e. sortedLows[0] is the lowest value. sortedLows[5] should then roughly represent the 95% low. If you didn't take 100 bars of data then you'd have to figure out which bar you would want.

          Just a thought.

          Michael

          Comment


            #6
            Originally posted by michaelangela View Post
            Hi there, it may not be a built in function, but I am fairly confident C# can handle it and it sounds like you're coding this in C#. And this isn't a precise thing, just something to eliminate the extreme data. The basics are simple: if you wanted to eliminate the most extreme data, get your data in an array, sort it, and remove the highest value.

            I am learning C# now so I don't have the syntax on this but basically it would be something like:

            get an array of values you want to check
            sort that array
            take off the top x values or lowest x values
            read the last hightest or lowest value

            As an example, and for easier math, use 100 minutes, or 100 bars of 1 minute data. Copy that into an array. Sort that array say from low to high so that the lowest value is at 0, i.e. sortedLows[0] is the lowest value. sortedLows[5] should then roughly represent the 95% low. If you didn't take 100 bars of data then you'd have to figure out which bar you would want.

            Just a thought.

            Michael
            Great idea. I hadn't started to tackle this yet, but what you're saying sounds absolutely like the way to go.

            Here's an easy to use quicksort routine:

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 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
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X