Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy executing on every bar

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

    Strategy executing on every bar

    I am in need of help. I have a strategy that i use an indicator with. I used the builder and put in if price high/low goes 1 tick beyond indicator to execute a long/short position for a 1 point scalp.
    It will execute a position on every bar above/below the indicator. Is there a way i can get it to execute once until indicator is reset or waits a certain number of bars?

    Thanks

    #2
    Hello kdaugherty1987,

    Thanks for your post and welcome to the NinjaTrader forums!

    In the Strategy Builder you can create a bool variable (on the Inputs and Variables page), and as part of the entry conditions check that the bool variable is true and then in the "do the following" section of that set, set the bool to be false. This will prevent that set from placing any further orders until the bool is reset to true and the entry condition is true again. You can then create another set that you would use to set the bool back to true based on your preferred reset condition.

    Reference: https://ninjatrader.com/support/help...ariablesScreen

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello kdaugherty1987,

      Thanks for your post and welcome to the NinjaTrader forums!

      In the Strategy Builder you can create a bool variable (on the Inputs and Variables page), and as part of the entry conditions check that the bool variable is true and then in the "do the following" section of that set, set the bool to be false. This will prevent that set from placing any further orders until the bool is reset to true and the entry condition is true again. You can then create another set that you would use to set the bool back to true based on your preferred reset condition.

      Reference: https://ninjatrader.com/support/help...ariablesScreen
      Hi Paul,

      I am trying to follow your instructions here with setting up a bool variable because I have the same problem. However, in the "Do the following" area, it won't let me choose any variables. It only lists Drawing, Misc, and Order Management as options. I am able to put it in the conditions area though. Any thoughts on how to help would be greatly appreciated. Thanks-

      Maria

      Comment


        #4
        Hello marialewis16,

        Thanks for your post.

        For the bool variable to be able to be changed by the strategy, you need to make sure you create it as a variable and not as an Input.

        To be able to set the bool variable to a different state, you can only do that in a "do the following" (also referred to as the action) section of a set.

        I've attached two screenshots, the larger one shows a bool variable named "Test" created in the variables section of the input and variables window.

        Click image for larger version

Name:	marialwis16-1.PNG
Views:	392
Size:	22.1 KB
ID:	1148234

        In the smaller screenshot, this is from the "do the following" section of a set where you can see the action is to "Set Test"

        Click image for larger version

Name:	marialwis16-2.PNG
Views:	393
Size:	10.0 KB
ID:	1148235

        References:



        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 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