Announcement

Collapse
No announcement yet.

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.

    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.

        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];

            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?

                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.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by sjsj2732, Yesterday, 04:31 AM
                    0 responses
                    36 views
                    0 likes
                    Last Post sjsj2732  
                    Started by NullPointStrategies, 03-13-2026, 05:17 AM
                    0 responses
                    287 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    287 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    133 views
                    1 like
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    95 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Working...
                    X