Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

During State Terminated CurrentBars[orderBarIndex] returns incorrect value

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

    During State Terminated CurrentBars[orderBarIndex] returns incorrect value

    Hello. I've noticed that CurrentBars[orderBarIndex] does not return samr value as BarsArray[orderBarIndex].CurrentBar when executing in State.Terminated of OnStateChange event handler. BarsArray[orderBarIndex].CurrentBar seems correct.

    I also noticed that Trade.Entry.BarIndex is reported on Bar index 0 even though Trade.Entry.BarsInProgress may be on another bar, i.e. orderBarIndex. The same goes for Trade.Exit.BarIndex.

    #2
    Hello [email protected],

    Thank you for your post.

    BarsArray[barsInProgress index].CurrentBar is not documented so there is no expected behavior at this time. However, the Bars object would no longer be present once you are in the State of Terminated.
    CurrentBars would pull the last value since OnBarUpdate().

    Trade.Entry/Exit.BarIndex is not documented either. There is once again no expected behavior. However the BarsInProgress is likely not the same item as an entry or exit's bar (BarIndex).

    Please let me know if you have any questions and I will check with the Product Management team on these items.

    Comment


      #3
      Hello [email protected],

      Thank you for your patience.

      These items would not be exposed in NinjaTrader 8 and were not intended for end users in NinjaTrader 7.

      For the BarsArray[].CurrenBar, you would use CurrentBars[BarsInProgress index].
      For the BarIndexs, you would store the CurrentBar when the execution occurs manually.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by helpwanted, Today, 03:06 AM
      1 response
      10 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      7 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      385 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X