Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exact time of Tick arrival

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

    Exact time of Tick arrival

    Hi

    I'm trying to get the exact time of the arrival of my Ticks (at least to the resolution of 1 seconds)

    Time[0].Second or Time[0].Ticks seems to be useless in my case.

    I've been reading some info about using timer, but it seems It's not applicable if I want to do market replay. (ie. even when I pause the time, the timer continues to tick)

    Why am I doing this? Let's say because I want to cancel order if in the next 30 seconds the order doesn't get filled.

    Thank you

    #2
    Hi buddie,

    Try...
    DateTime.Now.Second
    TimNinjaTrader Customer Service

    Comment


      #3
      Hi Tim,

      I supposed that would work if I'm running real time. But how about if I want to do a market replay?

      I understand that DateTime.Now refers to system time at that moment, not at that particular bar/tick.

      Comment


        #4
        Hi buddie,

        I see, I assume your series is larger than a 30 second interval? Hence why you are having trouble using Time[0].Second or Time[0].Ticks?
        TimNinjaTrader Customer Service

        Comment


          #5
          Because it always refer to the previous bar close?

          Time[0].Second always return 0, while Time[0].Ticks will return the same value until it moves on to the next bar

          I saw this thread: http://www.ninjatrader.com/support/f...ad.php?t=12610

          and seems that he suggessted to use timer. But getting a tick time should be simple, why is it so difficult.
          Last edited by buddie; 07-23-2010, 03:05 AM.

          Comment


            #6
            buddie,

            Then this topic has been covered already, if you want to to do this in real time, you have options, same as when using Market Replay, as mentioned in this post:
            TimNinjaTrader Customer Service

            Comment


              #7
              I found this: http://bitbucket.org/tooooooby/ninjatrader_tobysoundcounter/src/54d75aa63436/TobySoundCounter.cs

              and basically he/she used:

              Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now


              what do you think?

              Comment


                #8
                Originally posted by buddie View Post
                I found this: http://bitbucket.org/tooooooby/ninjatrader_tobysoundcounter/src/54d75aa63436/TobySoundCounter.cs

                and basically he/she used:

                Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now


                what do you think?
                I believe that will work.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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