Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Instrument Questions

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

    Multi Instrument Questions

    I'm looking for information on the capabilities of multi-instrument indicators...

    Is it yet possible to have a price chart in panel 1 and a price/indicator in panel 2 and write an indicator in panel 3 that references panel 1 & 2 Price/Indicator data - programatically?

    Or is the only way to get 2 instruments into an indicator through an input parameter that gets the instrument name and sends it into an indicator?


    Thanks

    Matt

    #2
    I do it by having a parameter ("Symbol2") which can be set by the user, but which defaults to the second instrument on the chart.

    If you want to reference an indicator on the chart instead of an instrument, I've never done that; it might be possible but it would probably be a pain to figure out how to do it.

    -Kevin

    Code:
    // in the Variables region:
    
    private string symbol2 = "";
    
    // in Initialize():
    
    Add(Symbol2, BarsPeriod.Id, BarsPeriod.Value);
    
    // in the Properties region:
    
    [Description("Secondary Symbol; i.e. SPY or ES 03-10\nDefault = Secondary chart instrument")]
    [GridCategory("Parameters")]
    // Force this parameter to be displayed first
    [Gui.Design.DisplayName ("\tSymbol 2")]
    public string Symbol2
    {
        get 
        { 
    	if ((symbol2 == "") && (ChartControl != null) && (Instruments != null)) 
                for(int i=0; i<ChartControl.BarsArray.Length; i++)
    		if (ChartControl.BarsArray[i].Instrument.FullName != Instruments[0].FullName)
    		{
    		     symbol2 = ChartControl.BarsArray[i].Instrument.FullName;
    		     break;
    		}
    	return symbol2; 
         }
         set { symbol2 = value.ToUpper(); }
    }

    Comment


      #3
      Thanks!

      That's what I needed.


      Being able to access an indicator from another panel would be nice, but a symbol will do for now.

      Thanks again.

      Matt

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      82 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      43 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X