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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        666 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X