• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to define if condition a,b,c occur at the same time,not trigger signal

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

    How to define if condition a,b,c occur at the same time,not trigger signal

    Dear Team,
    This will be a little hard.


    For example,usually I use groupA to entry long.

    But if the ATRTRING AND EMA and SuperTrend falling at the same time.

    In this scenario,groupA will not be triggered.

    How to do this in strategy builder?

    My challenge is in strategy builder I can only add one condition at a time to restrict groupA.

    For example,the the group for all I can add falling ATRTRING is not true and then add falling EMA is not true,and falling SuperTrend is not true.

    This means any of the 3 scenarios occurs, groupA will not be triggered,but what I really want is,only when the 3 scenarios occur at the same time,groupA not be triggered.

    So what I want is not:

    if (! a && ! b&& ! c)
    EnterLong;

    What I want is:

    if (!(a&&b&&c))
    EnterLong;

    Really Appreciate!

    Thank you!

    #2
    My challenge is in strategy builder I can only add one condition at a time to restrict groupA.

    For example,the the group for all I can add falling ATRTRING is not true and then add falling EMA is not true,and falling SuperTrend is not true.

    This means any of the 3 scenarios occurs, groupA will not be triggered,but what I really want is,only when the 3 scenarios occur at the same time,groupA not be triggered. xender discord omegle
    Last edited by WAILITA; 08-18-2019, 12:20 PM.

    Comment


      #3
      Hello williamzz,

      If a set of conditions are true you can always set a variable.

      However, I'd like to assist with the condition groups.

      When you mention:
      "what I really want is,only when the 3 scenarios occur at the same time,groupA not be triggered"

      So if the conditions for the first group are true AND

      IsFalling(ATR(14)) != false and isFalling(EMA(14)) != false and SuperTrend() != false,

      then trigger action?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you for your reply.

        Actually, it is when IsFalling(ATR(14)) != false and isFalling(EMA(14)) != false and SuperTrend() != false occur at the same time.
        Not only one of them occur or two of them occur,but 3 of them occur at the same time.

        Now I know how to do it by code:

        public bool conditionabc = true;

        if (IsFalling(ATR(14)) !=false && isFalling(EMA(14)) != false &&SuperTrend() != false
        )
        {
        conditionabc = true;

        }

        if(firstgroup&&conditionabc){
        EntryLong;
        }

        Actually,I can add conditonabc=true into firstgroup directly.

        Now I don't think strategy builder has such function to deal with such a complicated logic,right?
        Last edited by williamzz; 08-18-2019, 05:54 PM.

        Comment


          #5
          Hello williamzz,

          When you mention:
          "Actually, it is when IsFalling(ATR(14)) != false and isFalling(EMA(14)) != false and SuperTrend() != false occur at the same time."

          Is this when you want the action to happen or do you want the action suppressed?

          What you want to happen?

          Yes, the strategy builder can do OR and can do ANDS and can use variables that would be used in another condition set.

          Right now lets clarify on the condition and action you want.

          So if atr is falling and ema is falling and supertrend plot is true then trigger action?

          It almost doesn't sound like you need groups, just a few conditions
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            when IsFalling(ATR(14)) != false and isFalling(EMA(14)) != false and SuperTrend() != false occur at the same time,entry long will not be triggered by groupA. Otherwise in all other scenarios,entry long will be triggered normally by groupA.

            Comment


              #7
              Hello williamzz,

              Think of it the other way. What conditions need to be true for the action to take place?

              If (some unknown conditions here) AND IsFalling(ATR(14)) == false AND IsFalling(EMA(14) == false AND SuperTrend() == false, then trigger action?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank you very much!It is a very good idea.

                The reason why I did't think about this idea.Is because the structure of my strategy in strategy builder is like this:

                if any:
                (group1;group2;group3;groupA)

                Entry Long;

                This is many groups to one action. (GroupA is the group that I want to restrict.)

                But now I can change the structure into:

                if all/any
                group1

                Entry Long1;


                if all/any

                group2

                Entry Long2;

                if all/any

                group3

                Entry Long3


                if all/any
                groupA
                Entry LongA

                This is one group to one action.

                If so I can put IsFalling(ATR(14)) == false AND IsFalling(EMA(14) == false AND SuperTrend() == false into another group named groupRestrict.And build it like this:


                if all
                IsFalling(ATR(14)) == false
                IsFalling(EMA(14) == false
                SuperTrend() == false


                And then do like this:

                if all
                groupA;
                groupRestrict;

                Entry LongA


                At this time groupRestrict actually means:

                IsFalling(ATR(14)) == false
                IsFalling(EMA(14) == false
                SuperTrend() == false

                occur at the same time!Right?Because I used if all notif any.

                I'm very excited now.You help me a lot!


                I will try this.

                Really appreciate your following up and help!

                Comment


                  #9
                  Hello williamzz,

                  I have received a private email from you at platformsupport [at] ninjatrader [dot] com.

                  So that we are not communicating in two places, I will continue this conversation privately through email.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by superkolleech, Today, 12:46 AM
                  2 responses
                  12 views
                  0 likes
                  Last Post superkolleech  
                  Started by davidwade, Today, 02:51 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post davidwade  
                  Started by aviat72, 04-26-2020, 09:41 PM
                  10 responses
                  92 views
                  0 likes
                  Last Post kissandfly  
                  Started by healthooa, Today, 01:28 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post healthooa  
                  Started by harjinderjit, Yesterday, 08:24 PM
                  0 responses
                  20 views
                  0 likes
                  Last Post harjinderjit  
                  Working...
                  X