Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data from Indicator on external C# program

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

    Data from Indicator on external C# program

    Hi.

    Please, how can I get data that provides an Indicator (obviously built in NinjaScript) in an external C# program (using Visual Studio)?

    Currently, I have observed that Indicators developed in NinjaScript are only for drawing lines above the candlesticks during a normal operation.

    When I create a reference of the NinjaTrader.Client.dll, I can only call a list of specific methods, but I can't find NinjaScript methods like OnBarOpen, OnBarClose, CurrentBar, OnBarUpdate, and others.

    Maybe, if I can get data from an indicator, I can combine the execution of indicators within NinjaTrader 8 plus the execution of other calculations, all on the external C# program.

    I'm using NinjaTrader 8. Thanks for your cooperation.

    Regards.

    Gustavo

    #2
    Hello excepticons, and thank you for your question. There are many methods to import symbols from a .dll file. The most popular in C# is the DllImport method, publicly available documentation here,



    However, there is no matching DllExport method unless you add third party software to your Visual Studio installation. Since I can't see on my end which decisions you made as far as making symbols available to your other program, would it be possible to provide a stripped down code sample with your progress so far? This will just give me a better understanding of the situation so I can give the best help possible.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi, Jessica.

      Thanks for your reply.

      I need to trigger a method on my Visual Studio C# program, based on a return value of a installed and compiled NinjaScript Indicator. That's it.

      Something like image attached. ( )

      Thank you, Jessica.
      Attached Files

      Comment


        #4
        Thank you for the additional information excepticons. Since Microsoft only supports this sort of dll exporting for C++ natively, and NinjaTrader is written in MSDN C#, you will need to search the internet for a DllExport tool to make this possible. This publicly available stack overflow conversation will have more information on this topic.

        In VS C/C++ you could use extern "C" __declspec(dllexport) -function declaration-. How do I accomplish this in a C# dll? Is there C# code equivalent to the above code? Edit: More info I am tryi...
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          382 views
          1 like
          Last Post Gavini
          by Gavini
           
          Started by oviejo, Today, 12:28 AM
          0 responses
          1 view
          0 likes
          Last Post oviejo
          by oviejo
           
          Started by pechtri, 06-22-2023, 02:31 AM
          10 responses
          125 views
          0 likes
          Last Post Leeroy_Jenkins  
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Yesterday, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Working...
          X