Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Somehow, Put correct time with tick information

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

    Somehow, Put correct time with tick information

    If you have a 1 minute bar standard with ability to access each tick...when using OnBarUpdate() and FirstTickOfBar, the times always show 00 for seconds for EVERY tick bar. When getting information on the new/partial/tick bars, before the full minute bar's information is available, the seconds should reflect close to the real time.
    There should be 2 bar/prices/time that can be related to the FirstTickOfBar...One for the previous Completed Minute Bar and one for the partial/new Minute Bar that is being built.
    When the previous/full Minute bar is accessed, the current time[1], Open[1], Close[1], etc. seem perfect.
    There should be a way to access the Partially built Tick/Minute bar...
    For example: Time[0], Open[0], Close[0],... would be the info of the FirstTickOfBar after receiving the 1st Tick's information and Only when in the FirstTickOfBar mode.
    The 2nd Tick/Minute bar should probably include the Price data from the 1st & 2nd bars, but the Time of the 2nd Tick/Minute bar. When on that bar Time[0], Open[0], etc. should reflect that bar.
    The 3rd Tick/Minute bar should probably include the Price data from the 1st, 2nd, and 3rd bars, but the Time of the 3rd Tick/Minute bar, etc. When on that bar Time[0], Open[0], etc. should reflect that bar.

    The offsets [0], [1], etc. should be discussed and decided upon based on your programming...just so the Time and Price data is available.
    Maybe even something like TTime[x], TOpen[x], etc. to represent TickTime, TickOpen, etc...when in FirstTickOfBar mode.

    #2
    Time[] is not the tick time. It is simply the bar time.

    If you want tick time you need to work out of OnMarketData() or OnMarketDepth().

    Index of 0 is always the most recent bar. Index 1 is always the previous bar, index 2 is the bar before that, etc.

    If you want to access bars that are still building you need to be running your script with CalculateOnBarClose = false.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    6 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    9 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X