Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

One trade per bar

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

    One trade per bar

    How do we limit trades to only one or any number specified per bar / signal? I see it take several hundred on the same bar.
    Thanks.

    #2
    Hello,

    Are these entries and exits or are you just entering the same direction over and over?

    This could relate to the setting you are using for Entries Per Direction.



    You could also add more filtering such as a Position check in case you are doing tick by tick calculations.


    Another idea is to use BarsSinceEntryExecution.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by Trader17 View Post
      How do we limit trades to only one or any number specified per bar / signal? I see it take several hundred on the same bar.
      Thanks.
      Then obviously you are unlikely to be using Calculate.OnBarClose.

      That means that you have to write logic to ensure that things only happen as often as you want. You will need a counter to track your number of entries, and prevent any further entries once the limit is reached. You will have to reset the counter on each bar.

      It is too hard to give you code in a vacuum. Post what you have, and someone will be able to put in the additions for you.

      Comment


        #4
        Yes over and over in the same bar. So if I use Bars since Entry > 0 that will solve the problem of not taking another trade on the same bar?
        Thanks.

        Comment


          #5
          Hello,

          Thank you for the reply.

          Yes potentially, when developing your strategy you would need to try different combinations of items to see what works best for what you are trying. I can only suggest items for you to try, to locate the answer you would need to test this concept using a NinjaScript file and see what the outcome is.

          I could suggest adding a condition that uses BarsSinceEntryExecution and see if that solves it. If not, as koganam noted it is difficult to understand the problem with few details.

          If you can post the strategy or more details surrounding its use that would be helpful. But we could still only speculate what may be happening, you would likely still need to test whatever ends up being discussed so I would suggest first adding the BarsSinceEntryExecution and if that does not work, provide what you tried and the outcome so we can see where you are at in the script.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Barry Milan, Today, 10:35 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,428 views
          0 likes
          Last Post Handclap0241  
          Started by DJ888, Yesterday, 06:09 PM
          2 responses
          9 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          40 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Today, 08:51 AM
          2 responses
          16 views
          0 likes
          Last Post bill2023  
          Working...
          X