Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Getting the proper TickTime

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

    Getting the proper TickTime

    So is the requirement of OnMarketData() and OnMarketDepth() in conflict with putting all logic in the if(FirstTickOfBar) else (for the other ticks)?

    Does all of the current logic have to be rewritten just to get the tick time???

    If so, note that mine is a posted recommendation and request that all information is supplied when writing the code in this fashion. It should have been extremely simple to include the seconds with the other price information, instead of always seconds=00.

    When the Open, Close, etc. are all correct...why have incorrect time information tied to the tick pricing/bars?

    #2
    Not sure what you mean. OnMarketData/Depth() are their own methods. They have nothing to do with whatever you do in OnBarUpdate().

    The methods can "interact" by using shared variables and such. For sure you will need to reprogram your logic to take into account the tick times if that is something you want to use.

    Time[] is the timestamp of the bar, just like how Close[] is the close of the bar and not the close of the tick. Time[] is not the timestamp of the last traded tick. Bars do not include tick timestamps as that is not the timestamp of the bar. Showing tick timestamps here would be inconsistent behavior and unexpected. If you want tick timestamps you need to grab it from OnMarketData/Depth(). If you don't care what the exchange is actually stamping those ticks at, you could even just use DateTime.Now and just attach grab your current PC clock time as the tick comes in and use that as the tick's timestamp.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    4 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Working...
    X