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 samish18, 04-17-2024, 08:57 AM
          16 responses
          55 views
          0 likes
          Last Post samish18  
          Started by arvidvanstaey, Today, 02:19 PM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by jordanq2, Today, 03:10 PM
          2 responses
          8 views
          0 likes
          Last Post jordanq2  
          Started by traderqz, Today, 12:06 AM
          10 responses
          18 views
          0 likes
          Last Post traderqz  
          Started by algospoke, 04-17-2024, 06:40 PM
          5 responses
          47 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X