Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set 1 + Set 2 = Trade

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

    Set 1 + Set 2 = Trade

    Hello, how can I make sets ?

    If set 1 = true, wait until set 2 = true then place a trade

    #2
    Hello Uregon,

    Thanks for your note.

    You could consider creating two bool variables (initially set to false) in the Inputs and Variables screen of the Strategy Builder.

    In the Conditions and Actions screen of the Strategy Builder, you would create a condition in Set 1 and set the first bool to true. You would create a condition is Set 2 and set the second bool to true. Then, in Set 3 you would create a condition that checks if the two bool variables are true and call your Entry order method.

    By doing so, the Entry order method would only be called once both variables evaluate to true.

    For example, see below.

    Code:
    //Set 1
    if (<condition 1>)
    {
        bool1 = true;
    }
    
    //Set 2
    if (<condition 2>)
    {
        bool2 = true;
    }
    
    //Set 3
    if (bool1 == true && bool2 == true)
    {
        //do something
    }
    See the help guide documentation below for more information about working with the Strategy Builder.
    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

    Let me know if I may assist further.
    Last edited by NinjaTrader_BrandonH; 07-08-2022, 08:05 AM.
    <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
      NinjaTrader_BrandonH

      Thank you.

      I did it like you explained, but then it seems it is true all the time and place orders every new price movement.

      Comment


        #4
        Only enter one time Short after this signals are true together.

        So the pink square is the activator

        after this square is coming, strategy is waiting for the signal 2 and enter one short trade.

        Comment


          #5
          The bools will remain true until you reset them to false.

          The conditions in set one and two will only set the bool to true when the condition is true however when the condition is false the bool is not set false.

          You have to reset the bools to false, after the action in set 3.

          Once set to false then set one and two can then change the bools to true when the conditions are once again true.

          Comment


            #6
            Tasker-182 You´re my man, thank you !

            Comment


              #7
              Hello Uregon,

              Thanks for your note.

              Tasker-182 is correct. The bools will remain true in your strategy unless you set it to false.

              Something you could consider is flipping the bools to false in the same Set as your entry order method, after the entry method call. This way they bool will be set to false after your entry method is called to enter a position.

              For example, see the attached screenshot.

              Let me know if I may assist further.
              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


                #8
                NinjaTrader_BrandonH

                Hi Brandon, yes I´ve set it like this and it works.

                Now I only have to make the right order settings.

                Bool1 is the first and after it Bool2 should be triggered

                So its not possible that Bool2 is true + Bool1 is true and enter a trade.

                I´d like to enter a trade only if after Bool1 a Bool2 is coming.

                As example:
                Bool2 = true
                Bool 1= true
                no trade

                Bool1 = true
                Bool2 = true
                trade

                Comment


                  #9
                  So only if Bool1 is true
                  the strategy can wait for Bool2 is true

                  Comment


                    #10
                    I solved it NinjaTrader_BrandonH

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by BeachTrader11807, Today, 01:14 PM
                    3 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by futureszone, Today, 06:09 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post futureszone  
                    Started by futureszone, 02-07-2025, 02:48 AM
                    2 responses
                    21 views
                    0 likes
                    Last Post futureszone  
                    Started by cutzpr, Today, 05:24 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post cutzpr
                    by cutzpr
                     
                    Started by Ezequiel40, Today, 05:23 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post Ezequiel40  
                    Working...
                    X