Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a subchart in a script

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

    Creating a subchart in a script

    I am writing a multi series script and adding a second contract:-

    protected override void Initialize()
    {

    #region contract 1

    Add(PeriodType.Day, 1);//Add Day Bars with index location 1
    Add(PeriodType.Minute, 1);//Add 1 min Bars with index location 2

    this.indPivAverage = PivotAverage(false, iPivotAverage);
    this.indPivAverage.Plots[0].Pen.Width = 2;
    Add(this.indPivAverage);

    MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
    CalculateOnBarClose = true;
    BarsRequired = 3;
    ClearOutputWindow();

    #endregion

    #region contract 2

    if(start2)
    {
    Add("FGBM 06-13",PeriodType.Day, 1); // Day Bars for contarct 2, SYMBOL AND EXPIRY CAN BE CHANGED HERE
    Add("FGBM 06-13",PeriodType.Minute, 1); // Min Bars for contarct 2, SYMBOL AND EXPIRY CAN BE CHANGED HERE

    this.indPivAverage2 = PivotAverage(false, iPivotAverage2);

    }
    #endregion

    In regards to the index locations am i correct in thinking that the sceond contact would have index location 4 for day bars and 5 for min bars?

    My main question is how can I code for a sub-chart to be added with the min bars of contact 2 ,"FGBM 6-13", and how do I force indicators to plot in that chart?

    #2
    GM GKonheiser, the FGBM would be 3 and 4th bars index then. You have a primary at 0, your first two adds at 1 and 2.

    The series are added internal only, they could not be visualized from the script directly.

    Comment


      #3
      In Initialize I add

      Add(PeriodType.Day, 1);//Add Day Bars with index location 1
      Add(PeriodType.Minute, 1);//Add 1 min Bars with index location 2

      and then

      Add(this.indPivAverage);

      Would that not take index location 3?


      If I have a split chart with FGBM is there a way to draw objects on it then?

      Comment


        #4
        No, this would not have any bars object index position. For the indexing you look into you care only about the bars series you add, not indicators.

        Unfortunately would not be aware of a workaround for the split chart drawing, nothing I could point you to directly.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        650 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X