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

How to define if(risingADX =True&&risingRSI =True){ExitShort}

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

    How to define if(risingADX =True&&risingRSI =True){ExitShort}

    Dear Team,
    I like strategy builder very much.
    But I don't know how to define such kind of logic in strategy builder.

    I have many condition groups in 'any' condition,it means ,any of the group condition can trigger the signal.

    But I want add some special condition to restrict all the groups,for example:

    if adx and rsi falling at the same time,no signal should be triggered:



    if not (risingADX =True && risingRSI =True)
    {
    if(conditiongroup1 | conditiongroup2|conditiongroup3)
    {
    Enterlong;
    }
    }

    I think this is a little hard,I really need your help,thank you so much!!

    I mean falling adx and falling ris happen at the same time,not either falling adx or falling ris.

    Last edited by williamzz; 08-16-2019, 04:30 PM.

    #2
    check link https://www.youtube.com/watch?v=JZpo01eSO9c

    example if (RSI(14,3).Avg[0]>=70 && Falling(Stochastic(7,14,3).D)==true)
    {

    }

    see link https://ninjatrader.com/support/help...t7/?rising.htm, same in NT8.
    you can also download help guide.:https://ninjatrader.com/Help-Connection-Guides.
    Last edited by Emma1; 08-03-2019, 12:55 PM.

    Comment


      #3
      Hello williamzz,

      Below is a link to a short video that demonstrates how this would look in the Strategy Builder of NinjaTrader 8.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Really appreciate your replies!
        Thank you!

        Comment


          #5
          Thank you for your reply.But it is not what I need.What I need is to tell the system if two conditions happen at the same time,one of my group condition should not be triggered as usual.

          For example I have a group named LongCondition1,I want to restrict the group,so that if the ris and adx falling at the same time,this group will not be triggered.

          What you just showed me is ,either falling ris or adx happens,the group will be restrict,but what I need is only when falling ris and adx happen at the same time,this group will be restrict.

          So your reply is falling ris or falling adx happen,the group will be restrict,but what I need is,only when falling ris and falling adx happen at the same time,the group will be restrict.

          Sorry my English is poor.
          Last edited by williamzz; 08-16-2019, 04:27 PM.

          Comment


            #6
            Try something simple like this directly (or assign it to a condition if you must use conditions)

            if (! IsRising(ADX(14)) && ! IsRising(RSI(14)))
            EnterLong;

            Cheers!

            Comment


              #7
              Thank you for your reply.

              What I need is:

              if (! ( IsRising(ADX(14)) && IsRising(RSI(14)) )
              EnterLong;

              Not

              if (! IsRising(ADX(14)) && ! IsRising(RSI(14)))
              EnterLong;

              Because,I need the two conditions happen at the same time,not either of them.

              Comment


                #8
                Originally posted by williamzz View Post
                Thank you for your reply.

                What I need is:

                if (! ( IsRising(ADX(14)) && IsRising(RSI(14)) )
                EnterLong;

                Not

                if (! IsRising(ADX(14)) && ! IsRising(RSI(14)))
                EnterLong;

                Because,I need the two conditions happen at the same time,not either of them.


                Disagree. Using the "!" and "&&" as I suggested above require both conditions to be present at the same time for the "if()" statement to be true.

                Perhaps a review of the Ninja help section would clear that:

                "&&" means (and) both condition must exist at the same time, and
                "||" means (or) either condition is enough.

                You do not have to use the "!" if instead using IsFalling as:

                if (IsFalling(ADX(14)) && IsFallingRSI(14)))





                Last edited by aligator; 08-16-2019, 07:49 PM.

                Comment


                  #9
                  Hello williamzz ,

                  Previously you have mentioned:
                  "if adx and rsi falling at the same time,no signal should be triggered:"

                  Is this still the case?

                  So if ADX() and RSI() are both not falling then allow for signal?

                  If not, what is the condition you want?
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Max238, Today, 01:28 AM
                  4 responses
                  35 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Started by r68cervera, Today, 05:29 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by geddyisodin, Today, 05:20 AM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by timko, Today, 06:45 AM
                  2 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Started by habeebft, Today, 07:27 AM
                  0 responses
                  7 views
                  0 likes
                  Last Post habeebft  
                  Working...
                  X