Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exposing API

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

    Exposing API

    I have programmed a number of reusable public methods that I have packaged in an indicator. This indicator has no other purpose than to contain those public methods and is not meant to be applied to a chart. However its methods are by all my other indicators.

    I am now distributing these indicators in the form of a protected DLL to my clients and I was wondering if there would be a way for my clients to make calls to those public methods as well in their own custom programming. At this point, when they call those reusable methods, their system does not recognize them.

    Thanks!

    #2
    Hello,

    How are you accessing the methods yourself then? Just not clear on yor full setup here.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      I simply call the method from within code and it works like a charm. But the clients who import the protected DLL don't have the same ability. When they try to do it it tells them that the method that they are calling does not exist in the context.

      Comment


        #4
        Hello,

        Yes this looks to be a namespace issue most likely. Just double checking you have them set to public methods correct and its still giving you error?

        I look forward to assisting you further.
        BrettNinjaTrader Product Management

        Comment


          #5
          Yes every single method is defined as public and I have no issue calling them from any of the indicator on my workstation. However, when exported as a protected DLLs, my clients can no longer call them via custom programming. They keep getting a message that those methods do not exist in the context. Is there a "using" command or a DLL reference that I need to have them add so that they can call those methods from within their own code?

          Comment


            #6
            Hello,

            Ultimately I would just have to test if this would work or not. I can test on my side if you want to send me the protected version to support at ninjatrader dot com ATTN: Brett and reference this forum post.

            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment


              #7
              Thanks for the offer but I was able to fix the problem. It seems that in my code (with all indicator present in 'raw' form), I can just use the public method by referring to it by name without specifying the indicator that contains it, e.g. isThisAValidBar();

              However when exported in the form of a DLL, the user must refer to it as:
              ContainingIndicatorName().isThisAValidBar();

              Problem fixed.

              Thanks for your help.

              Comment


                #8
                Hello,

                Excellent, thanks for posting for others to benefit what was needed.
                BrettNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by trader2be View Post
                  Yes every single method is defined as public and I have no issue calling them from any of the indicator on my workstation. However, when exported as a protected DLLs, my clients can no longer call them via custom programming. They keep getting a message that those methods do not exist in the context. Is there a "using" command or a DLL reference that I need to have them add so that they can call those methods from within their own code?
                  You have to instruct your clients to open any indicator in the editor, right-click in there, and add your dll as a reference.

                  ref: http://www.ninjatrader.com/support/h...indicators.htm

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  580 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  335 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  102 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  554 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  552 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X