• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 RB104, Today, 06:06 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by jtrading82, 05-25-2018, 09:59 AM
    9 responses
    977 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by syxforex, Today, 12:11 AM
    2 responses
    15 views
    0 likes
    Last Post syxforex  
    Started by aslane, Today, 02:31 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by stoner, 10-16-2019, 01:38 PM
    5 responses
    51 views
    0 likes
    Last Post sledge
    by sledge
     
    Working...
    X