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 NullPointStrategies, Today, 05:17 AM
        0 responses
        44 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X