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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      388 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      260 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      218 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      302 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      268 views
      0 likes
      Last Post CarlTrading  
      Working...
      X