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 cmtjoancolmenero, Yesterday, 03:58 PM
        11 responses
        41 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by FrazMann, Today, 11:21 AM
        0 responses
        5 views
        0 likes
        Last Post FrazMann  
        Started by geddyisodin, Yesterday, 05:20 AM
        8 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by DayTradingDEMON, Today, 09:28 AM
        4 responses
        27 views
        0 likes
        Last Post DayTradingDEMON  
        Started by George21, Today, 10:07 AM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Working...
        X