• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Third-Party Assembly that Computes Indicator Values

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

    Using Third-Party Assembly that Computes Indicator Values

    Hi,

    I would like to call static methods from a third-party .NET 3.5 assembly that compute and return indicator values. I found instructions for adding references to dlls and that all works fine. I have created a new NinjaScript Indicator and added the required 'using' statement.

    An example method signature is,

    public static double[,] Compute(int period, int startRow, int endRow, double[,] data,
    int columnId, bool sizeToData = false)

    I am the developer of the third-party assembly so I can modify it if need be. I've searched, but cannot find any examples of using a third-party library like this within a NinjaScript indicator. Examples that simply return a constant value etc are not useful.

    If someone could post a link to an example or provide an example then I would appreciate it.

    Thanks,

    James

    #2
    Hello,

    Welcome to the NinjaTrader support forums!

    We don't have many (if any) examples or samples on developing your own external DLL since the majority of our customers wont be doing this. Its totally possible though and and I don't see any blockers on why would you would run into issues. What your talking about is just standard c# loading in an assembly and calling code from it. You would call the method from inside of OnBarUpdate() of the indicator that you build inside of NInjaTrader.

    If your running into a specific problem doing that or need a quick hand to get over the hill let me know what your having issue with and would be happy to comment further.

    -Brett
    BrettNinjaTrader Product Management

    Comment


      #3
      Hi Brett,

      Thank you for replying. I don't need help developing the external assembly. I've only just started using NinjaTrader hence my confusion.

      I'm not sure what NinjaTrader data I would pass to the external library and what format it is in. At the moment my library accepts multidimensional arrays of doubles. Is there an array of doubles, multidimensional or not, that I can use? I searched for an example of an external assembly being used like this, but the only example was one that returned the value 3. No examples of passing data to an external assembly.

      I was thinking that I could maintain my own private field that is a multidimensional array of doubles and has as many elements as is required by the indicators that I'm using. When data for a new bar comes in, I could shuffle the values back and add the new input value before calling the external assembly passing a reference to the input data. The external assembly has methods that compute and return the minimum number of rows required by each indicator function.

      Thanks,

      James
      Last edited by jalsck; 02-29-2016, 10:51 PM.

      Comment


        #4
        Looks like all is well using the approach I described in the previous post.

        Thanks,

        James

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rickyblah12, Today, 06:19 PM
        0 responses
        2 views
        0 likes
        Last Post rickyblah12  
        Started by ballboy11, Today, 05:22 PM
        0 responses
        2 views
        0 likes
        Last Post ballboy11  
        Started by ballboy11, Today, 04:33 PM
        2 responses
        3 views
        0 likes
        Last Post ballboy11  
        Started by dedouglas, Today, 03:16 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by TradeMyth, Today, 02:45 PM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X