Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Call C/C++ DLL Functions from within my NinjaScript NT8 Indicator

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

    Call C/C++ DLL Functions from within my NinjaScript NT8 Indicator

    I have been trying to find out if it is possible to call C/C++ DLL functions from within NinjaSript.

    I know it is possible from C# but after doing some Googling, I am seeing mixed messages on the subject and most posts are very old.

    Does anyone know if this can be done, and if so, is the process exactly the same as doing it from C#?

    #2
    Hello BlakJak888,

    Welcome to the NinjaTrader forums!

    From my understanding this is possible, but please note this is outside of what is supported by NinjaTrader Support.

    The assemblies will need to be PInvoked using DllImport. (It will not be able to be referenced like a managed C# assembly)

    Below is a publicly available link to the microsoft documentation.
    https://docs.microsoft.com/en-us/dot...nterop/pinvoke

    A publicly available link to an educational site, StackOverflow.
    https://stackoverflow.com/questions/...dll-in-c-sharp

    And a link to an example.
    https://ninjatrader.com/support/foru...300#post777300
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I am glad to hear that it is possible since the internet was extremely vague and had differing views on the subject. I can handle the coding provided the platform will accept the external calls to the DLL.

      Comment


        #4
        Hello BlakJak888,

        NinjaScript is written in C# (.NET 4.5) and will have all of the abilities of .NET 4.5 application.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        62 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        50 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        59 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Working...
        X