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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      169 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      324 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      250 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      353 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      180 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X