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

Limiting Trades Intra Bar

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

    Limiting Trades Intra Bar

    When a strategy is set to calculate signals on each tick intra bar, is there a way to limit the number of trades intra bar using Strategy Builder? I have seen the condition if bars since last exit is say one then ok to take next trade. I guess that works after a bar closes.
    Thanks.

    #2
    Hello Trader17,

    If your condition can become true on every tick its best to use a bool variable. In your entry condition you would check if the bool variable is false and if so allow the entry. As an action in the entry condition set the bool variable to true to turn off the entry condition after the first entry. You would then need an additional set before that which checks the first tick of the bar to reset the bool variable back to false so the condition can continue to work on the next bar.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks NinjaTrader_Jesse Now this will work for one trade. Because after one trade I assume it will wait for first tick of bar to reset it. What if you allow 3 trades intra bar on same bar? Does NT8 have something to count trads per bar intra bar?
      Thanks.

      Comment


        #4
        Hello Trader17,

        You would have to implement your own logic for that specific purpose, an int series can be used to count the number of times your condition is true. You would still need to use a bool variable to turn the condition off once you have met the number of trades you wanted.

        There is a sample of counting events in the builder here: https://forum.ninjatrader.com/forum/...rategy-builder
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        2 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        11 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        12 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X