Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait X number of bars

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

    Wait X number of bars

    From the moment a condition becomes true, is there a way to wait 15 bars before executing a trade?
    thanks

    #2
    Hello,

    You would need to create a custom variable to track the number of bars since the condition is true. You could use CurrentBar to more easily track this: http://www.ninjatrader.com/support/h...currentbar.htm

    Please let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      OK, so
      Code:
      if (condition 1 is true) {
      startcountingbar = CurrentBar;
      }
      How do I make startcountingbar + 15 condition 2?

      Thanks

      Comment


        #4
        Originally posted by kenb2004 View Post
        OK, so
        Code:
        if (condition 1 is true) {
        startcountingbar = CurrentBar;
        }
        How do I make startcountingbar + 15 condition 2?

        Thanks
        Code:
        if (startcountingbar + 15 == CurrentBar) MakeMegaBucks();

        Comment


          #5
          Koganam

          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          37 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, Yesterday, 02:41 AM
          0 responses
          17 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          25 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          34 views
          0 likes
          Last Post CarlTrading  
          Working...
          X