Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetBar() Question

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

    GetBar() Question

    Dear Support,

    I am using the GetBar() method as per the sample in the help.

    Instead of using the sample date, have the following:

    signalBar = GetBar(new DateTime(DateTime.Now.Year, DateTimeNow.Month, DateTime.Now.Day, 9, 30, 00));

    I then want to test that value, so I do:

    Print("The close price of signalBar is: " + Close[signalBar].ToString());

    When I check the output for a single session, I am getting multiple values, only 1 or 2 of which are the actual values.

    Here is my question: Shouldn't signalBar (for the day/session ) always be the same once I define it with that time? In other words, I am getting a specific bar and as such, shouldn't it always be the same for that session that matches my signalBar time/date?

    Thanks,

    #2


    Use Time[0] instead of DateTime.Now

    Hope this helps others.

    Comment


      #3
      Glad you got it figured out, r2kTrader. Let us know if you have any other questions.
      AustinNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      639 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      572 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X