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 Mestor, 03-10-2023, 01:50 AM
          16 responses
          388 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          31 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by yertle, Yesterday, 08:38 AM
          7 responses
          29 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by bmartz, 03-12-2024, 06:12 AM
          2 responses
          22 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by funk10101, Today, 12:02 AM
          0 responses
          7 views
          0 likes
          Last Post funk10101  
          Working...
          X