Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why Bars.GetDayBar(1) suddenly become not null

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

    Why Bars.GetDayBar(1) suddenly become not null

    Can i know why Bars.GetDayBar(1) suddenly become not null??

    It happen on the bar 1375.
    Is it because the the gold line suddenly go up ??

    The gold line is VWAP8()[0]
    Attached Files

    #2
    Hello soon123, thanks for writing in.

    It would be specific to the script you are using. The Bars object is set to an instance of an object after State.DataLoaded is reached. The day bar requested from GetDayBar is built from the 1-minute series you are using, so there must be at least 1 day worth of data to use it. That is why you see the null check in the example:

    // Check to ensure that sufficient intraday data was supplied
    if(Bars.GetDayBar(1) != null)

    If you need an absolute day bar to reference without relying on the 1 minute data, add a daily series using AddDataSeries.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by POTTER16, Today, 03:31 PM
    0 responses
    4 views
    0 likes
    Last Post POTTER16  
    Started by enricbcn, 05-08-2018, 01:36 AM
    78 responses
    43,512 views
    1 like
    Last Post Wessel
    by Wessel
     
    Started by Wessel, Today, 12:50 PM
    0 responses
    8 views
    0 likes
    Last Post Wessel
    by Wessel
     
    Started by asmmbillah, Today, 12:39 PM
    0 responses
    8 views
    0 likes
    Last Post asmmbillah  
    Started by dtmtradingco, Today, 12:30 PM
    0 responses
    7 views
    0 likes
    Last Post dtmtradingco  
    Working...
    X