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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X