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

ADXR-Problem

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

    ADXR-Problem

    Hello !
    I try to use the ADXR, a basic indicator in Ninja, to create a costume indicator. My script is not ok when i use ADXR -
    it shows an error in the following script-line:

    // Calculate ADXR value
    double value = ADXR (Period)[0];

    "No overload for method "ADXR" takes "1" argument"


    When i change it to the simple "ADX" everything is working well.

    // Calculate ADX value
    double value = ADX (Period)[0];

    I created it whith the wizard.

    Any ideas ?
    i am new in coding - so please try it in words for newbies ;-)
    Thanks max-td

    #2
    You need to use one of these syntax-ings for ADXR.
    Code:
    ADXR(int  interval, int period)[int barsAgo] 
    ADXR(IDataSeries  inputData, int interval, int period)[int barsAgo]
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      OK, and in wich area of the script do i place this ?
      Do i need additional ; or ( ) then somewhere ?

      Comment


        #4
        You need ; at the end of every line except for when you are making if-statements or loops or similar.

        You use this syntax anywhere you want it.

        double value = ADXR(5, 10)[0];
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh - the thing works !
          I corrected my script like the code-piece from your second posting.
          Was my code wrong because ADXR has got 2 parameters?

          What for was the thing from your first post ?

          max-td

          Comment


            #6
            ADXR has 2 parameters so you need to call it with 2 parameters. My first response is the general form syntaxing. You need to fill in the associated parameters with proper values.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mattbsea, Today, 05:44 PM
            0 responses
            3 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            31 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            2 views
            0 likes
            Last Post tkaboris  
            Started by GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,282 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            20 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Working...
            X