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

Using 3rd party indicators

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

    Using 3rd party indicators

    Hi,

    I'm new to NinjaTrader programming but have a fair amount of experience with programming in general.

    I'm using a 3rd party indicator (DLL) in a strategy I am developing. I have added a reference to the indicator as outlined in the help. I also have the indicator loaded on the chart that I am attaching the strategy to.

    The problem is I don't seem to be able to get the data from the indicator.

    Any ideas why I can't get the data from the indicator?

    Thanks

    #2
    kcyster, welcome to our forums - any errors in your log tab of the Control Center as you try to access the indicator value from the strategy? Please check off the overload used in your code with the help of Intellisense to ensure the proper one is used.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I get the following error:

      "Error on calling 'OnBarUpdate' method for strategy 'MPT'. Index was outside the bounds of the array"

      The code I'm using is:

      FourXTLDTS DTS = new FourXTLDTS();


      double test = DTS[1];

      What I want to do is simply read the value of the last completed bar of indicator 'FourXTLDTS'. I know I'm missing something but I just can't figure it out. Any help will be greatly appreciated.

      Thanks

      Comment


        #4
        I'm not sure I follow what you attempt doing here - if the indicator is already available as method from the added DLL the array code should not be needed, you could directly call the indicator value in your strategy OnBarUpdate(), please use Intellisense to show you the proper overload here.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi,

          When I use the intellisense, I see all the standard indicators but I do not see the custom indicator that I am trying to use. I have also set a reference to the indicator and then used intellisense but it still does not work. I continue to get the same error.

          Could you provide an example of how I would call the indicator value directly from the OnBarUpdate() routine.

          Thanks

          Comment


            #6
            Is the DLL resting in the bin > Custom folder and did you restart NT after adding it so it could be loaded up?

            I would not know how your indicator is called but this is the general way double value = MyIndicator(Parameters.....)[0];
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi,

              The DLL is resting in the bin/custom folder and I have restarted NT to make sure it is loaded up. I can add the indicator to a chart as it shows up in the indicator box so I can select it to add to the chart.

              I added the generic code (double value = FourXTLDTS(0.02, 0.2, 0.02)[0];) you provided (which is how I thought it should be called) but I get a compiler error " 'NinjaTrader.Indicator.FourXTLDTS' is a 'type' but is used like a 'variable' ".

              The parameters are the exact same as I use when the indicator is attached to my chart.

              Thanks

              Comment


                #8
                If you type in ' this.FourXTLDTS( ' without the quotes, which overload(s) does the compiler then expect? Do you need to access any method from the indicator to get the value you seek?
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hi,

                  When I type in this.FourXTLDTS( --- no overloads appear from intellisense.

                  When I type in this.FourXTLDTS(); --- I get the following compiler error " 'NinjaTrader.Strategy.MPT' does not contain a definition for 'FourXTLDTS' "

                  Thanks

                  Comment


                    #10
                    Hmm, if this is a native NinjaTrader exported assembly / DLL you would not need a 'using' directive - it's probably best you contact the 3rd who developed the indicator to clarify how to programmatically access value from it.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by pmachiraju, 11-01-2023, 04:46 AM
                    8 responses
                    149 views
                    0 likes
                    Last Post rehmans
                    by rehmans
                     
                    Started by mattbsea, Today, 05:44 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post mattbsea  
                    Started by RideMe, 04-07-2024, 04:54 PM
                    6 responses
                    33 views
                    0 likes
                    Last Post RideMe
                    by RideMe
                     
                    Started by tkaboris, Today, 05:13 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post tkaboris  
                    Started by GussJ, 03-04-2020, 03:11 PM
                    16 responses
                    3,283 views
                    0 likes
                    Last Post Leafcutter  
                    Working...
                    X