Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical flag always set to true

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

    Historical flag always set to true

    For some reason Historical flag is always set to true in OnBarUpdate method of my strategy.

    Here is a printout where Current time is 8:20 am 1/22, Time[0] is old but the Historical flag is set to true.

    2015-01-22 08:20:57.4913 INFO MD, Time[0], 1/20/2015 1:36:00 AM, Input[0], 118.455, Historical, False

    I created another simple strategy simply to print out the Historical flag and here it works as advertised. Here is the output from the test strategy.

    SystemTime, 01/22/15 8:17:22.948 A, MD, Time[0], 1/19/2015 5:38:00 PM, Input[0], 117.631, Historical, True

    I checked my strategy to see if I am accidentally setting this flag and I am not.

    Any thoughts on what would be causing this? Some combination of flags and/or position tracking that could be causing this behavior?

    Thanks

    #2
    Hello Rajan,

    Thank you for your note.

    Is the 1/20/2015 the last bar you have for the chart?

    Are you running market replay, backtest, or live data on a chart?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,

      The answer is no. There are several others and it does start to stream live data eventually.

      Attached a log file.

      Let me know if you see it. Eventually it does become realtime but the Historical Flag is always set to false not matter what.

      The code for the log output is follows:

      string.Format("MD, Time[0], {0}, Input[0], {1}, Historical, {2}"
      , Time[0], Input[0], Historical);

      ----
      I am running this from the strategies tab.

      screenshot attached.
      Attached Files
      Last edited by rajan.jedi; 01-22-2015, 10:47 AM.

      Comment


        #4
        Rajan,

        Is this a multseries script?

        Would it be possible to get the script to test on my end?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          I can't give you the script. It is multiseries. I add a 15 minute bar using Add(PeriodType.Minute, 15)

          Let me know if I can try/do something that will give you more information.

          Comment


            #6
            Rajan,

            Are you checking that there are enough bars loading for your needs in OnBarUpdate()?

            if(CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired) return;

            Also, can you get a toy version of the script that is replicating this same issue? No orders, just prints for this
            Last edited by NinjaTrader_CalH; 01-22-2015, 02:58 PM.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              I am not checking BarsRequired. I don't know why this is an issue though. No matter how many days of historical data I get, it always comes with Historical flag set to false (as you should be able to see) from the log.

              Comment


                #8
                Rajan,

                Can you get a toy version of the script that is replicating this same issue? No orders, just prints for this
                Cal H.NinjaTrader Customer Service

                Comment


                  #9

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  647 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  369 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  108 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  572 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  573 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X