Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to limit entries in current bar?

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

    How to limit entries in current bar?

    Hello, for some reason multiple orders are opening and closing on the same bar when using my auto strategy. I have the EntriesperDirection set to 1. How can I limit this through the strategy wizard?

    #2
    you're probably executing the OnBarUpdate() function for every tick, when you want to do it at the end of each bar (the close of the bar).

    you want to be sure you're calculating at the end of the bar.

    CalculateOnBarClose = true;
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      Thanks mrlogik for your reply.

      No, I actually want to execute live, not at the end of bar. So, every time a new tick makes my conditions true while the bar is still open, a new order is entered and then closed and so on. I've tried the crossbellow/crossbove funtions, but I'm still getting multiple orders.

      Comment


        #4
        abarb26,

        If you want it to calculate on every tick then as your conditions become true they will keep submitting orders. This is what you are seeing. You need to make stricter rules if you want it to not trade so often.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh. I'll work on stricter rules and post again if any questions.

          Comment


            #6
            I've been playing with the BarsSinceEntry() rule to limit the entries per bar and for some reason it's not working. I've been doing it through the Strategy Wizard since I have no programming knowledge.

            This is what I currently have:
            Left side: BarsSinceEntry() > Right Side: Numeric Value: 1

            Is this the correct way to enter a new position only after a new bar has opened? Keep in mind I need signals in real-time and not at bar close.

            Thanks

            Comment


              #7
              abarb26,

              Remember that if you have never traded yet BarsSinceEntry() will not be > 1. You need to create two sets. One for the first trade and then the rest for the others.

              Depending on what your ideas are you may need to unlock the code to achieve it.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              650 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X