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.

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Yesterday, 02:09 PM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Jltarrau, Today, 05:57 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by kujista, Today, 06:23 AM
        0 responses
        2 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by traderqz, Yesterday, 04:32 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by f.saeidi, Today, 05:56 AM
        1 response
        5 views
        0 likes
        Last Post Jltarrau  
        Working...
        X