Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to use series[0] in VisualStudio 2019

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

    How to use series[0] in VisualStudio 2019

    Hello to the Forum,

    I want to outsource parts of my program into a dll.
    My methods use series[0] among others.

    If I want to use a series[0] with Visualstudio, I am missing the correct using directive or an assembly reference.

    class myClass
    {
    public double MyDouble (Series<double> unknown(!?) ) {}
    }

    using System.Web.UI.DataVisualization.Charting;
    using System.Windows.Forms.DataVisualization.Charting;
    also does not work.

    How can I add a series to my class library?

    Thanks for your support!
    user10


    #2
    Hello user10,

    Series<T> objects are constructed using an existing instance of an indicator or strategies primary series. These will not work outside of an indicator or strategy.

    You could, however, supply the instance of the strategy or indicator to your custom method.

    This would be outside of what is supported by NinjaTrader Support, however I have some examples of static classes that may give you some ideas.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,
      hello to the forum,

      thank you for the hint!
      My methods already work within NT8 .
      But because the code is quite large in the meantime, I want to swap parts of the code into a dll.
      I have already done this successfully for several methods.

      My problem is that in my methods a series is often compared.
      Example: (if series[0] > series[1]) do something;

      Because series[0] does not work in a dll, I tried to solve the problem with an array.
      But this solution is quite slow.

      Is there any experience how the comparison of current to previous value in a dll can be queried quickly and easily?
      Is the integration of Excel an option?

      Thanks for your support!
      user10

      Comment


        #4
        Hello user10,

        If an instance of a script is provided to an external class, all of the children of that instance can be accessed, such as any Series<T> objects initialized within the script.

        Outside of an indicator or strategy class, Series<T> cannot be used.

        Excel is far outside of what is supported by NinjaTrader. However, below is a link to a forum thread that has some unsupported tips.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        12 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        7 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Working...
        X