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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      50 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      16 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      23 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X