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 usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      23 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      22 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X