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

Unable to find entry point (connecting to a dll)

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

    Unable to find entry point (connecting to a dll)

    Hi, I have created a very simple .dll and saved it on my computer as
    C:\ClientTraderConnectionClass.dll.

    The code used to create this class is:

    Code:
     namespace ClientTraderConnectionClass
    {
        public static class StopLosses
        {
            public static double GetTest()
            {
                return 10;
            }
        }
    }
    I want in indicator inside NinjaTrader to call the "ClientTraderConnectionClass.StopLosses.GetTes t()" function, but so far I'm not sure exactly how to do that. Here is the code I have in my indicator, which is throwing the error "Unable to find entry point "GetTest()"

    Code:
    public class StopLosses : Indicator
        {
            [DllImport("C:/ClientTraderConnectionClass.dll")]
            public static extern double GetTest();
    
            protected override void OnBarUpdate()
            {
                try 
                {
                    TestNumber.Set(GetTest());
                }
                catch(Exception ex) 
                { 
                    TestNumber.Set(-5);
                }
            }
        }
    Can someone please help me setup this function correctly? I have also tried using the line:

    TestNumber.Set(ClientTraderConnectionClass.StopLos ses.GetTest()); to no avail.

    Thanks in advance,
    Ben

    #2
    Unfortunately that is beyond what we provide support for. As last resort you could contact a certified NinjaScript consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Unfortunately that is beyond what we provide support for. As last resort you could contact a certified NinjaScript consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm
      Thanks Dierk, I know that ... am used to reading it from you on this forum... Hoping other developers out there might read the thread and have something to offer

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 09:41 AM
      0 responses
      1 view
      0 likes
      Last Post rocketman7  
      Started by rocketman7, Today, 02:12 AM
      7 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by guillembm, Yesterday, 11:25 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by junkone, 04-21-2024, 07:17 AM
      10 responses
      149 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by tsantospinto, 04-12-2024, 07:04 PM
      6 responses
      101 views
      0 likes
      Last Post tsantospinto  
      Working...
      X