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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      61 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      148 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X