Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time since last Tick

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

    Time since last Tick

    My strategy is based on tick data and so I need CalculateOnBarClose = false. When there is a new bar in 5 Minute chart the help states that I will only be able to identify it via FirstTickOfBar.

    What is the best way to get the time which has passed since the last bars closing which would not necessarly be the last tick and this new first tick? I can life with either way, last tick or bar close.


    There doesn't seem to be a Millisecond component in Time[0].Millisecond as this is always 0?
    Last edited by symphys; 04-20-2010, 02:11 PM.

    #2
    symphys, perhaps you could utilize the PercentComplete property which measures how much time has elapsed for the current bar.

    If that isn't what you're looking for, there is a reference sample on manipulating DateTime objects, which is definitely applicable for what you're trying to do.

    You could compare Time[1] (time the previous bar closed) with Time[0] (the time of the most recent tick, if CalculateOnBarClose = false).

    EDIT: NinjaTrader does not utilize milliseconds with Time[n].
    AustinNinjaTrader Customer Service

    Comment


      #3
      Time[0] does not have the most recent tick time but the time when the bar will close. It would be nice to have the tick time and a solution to my problem...

      Comment


        #4
        My apologies. Please try this snippet to get the time of the most recent tick:
        Code:
        protected override void OnMarketData(MarketDataEventArgs e)
        {
            DateTime lastTick = e.Time;
            Print(lastTick);
        }
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 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