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 RDTrader16, Today, 10:19 PM
          0 responses
          5 views
          0 likes
          Last Post RDTrader16  
          Started by gemify, 03-08-2023, 08:02 AM
          9 responses
          148 views
          0 likes
          Last Post culpepper  
          Started by elirion, Today, 10:03 PM
          0 responses
          1 view
          0 likes
          Last Post elirion
          by elirion
           
          Started by RaddiFX, Today, 09:55 PM
          0 responses
          9 views
          0 likes
          Last Post RaddiFX
          by RaddiFX
           
          Started by Trader146, 03-29-2024, 01:22 PM
          4 responses
          27 views
          0 likes
          Last Post Trader146  
          Working...
          X