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 bortz, 11-06-2023, 08:04 AM
          47 responses
          1,607 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          15 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X