Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing data from Multiple Symbols

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

    Accessing data from Multiple Symbols

    I have a chart with four symbols on it and I want to access the data in NinjaScript.

    I can't even get the basics to work. The following script attempts to plot the closing prices for the second dataseries on the screen but I get no values plotted.

    Any help is appreciated
    thanks


    Code:
            protected override void Initialize()
            {
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                Overlay				= false;
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
                Plot0.Set(Closes[1][0]);
            }

    #2
    Hello,

    Thanks for your note.

    You actually cant tie NInjaScript to an already existing chart with 4 symbols on it.

    You need to add this symbol into the script internally however.

    Therefor to get Closes[0][1] to work, you would need to have Add("ES 03-11", PeriodType.Minute, 1); for example in your Initialize().




    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Bret,

      Thank you so much. That sets me straight. I also realize that I have posted in the wrong area so that is a rookie mistake, sorry.

      Another quick question. Is there anyway to query parameters for the current chart that a strategy is enabled on? For instance, I am floating text on multiple indicator lines and when a user changes that line color via the parameter box I would like the text to change color to match.

      Comment


        #4
        redliontrader, this is unfortunately not possible per default as the strategy would not cross commnuicate.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X