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

Help with Rising

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

    Help with Rising

    Hello I can not compile new parameter for ADRX

    adxrUP = 35 ( is "private int" in variable region and "public int" in properties region

    It is functional :
    // Condition set 1
    if ( Close[0] > Close[1]
    && ADXR(12, 15)[0] > adxrUP
    {
    EnterLong(DefaultQuantity, "");
    }
    But I can't compile this:


    // Condition set 1
    if ( Close[0] > Close[1]
    && adxrUP > (ADXR(12, 15)[0] > ADXR(12, 15)[1] )
    {
    EnterLong(DefaultQuantity, "");
    }
    Or this
    // Condition set 1
    if ( Close[0] > Close[1]
    && ADXR(12, 15)[0] > adxrUP
    && Rising (ADXR(12, 15)[0] > adxrUP) = true; )
    {
    EnterLong(DefaultQuantity, "");
    }
    I'm not a programer... sorry, but I have learned a lot in this forum

    Thanks

    #2
    Hello franki,

    Thanks for your post and welcome to the forums!

    On this line: && adxrUP > (ADXR(12, 15)[0] > ADXR(12, 15)[1] )

    The adxrUP > cannot be evaluated because this section ADXR(12, 15)[0] > ADXR(12, 15)[1] does not resolve as a numerical value, it will resolve as either true or false so the expression is adxrUP > true (or false) is not correct. I'm not entirely certain what you are trying to evaluate but this should work:

    && adxrUP > ADXR(12, 15)[0] && ADXR(12, 15)[0] > ADXR(12, 15)[1])

    On this line: && Rising (ADXR(12, 15)[0] > adxrUP) = true; )

    Rising() will resolve as either true or false so somewhat the same as before, Rising (true or false) > (ADXR(12, 15)[0] is not correct. Also, Rising() requires a dataseries as the input and by using [0] it would not accept as that would be a singular double value.
    Try this:

    && Rising(ADXR(12, 15)) && ADXR(12, 15)[0] > adxrUP)



    References: http://ninjatrader.com/support/helpG...htm?rising.htm

    This link will take you to educational resources which will provide further links to help with your programming efforts: http://ninjatrader.com/support/helpG..._resources.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Very thanks Paul

      The product of ADRX is a line that shows the strength of the trend
      AdrxUP is the largest value I need to allow operations
      That is why adrxUP > is more than the result of ADRX (12, 14)
      If adrxUp has a value of 30, the strategy does not operate if the result of ADRX (12, 14) is less than 30
      When the ADRX value (12, 14) exceeds 30 it launches orders until the value returns to less than 30
      My intention is that when ADRX makes its maximum value, it does not return to operation if it is descending


      Try this:

      && Rising(ADXR(12, 15)) && ADXR(12, 15)[0] > adxrUP)
      This is the option I'm using and it is the result that I have been looking for

      very thanks again Paul

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      18 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X