Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add SecondaryInstrument as a data series

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

    Add SecondaryInstrument as a data series

    I have a chart with 2 data series.

    I would like to add the the second charted data series as a Bars Object within a script, e.g something like this:

    protected override void Initialize()
    {

    Add(Instrument.SecondInstrument.Name);


    Is there any way to find out the name for the second instrument on the chart, so that I can add it as a Bars Object?

    #2
    Hello AntiMatter,

    Thank you for your post.

    There is no method to pull a secondary instrument applied to the chart. We only have our input series being the main series and then any series we add through code.

    Comment


      #3
      Ahaa......


      Code:
              [Description("Second instrument.")]
              [GridCategory("Parameters")]
              [Gui.Design.DisplayName ("\t\t\t\t\t\t\t\t\t\t\t\tSecond Instrument")]
              public string Symbol2
              {
                  get 
                  {   // symbol2 defaults to secondary chart data series
                      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

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      548 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      549 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X