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

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 Ludwik, Today, 03:52 AM
        0 responses
        1 view
        0 likes
        Last Post Ludwik
        by Ludwik
         
        Started by wuannetraam, Today, 02:40 AM
        0 responses
        8 views
        0 likes
        Last Post wuannetraam  
        Started by cyberpete76, 03-27-2023, 12:29 AM
        7 responses
        269 views
        1 like
        Last Post slightly  
        Started by renewsaltwater, Today, 01:15 AM
        0 responses
        2 views
        0 likes
        Last Post renewsaltwater  
        Started by slightly, Today, 12:49 AM
        0 responses
        4 views
        0 likes
        Last Post slightly  
        Working...
        X