• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Patrick H.NinjaTrader Customer Service

    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.
      Patrick H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by migngands, Today, 10:13 AM
      0 responses
      1 view
      0 likes
      Last Post migngands  
      Started by 7robert, Today, 09:41 AM
      2 responses
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Mykro, Today, 08:42 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by franki, Yesterday, 12:52 PM
      5 responses
      30 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by SuperDriveGuy, Today, 08:13 AM
      0 responses
      6 views
      0 likes
      Last Post SuperDriveGuy  
      Working...
      X