Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Since Entry

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

    Bars Since Entry

    Hello,

    I've seen BarsSinceEntry().

    Is there a similar "BarsSinceOrderPlacement()" for stop or stoplimit orders before orderstate becomes filled?

    Thanks,
    Kirk

    #2
    Hi zeller4,

    There's no method explicitly for that, however, you can track the bars since your order was submitted manually, by setting a variable to CurrentBar. The CancelOrder shows an example of this type of tracking.

    TimNinjaTrader Customer Service

    Comment


      #3
      I've used BarsSinceEntry() successfully and notice that it starts at zero on a new trade. However, when a trade hits a stop or target and is no longer active and the IOrder name is reset to null, the BarsSinceEntry continues to count up. It only resets once a new trade is placed.

      Is there something else required to reset this?

      Kirk

      Comment


        #4
        Kirk, the BarsSinceEntry() method will only reset when a new trade is placed. If you are looking to track exits, please use the BarsSinceExit() method instead.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        264 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        168 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        171 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        257 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        209 views
        0 likes
        Last Post CarlTrading  
        Working...
        X