Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time[] does not match GetTime on Daily or higher timeframes

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

    Time[] does not match GetTime on Daily or higher timeframes

    Hello,
    I'm trying to get the timestamp for daily bars, but it seems the GetTime function return the previous day date but not the current.
    The sample code:
    Code:
    .....
    Calculate									= Calculate.OnEachTick;
    ....
    
    protected override void OnBarUpdate()
    		{
    			DateTime time = Bars.GetTime(CurrentBar);
    			Print(String.Format("CurrentBar={0}, Time[0]={1}, GetTime={2}", CurrentBar, Time[0], time));
    		}
    Here is what it prints on 1 Day chart


    on intraday timeframes the Time[0] matches the result of GetTime function, but on daily chart of higher this values doesn't match. Is there any workaround?
    Thank you!
    Last edited by serialbug; 09-12-2016, 06:25 AM.

    #2
    Hello serialbug,

    Thank you for your post.

    For formatting purposes, the value returned is NOT guaranteed be equal to the TimeSeries value. If you are using daily bars and need the session end time, you should use Bars.GetSessionEndTime() instead.
    You can find information on GetTime at the following link: http://ninjatrader.com/support/helpG...us/gettime.htm

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    942 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    4 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    28 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    33 views
    0 likes
    Last Post wzgy0920  
    Working...
    X