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

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.

    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.

        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.

            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.

                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 bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,606 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  19 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  15 views
                  0 likes
                  Last Post Javierw.ok  
                  Working...
                  X