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

Strategy Builder - Limit One Trade Entry per Intra-Bar Problem

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

    Strategy Builder - Limit One Trade Entry per Intra-Bar Problem

    Hi there,
    I was wondering, maybe someone else has had the same issue, when it comes to using Strategy Builder for Auto Trading.
    This pertains to Entering on Intro-Bar. Not on Bar Close.
    That within different strategies being created, that use completely different indicators or price action for an entry signal.

    Is there any "generic" way to control how many entries per single bar the strategy takes for IntroBar trades?
    I of course, only want, 1 entry on any given bar, that meets all the requirements for the trade to be taken per strategy rules.


    I have strategies I've created that I like. But sometimes the strategy will take a second trade on the same bar before it closes.
    I've tries using a few different things to control this, but none of them work 100%. Like monitor unrealized P&L on the Bar(0), that don't work completely because if the first trade closes the unrealized P&L goes back to Zero (0) , then the strategy would allow another second trade to be placed on that same bar - But only sometimes, it looks like it depends on what the indicators being used, are doing on that Bar.

    Or
    I've tried to limit the values for an entry with < & > commands on an indicator value, in the strategy and they too, only work sometimes.
    sometimes I get double entry per bar, or sometimes if the market is moving fast, the indicator would jump across the whole range i set, then for that trade, the strategy don't take the trade at all. because all of my rules don't get met.

    I don't really see any command in Strategy builder for this issue. So I assume the only way to control this, is more complexed ways of coding the indicator being used or the price action type, being used in the Strategy Builder.

    Best Regards

    #2
    Hello Genesis2021,

    Thanks for your post.

    You can add a single condition and action to your exiting entry set(s) which will limit your orders to once per bar.

    Here is a short video that shows how to add this: https://Paul-ninjaTrader.tinytake.co...Nl8xNDc5OTg3Mg

    Again what is shown is added to the same sets where your entry conditions currently are.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Paul,
      Thank You for your reply, this is just what I was looking for.
      That worked great.
      Br.
      Last edited by Genesis2021; 02-03-2022, 11:28 PM. Reason: Clarity

      Comment


        #4
        This video shared by Paul doesn't seem available anymore. I was looking for a solution to the same problem. Would appreciate if it re-shared, or just guided to how to achieve this. Thank you!


        Originally posted by Genesis2021 View Post
        Hi there,
        I was wondering, maybe someone else has had the same issue, when it comes to using Strategy Builder for Auto Trading.
        This pertains to Entering on Intro-Bar. Not on Bar Close.
        That within different strategies being created, that use completely different indicators or price action for an entry signal.

        Is there any "generic" way to control how many entries per single bar the strategy takes for IntroBar trades?
        I of course, only want, 1 entry on any given bar, that meets all the requirements for the trade to be taken per strategy rules.


        I have strategies I've created that I like. But sometimes the strategy will take a second trade on the same bar before it closes.
        I've tries using a few different things to control this, but none of them work 100%. Like monitor unrealized P&L on the Bar(0), that don't work completely because if the first trade closes the unrealized P&L goes back to Zero (0) , then the strategy would allow another second trade to be placed on that same bar - But only sometimes, it looks like it depends on what the indicators being used, are doing on that Bar.

        Or
        I've tried to limit the values for an entry with < & > commands on an indicator value, in the strategy and they too, only work sometimes.
        sometimes I get double entry per bar, or sometimes if the market is moving fast, the indicator would jump across the whole range i set, then for that trade, the strategy don't take the trade at all. because all of my rules don't get met.

        I don't really see any command in Strategy builder for this issue. So I assume the only way to control this, is more complexed ways of coding the indicator being used or the price action type, being used in the Strategy Builder.

        Best Regards

        Comment


          #5
          Hello sampurna,

          Thank you for your post.

          You could create a bool variable to keep track if it is still okay to trade on that bar, and create a condition that checks IsFirstTickOfBar to see if a new bar has formed, then set the bool to true within that condition.

          Then, in your order entry condition check if the bool is true, call your order entry method within the condition and flip the bool to false.

          By doing so, the order will only be placed when the bool is true and the bool will only be flipped to true when a new bar has formed.



          Please let me know if you have any further questions. ​
          Gaby V.NinjaTrader Customer Service

          Comment


            #6
            Thanks Gaby, appreciate the response. That helped and was very clear. Apologies I missed responding earlier.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            21 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X