Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The date and time when Onbarupdate() is activated du backtest.

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

    The date and time when Onbarupdate() is activated du backtest.

    Hi, hope someone can help


    During bactesting of a strategie, I want to know the time
    When OnBarUpdate() is called.
    So, it's not the time the strategie i exectuted, but the time, when
    every OnBaupdate() is called within the backtesting.

    Thanks in advance
    Crunchy

    #2
    crunchy,

    Use DateTime.Now for the time of your PC clock.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      now when reread my message I can see that it's confusing,
      let say that you are runnig a strategi the periode of 1 jan to 1 februar.
      ok, the output exempel would be something like that.

      Onbarupdate()
      1 januar
      Onbarupdate()
      2 januar
      Onbarupdate()
      3 januar

      Hope I did a better job this time :-)
      Thanks in advance
      Crunchy

      Comment


        #4
        crunchy,

        Not sure I understand you correctly, but if you just want the timestamp of the bars being processed use Time[0].
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          ah, thanks alot,
          I think that would do

          Crunchy

          Comment


            #6
            hmm, would you kindly give me an eksemple?
            Crunchy

            Comment


              #7
              crunchy,

              Not sure what you are looking for exactly.

              Print(Time[0].ToString()); gives you the timestamp of the current bar being processed.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Yes, I think it's what I am looking for, thank you
                Best regards
                Crunchy

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                23 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                115 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 05-10-2026, 08:12 PM
                0 responses
                68 views
                0 likes
                Last Post CarlTrading  
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                225 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Started by CaptainJack, 04-24-2026, 11:07 PM
                0 responses
                409 views
                0 likes
                Last Post CaptainJack  
                Working...
                X