Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop strategy at predetermined price point

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

    Stop strategy at predetermined price point

    I am using the strategy builder and would like to know how to have your strategy stop trading once a certain price point has been reached in the market e.g. My strategy runs on long positions and i want it to keep buying off set parameters until a set price has been reached that i have pre determined may be the end of the long trend.

    #2
    Hello CoreyS,

    Thanks for your post.

    You could try using a bool to determine when the strategy will place trades.

    A bool variable could be created in the Inputs and Variables screen of the Strategy Builder. A condition could be set up to check if the strategy should place trades and then you could set the bool variable to true. In your conditions to place the entry order, include a condition that checks if the bool is true and then call your entry order method.

    Then, create a condition that checks for when you would like the strategy to stop placing trades (such as checking if the Close price is greater than a certain value) and set the bool to false.

    By doing this, the strategy would only place orders when the bool is true and the bool will be false when the condition to stop placing trades occurs.

    See the help guide documentation below for more information.

    Strategy Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi Brandon,
      Thanks for your reply. I fundamentaly understand what you are suggesting although iam not sure exactly how to implement it. Could you please provide a bit more detail e.g. screenshots on what this would look like in the condition builder?
      Thanks,
      Corey

      Comment


        #4
        Hello Corey,

        Thanks for your notes.

        See the attached example script demonstrating what this might look like in the Strategy Builder.

        In your script, you would need to create a bool in the Inputs and Variables screen. In the Conditions and Actions screen, create a condition that checks if the Close price (Price folder > Close) is less than a Numeric value (Misc folder > Numeric value) and flip the bool to true. Then create a condition that checks if the bool is true and checks for your order entry conditions and place your entry order. Finally, create a condition that checks if the Close price is greater than a Numeric value and set the bool to false.

        Conditions: https://ninjatrader.com/support/help...on_builder.htm
        Actions: https://ninjatrader.com/support/help...t8/actions.htm​​
        Attached Files
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi Brandon,
          Thanks for your help. The information you provided does in fact close my trades at a specific price point. However, what i was after was something that closes my trades and stops the strategy from entering any further trades. As it is if price pulls back below the set price it will continue to enter into trades.
          Cheers,
          Corey

          Comment


            #6
            Hello Corey,

            Thanks for your notes.

            A bool variable along with custom logic could also be used to control when the strategy stops or continues placeing trades.

            You would need to add custom logic to your script that flips the bool back to true when you want the strategy to continue placing trades.

            For example, create your condition that checks if the price pulls back below the set price, flip the bool to true, and in your entry order condition you would check if the bool is true.

            Once the bool is true when the condition to flip the bool back to true occurs, the strategy will place entry orders. When the bool is false, the strategy would stop placing entry orders.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            63 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            139 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X