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 sidlercom80, Today, 02:40 AM
    0 responses
    3 views
    0 likes
    Last Post sidlercom80  
    Started by b16_aln, Today, 01:52 AM
    0 responses
    7 views
    0 likes
    Last Post b16_aln
    by b16_aln
     
    Started by junkone, Yesterday, 08:55 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by adaeiqendqw, 01-16-2021, 02:56 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by [email protected], Yesterday, 06:10 PM
    5 responses
    16 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Working...
    X