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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        66 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X