bboyle1234
08-10-2008, 04:25 AM
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:
namespace ClientTraderConnectionClass
{
public static class StopLosses
{
public static double GetTest()
{
return 10;
}
}
}
I want in indicator inside NinjaTrader to call the "ClientTraderConnectionClass.StopLosses.GetTest()" 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()"
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
C:\ClientTraderConnectionClass.dll.
The code used to create this class is:
namespace ClientTraderConnectionClass
{
public static class StopLosses
{
public static double GetTest()
{
return 10;
}
}
}
I want in indicator inside NinjaTrader to call the "ClientTraderConnectionClass.StopLosses.GetTest()" 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()"
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