Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

secondary series and MIN MAX

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

    secondary series and MIN MAX

    Hello, i have an indicator which has been apparently working great til i observed in latest release some oddities
    • if (BarsInProgress == 1)
      MAX(...) will give you the MAX within the secondary bar object.

    I use MAX and MIN for a secondary object which happens to be a 1 minute dataseries correctly defined in Configure section

    I was using BarsArray[1].GetBar(starttime); and GetBar(endtime);
    to get the bars within a defined time period all of this in the BarsInProgress == 1 section

    I even switched to Bars.GetBar and this didnt seem to make much difference - but these do NOT return the correct bar for the supplied times a 30 minute period with endtime 30 minutes after start time so i should get 29/30 bars difference between the start and the end bars.

    The code is getting the MAX and MIN prices for the bars in this time period ie MAX of the Highs[1] and MIN of the Lows[1]

    on close inspection today it is not getting the correct value for the lowest low - and this has been working fine.

    So i printed out the values of Lows[1][x] for a number of bars back to check values and they dont appear correct

    is there any synch issue with Lows[1] for the secondary series or even using Low in the BarsInProgress == 1 is the same - which is recommended out of interest having read documentation
    it wasnt clear and have looked at past support notes.

    So now i am concerned how reliable the Low High information is for this secondary series
    My primary bar series is a custom bar but that should not matter So not sure what in new release would have changed regarding multi series and synching of these low high series and that i am not getting correct bar number for the current session.

    Something is suddenly out of synch or not reliable - have any of these methods been changed or deprecated for working with multi series? I realise if both bar objects share the same time stamp the primary is processed first but that is not the issue in this case.

    thanks

    OK update to this - why i tried this as it didnt make sense was working on my other machine which is connected to live market and this machine
    So i went into db/cache and deleted all the directories...
    restarted ninja and now all is ok

    this has been driving me crazy for 3+ hours trying to debug this - why would the cache have been impacting this and the bars and series
    and this was for a new chart i added today to test this ?

    I havent deleted the cache in long time but clearly this is a contributory aspect to this and out of synch

    please explain - so i can bear in mind in future as i didnt think the cache situation was as problematic in Nt8
    Last edited by explorer101; 05-29-2019, 03:02 PM.

    #2
    Hello explorer101,

    I am not able to reproduce this behavior.

    Attached is a test script.

    Below is a link to a video of the test.


    If you test the script I have provided on your end, are you experiencing different behavior?
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks chelsea your script actions and series setup match what i have.

      I made an edit / update before you responded to note that it is working now after i cleared the db cache. Until i tried that i just could not figure where the values were coming from for the 1 min bars in the secondary series.

      My secondary question in the lower part of my email s that obviously this led to the values being out of synch relative to what was on the chart
      I note in the db/cache for ES 06-19 there was a MINUTE directory and the secondary series was a 1 minute series.

      Would you expect this to happen if the cache was somehow corrupt or out of synch ?

      How often do you recommend the db/cache to be cleared ?

      Comment


        #4
        Hello explorer101,

        Charts and NinjaScripts pull data from the same place.

        I would always expect that the times and prices printed from a script would match what is in the Tools > Historical Data window. Which means I would also expect a chart that uses the same days to load and start date to also pull the same data.

        I would not expect data printed from a script to be different than what is in the Tools > Historical Data window.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I guess i am trying to ask more information on how the cache is used here
          You say you would not expect the chart and ninjascript data to differ.

          If i have a primary bar type which is not time based and the secondary which happens to be minute based. Does the script pull this minute based data from the cache?

          I am trying to understand why clearing the cache has fixed the issue - this is one of these situations is hard to reproduce but there was definitely an issue with data values
          until i cleared the cache after closing ninja and restarting.

          Any information you can share would be appreciated

          thanks

          Comment


            #6
            Hello explorer101,

            The non-time based bar will be using historical tick data. Minute charts will be using historical minute data (corrected). Both will be using data from the cache, but it will be from two different types of data.

            If you can demonstrate that a script prints something different than what is in the Tools > Historical Data window I would like to take a look as I have not experienced this.
            Last edited by NinjaTrader_ChelseaB; 05-30-2019, 09:28 AM.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Yes i see in the cache there are 2 directories one for tick and one for minute. However on looking now i only see data in the minute directory. So yes depending on the bar type and how bar is built one will be minute data other will be tick.

              Is there any other information on how the cache is used and when ie at startup or on each F5 refresh of chart etc or is this not discussed or shared anywhere for proprietary reasons

              I will keep an eye on this over coming days to see if arises.

              Also is there a recommendation on how often to clear the cache ? I note on occassional days when starting up some days it does not pull all the data for the prior day and i need to reload all historical - im not sure if this is a ninja historical server issue or ? It happens now and again

              thanks

              Comment


                #8
                Hello explorer101,

                Below is a link to the help guide on how historical data is loaded.



                We do not recommend clearing the cache (or any other files in the Documents\NinjaTrader 8\ folder) unless directed to by the NinjaTrader staff.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  thanks will look over

                  Yes i dont really want to be clearing the cache but i do recall from N7 days and even in N8 it has come up as suggestion to clear it in past and so i did
                  And it resolved the issue - all is good and my indicator works perfectly today - how do you / I explain this i do not know.

                  Will keep eye on this

                  thanks for help

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  589 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  342 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  555 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  552 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X