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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X