Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 20:32:00 +0000



[Programming Help] - Delayed

View Count: 1257

[2023-03-28 20:14:50]
John - SC Support - Posts: 36344
There are too many little items. It is just not setup properly for a Sierra Chart custom study. And it is not something we have time to fix.

Someone else might be able to help you out. We have set this as Programming Help.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-04-23 02:30:53]
User352781 - Posts: 24
Hello,
Is there a 3rd party software available for Sierra chart users that is out there.

Example:
Tradingview platform has a third party software called LuxAlgo that is used as a strategy on their platform.

Just wondering if there is a software that Sierra chart knows of or recommends for their platform users like myself.

Thank you.

PS.
Where is Sierra Chart based out of.
[2023-04-24 14:59:10]
John - SC Support - Posts: 36344
There are lots of 3rd party software out there for Sierra Chart. Among other places, you can look in our own "Study Store", which can be accessed from the menu at the top of our website under "Support >> Custom Studies Store/List". Or you can select the following link:
https://www.sierrachart.com/UserControlPanel.php?page=StudyStore

Note that our store just lists the software that people have available. They set their prices and how to access their information.

--

Sierra Chart is a distributed company. We work from our home offices around the world.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-06-28 03:16:06]
User352781 - Posts: 24
Hello,

I have a question in regards to the User Contributed Advanced Custome Study.

If the user that contributed a custom study to the Sierra Chart server decides to remove the custom study, would I as a user of that custom study loose the indicators on my chart?

Thank you!!
[2023-06-28 14:13:39]
John - SC Support - Posts: 36344
We have not had a user ask for their study to be removed, but there are times when a study gets old enough that we can not put the time into updating it and it will be removed at that point.

In which case, the answer is that if you update to the software version where it is not present, you will not be able to use that study any longer. But if you stay at the last version that had it, the study will still be available.

Also, you can find the source code for many of the studies at the following link. If the source code is there, then you could update it and create your own custom study to use going forward:
User Contributed Advanced Custom Study System Source Code

Also refer to the following for how to build a custom study:
How to Build an Advanced Custom Study from Source Code
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-07-02 18:37:19]
User352781 - Posts: 24
Thank you for your response.

I tried copying the source code into the Sierra Chart complier so that I can I have it in my custom studies, but this the error I get.
Can you please tell my what is missing? or where am I going wrong.



-- Starting remote build of Custom Studies Source files: BricksTrend.V1.cpp. 64-bit -- 14:31:09

Allow time for the server to compile the files and build the DLL.

Source file "C:\SierraChart\ACS_Source\BricksTrend.V1.cpp" is missing.
-- End of Build -- 14:31:09
[2023-07-02 18:42:18]
User352781 - Posts: 24
Forgot to mention the code was copied from the user contributed source code as a .CPP and pasted into the Sierra Chart compiler under Analysis.
[2023-07-02 20:06:30]
User352781 - Posts: 24
can you please provide me with the source code for the below studies/indictors.

1. ZiG Zag High/Low Trendlines
2. JDT Trend catcher3
3. Bricks Trend

I was able to find the Bricks Trend source code, not the about 2, and the one that I found as previously explained in my first message I received an error.

You can find all the above studies I'm looking for under user contributed studies.

Is it possible to have you guys provide me with the DLL source file for the above mentioned studies. I would like to save them as my own custom studies, so in the future any updates made to the
program I don't loose them.

Thank you in advance.
[2023-07-03 13:05:25]
John - SC Support - Posts: 36344
If the source code is not shown in the page for the User Contributed Studies Source Code then we do not have it.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-07-03 14:01:27]
User352781 - Posts: 24
Fair enough, but how about this, I did find one that is in the list but after trying to compile the source code from CPP to DLL through Sierra Chart complier I get the below error message.



-- Starting remote build of Custom Studies Source files: sierrachart1234.cpp. 64-bit -- 09:52:54

Allow time for the server to compile the files and build the DLL.

Source file "C:\SierraChart\ACS_Source\sierrachart1234.cpp" is missing.
-- End of Build -- 09:52:54
[2023-07-03 14:08:16]
User431178 - Posts: 544
can you please provide me with the source code for the below studies/indictors.

1. ZiG Zag High/Low Trendlines
2. JDT Trend catcher3

1. ZiG Zag High/Low Trendlines = https://www.sierrachart.com/AdditionalFiles/UserContributedACS_SourceCode/ZigZagHLLines.cpp
2. JDT Trend catcher3 = https://www.sierrachart.com/AdditionalFiles/UserContributedACS_SourceCode/jdtTrend.cpp
[2023-07-03 14:20:51]
User431178 - Posts: 544
after trying to compile the source code from CPP to DLL through Sierra Chart complier I get the below error message.

How to Build an Advanced Custom Study from Source Code: Step-By-Step Instructions

1. Paste the downloaded file into your sierrachart/acs_source folder
2. Open the file and make sure the SCDLLName is set correctly (or not commented out) - see example below
3. Follow the steps linked previously

NOTE: The linked source code files all need further editing / updating (in addition to step 2 above) before they will compile sucessfully

Using bricks.cpp as an example:

Change


#include "sierrachart.h"
//SCDLLInit("Bricks");

to


#include "sierrachart.h"
SCDLLName("Bricks");

Feel free to direct message me if you have questions about the required edits.
[2023-07-03 15:36:56]
User352781 - Posts: 24
Here is the result I got after the changes you asked me to make to the code, and this is the result I got from the Builder.


-- Starting remote build of Custom Studies Source files: new2.cpp. 64-bit -- 11:26:27

Allow time for the server to compile the files and build the DLL.

The remote build did not succeed. Result:

new2.cpp: In function 'void scsf_ZigZagHLLines(SCStudyInterfaceRef)':
new2.cpp:232:24: error: 'struct s_sc' has no member named 'PersistVars'
232 | int& lastUpIndex = sc.PersistVars->i1;
| ^~~~~~~~~~~
new2.cpp:233:24: error: 'struct s_sc' has no member named 'PersistVars'
233 | int& lastDnIndex = sc.PersistVars->i2;
| ^~~~~~~~~~~
new2.cpp:274:21: error: 'struct s_sc' has no member named 'PersistVars'
274 | int LastIndex = sc.PersistVars->i1;
| ^~~~~~~~~~~
new2.cpp:581:5: error: 'struct s_sc' has no member named 'PersistVars'
581 | sc.PersistVars->i1 = EndIndex - 1;
| ^~~~~~~~~~~

-- End of Build -- 11:26:31






#include "sierrachart.h"
SCDLLName("ZigZagHLLines");

SCSFExport scsf_ZigZagHLLines(SCStudyGraphRef sc)
{
  SCSubgraphRef ZigZag = sc.Subgraph[1];
  SCSubgraphRef TextLabels = sc.Subgraph[2];
  SCSubgraphRef UpLength = sc.Subgraph[3];
  SCSubgraphRef DnLength = sc.Subgraph[4];
  SCSubgraphRef uL = sc.Subgraph[5];
  SCSubgraphRef dL = sc.Subgraph[6];
  SCSubgraphRef test = sc.Subgraph[7];

  SCInputRef VersionUpdate = sc.Input[0];
  SCInputRef InputDataHigh = sc.Input[1];
  SCInputRef InputDataLow = sc.Input[2];
  SCInputRef CalculationMode = sc.Input[3];
  SCInputRef RevPercent = sc.Input[4];
  SCInputRef RevAmount = sc.Input[5];
  SCInputRef NumberBarsForReversal = sc.Input[6];
  SCInputRef ShowRevPrice = sc.Input[7];
  SCInputRef ShowLabels = sc.Input[8];
  SCInputRef LabelsOffset = sc.Input[9];
  SCInputRef LWidth = sc.Input[10];


  if(sc.SetDefaults)
  {
    sc.GraphName="Zig Zag High/Low Trendlines";
    sc.StudyDescription="Draw horizontal trend lines at each high/low. End each line when it is tested again.";

    //Manual looping

    ZigZag.Name = "Zig Zag Line";
    ZigZag.DrawStyle = DRAWSTYLE_LINE;
    ZigZag.LineStyle = LINESTYLE_DOT;
    ZigZag.PrimaryColor = RGB(255,0,255);
    ZigZag.LineWidth = 3;
    ZigZag.DrawZeros = false;

    TextLabels.Name = "Text Labels";
    TextLabels.SecondaryColorUsed = 1;
    TextLabels.PrimaryColor = RGB(0,255,0);
    TextLabels.SecondaryColor = RGB(255,0,0);
    TextLabels.LineWidth = 10;
    TextLabels.DrawStyle = DRAWSTYLE_CUSTOM_TEXT;
    
    UpLength.Name = "Up Length";
    UpLength.DrawStyle = DRAWSTYLE_IGNORE;
    
    DnLength.Name = "Down Length";
    DnLength.DrawStyle = DRAWSTYLE_IGNORE;

    uL.Name = "High Line Color";
    uL.PrimaryColor = RGB(255, 0, 0);
    uL.DrawStyle = DRAWSTYLE_IGNORE;

    dL.Name = "Low Line Color";
    dL.PrimaryColor = RGB(0, 255, 0);
    dL.DrawStyle = DRAWSTYLE_IGNORE;
    
    test.Name = "test";
    test.DrawStyle = DRAWSTYLE_IGNORE;

    sc.Subgraph[10].Name = "High Trendline";
    sc.Subgraph[10].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[10].LineWidth = 2;

    sc.Subgraph[11].Name = "High Trendline";
    sc.Subgraph[11].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[11].LineWidth = 2;

    sc.Subgraph[12].Name = "High Trendline";
    sc.Subgraph[12].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[12].LineWidth = 2;

    sc.Subgraph[13].Name = "High Trendline";
    sc.Subgraph[13].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[13].LineWidth = 2;

    sc.Subgraph[14].Name = "High Trendline";
    sc.Subgraph[14].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[14].LineWidth = 2;

    sc.Subgraph[15].Name = "High Trendline";
    sc.Subgraph[15].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[15].LineWidth = 2;

    sc.Subgraph[16].Name = "High Trendline";
    sc.Subgraph[16].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[16].LineWidth = 2;

    sc.Subgraph[17].Name = "High Trendline";
    sc.Subgraph[17].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[17].LineWidth = 2;

    sc.Subgraph[18].Name = "High Trendline";
    sc.Subgraph[18].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[18].LineWidth = 2;

    sc.Subgraph[19].Name = "High Trendline";
    sc.Subgraph[19].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[19].LineWidth = 2;

    sc.Subgraph[20].Name = "High Trendline";
    sc.Subgraph[20].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[20].LineWidth = 2;

    sc.Subgraph[21].Name = "High Trendline";
    sc.Subgraph[21].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[21].LineWidth = 2;

    sc.Subgraph[22].Name = "High Trendline";
    sc.Subgraph[22].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[22].LineWidth = 2;

    sc.Subgraph[23].Name = "High Trendline";
    sc.Subgraph[23].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[23].LineWidth = 2;

    sc.Subgraph[24].Name = "High Trendline";
    sc.Subgraph[24].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[24].LineWidth = 2;

    sc.Subgraph[25].Name = "Low Trendline";
    sc.Subgraph[25].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[25].LineWidth = 2;

    sc.Subgraph[26].Name = "Low Trendline";
    sc.Subgraph[26].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[26].LineWidth = 2;

    sc.Subgraph[27].Name = "Low Trendline";
    sc.Subgraph[27].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[27].LineWidth = 2;

    sc.Subgraph[28].Name = "Low Trendline";
    sc.Subgraph[28].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[28].LineWidth = 2;

    sc.Subgraph[29].Name = "Low Trendline";
    sc.Subgraph[29].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[29].LineWidth = 2;

    sc.Subgraph[30].Name = "Low Trendline";
    sc.Subgraph[30].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[30].LineWidth = 2;

    sc.Subgraph[31].Name = "Low Trendline";
    sc.Subgraph[31].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[31].LineWidth = 2;

    sc.Subgraph[32].Name = "Low Trendline";
    sc.Subgraph[32].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[32].LineWidth = 2;

    sc.Subgraph[33].Name = "Low Trendline";
    sc.Subgraph[33].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[33].LineWidth = 2;

    sc.Subgraph[34].Name = "Low Trendline";
    sc.Subgraph[34].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[34].LineWidth = 2;

    sc.Subgraph[35].Name = "Low Trendline";
    sc.Subgraph[35].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[35].LineWidth = 2;

    sc.Subgraph[36].Name = "Low Trendline";
    sc.Subgraph[36].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[36].LineWidth = 2;

    sc.Subgraph[37].Name = "Low Trendline";
    sc.Subgraph[37].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[37].LineWidth = 2;

    sc.Subgraph[38].Name = "Low Trendline";
    sc.Subgraph[38].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[38].LineWidth = 2;

    sc.Subgraph[39].Name = "Low Trendline";
    sc.Subgraph[39].DrawStyle = DRAWSTYLE_DASH;
    sc.Subgraph[39].LineWidth = 2;
    
    // Inputs

    InputDataHigh.Name = "Input Data for High";
    InputDataHigh.SetInputDataIndex(SC_HIGH);

    InputDataLow.Name = "Input Data for Low";
    InputDataLow.SetInputDataIndex(SC_LOW);

    CalculationMode.Name = "Calculation Mode (1,2,3)";
    CalculationMode.SetInt(1);
    CalculationMode.SetIntLimits(1, 3);

    RevPercent.Name = "Reversal % for Calculation Mode 1";
    RevPercent.SetFloat(.15f);

    RevAmount.Name = "Reversal Amount for Calculation Mode 2,3";
    RevAmount.SetFloat(0.01f);

    NumberBarsForReversal.Name = "Number of Bars Required for Reversal (Calculation mode 2)";
    NumberBarsForReversal.SetInt(5);

    ShowRevPrice.Name = "Display Reversal Price and Length of Zig Zag Line";
    ShowRevPrice.SetYesNo(0);

    ShowLabels.Name = "Display HH,HL,LL,LH Labels";
    ShowLabels.SetYesNo(0);

    LabelsOffset.Name = "Text Labels Percentage Offset";
    LabelsOffset.SetFloat(5.0f);

    LWidth.Name = "Trendline Thickness (1-10)";
    LWidth.SetInt(2);
    LWidth.SetIntLimits(1, 10);
    
    VersionUpdate.Name = "Version";
    VersionUpdate.SetInt(3);
    VersionUpdate.SetIntLimits(3,3);
    
    sc.ValueFormat = 5;
    sc.FreeDLL = 0;
    sc.AutoLoop = 0;
    sc.GraphRegion=0;
    sc.ScaleRangeType=SCALE_SAMEASREGION;

    return;
  }
  
  int& lastUpIndex = sc.PersistVars->i1;
  int& lastDnIndex = sc.PersistVars->i2;
  
  for (int Index = sc.UpdateStartIndex; Index <= sc.ArraySize - 1; Index++)
  {
    switch (CalculationMode.GetInt())
    {
    case 1:
      sc.ZigZag(
        sc.BaseData[InputDataHigh.GetInputDataIndex()],
        sc.BaseData[InputDataLow.GetInputDataIndex()],
        ZigZag,
        Index,
        RevPercent.GetFloat() * 0.01f
        );
      break;
    case 2:
      sc.ZigZag2(
        sc.BaseData[InputDataHigh.GetInputDataIndex()],
        sc.BaseData[InputDataLow.GetInputDataIndex()],
        ZigZag,
        Index,
        NumberBarsForReversal.GetInt(),
        RevAmount.GetFloat()
        );
      break;
    case 3:
      sc.ZigZag(
        sc.BaseData[InputDataHigh.GetInputDataIndex()],
        sc.BaseData[InputDataLow.GetInputDataIndex()],
        ZigZag,
        Index,
        0.0f,
        RevAmount.GetFloat()
        );
      break;
    }
  }

  const int UniqueID = 11062009;
  int Index = sc.UpdateStartIndex;
  int EndIndex = 0;
  int LastIndex = sc.PersistVars->i1;

  SCFloatArrayRef Values = ZigZag.Data;
  SCFloatArrayRef Peaks = ZigZag.Arrays[0];

  int StartIndex = 0;
  if (sc.UpdateStartIndex == 0)
  {
    StartIndex = sc.ArraySize - 1;
    LastIndex = 0;
  }
  else
    StartIndex = sc.UpdateStartIndex;

  for (int i = StartIndex; i >= 0; i--)
  {
    if (Peaks != 0.0f)
    {
      EndIndex = i;
      break;
    }
  }

  if (LastIndex > sc.UpdateStartIndex)
    LastIndex = 0;

  if (EndIndex == LastIndex)
    return;

  for (int i = LastIndex; i <= EndIndex; i++)
  {
    if (Peaks == 0.0f) //not a peak, nothing to be drawn
      continue;

    SCString BarLabelText;
    SCString LengthStr;
    SCString ReversalPrice;
    int VerticalTextAlignment = Peaks == 1.0 ? DT_BOTTOM : DT_TOP;
    double Length = 0.0;
    for (int i1 = i - 1; i1 >= 0; i1--)
    {
      if (Peaks[i1] == -Peaks)
      {
        Length = Values - Values[i1];
        LengthStr = sc.FormatGraphValue(Length, sc.ValueFormat);
        ReversalPrice = sc.FormatGraphValue(Values, sc.ValueFormat);
        
        if (ShowRevPrice.GetYesNo() && !ShowLabels.GetYesNo())
        {
          BarLabelText.Format("%s (%s)", ReversalPrice.GetChars(), LengthStr.GetChars());
          break;
        }
      }

      if (Peaks[i1] == Peaks)
      {
        if (ShowLabels.GetYesNo())
        {
          
          if (Peaks[i1] == 1.0f)//High
          {
            if (Values[i1] > Values) //LowerHigh
            {
              if (ShowRevPrice.GetYesNo())
                BarLabelText.Format("LH %s (%s)", ReversalPrice.GetChars(), LengthStr.GetChars());
              else
                BarLabelText = "LH";
            }
            else //HigherHigh
            {
              if (ShowRevPrice.GetYesNo())
                BarLabelText.Format("HH %s (%s)", ReversalPrice.GetChars(), LengthStr.GetChars());
              else
                BarLabelText = "HH";
            }
          }
          else //Low
          {
            if (Values[i1] < Values) //HigherLow
            {
              if (ShowRevPrice.GetYesNo())
                BarLabelText.Format("HL %s (%s)", ReversalPrice.GetChars(), LengthStr.GetChars());
              else
                BarLabelText = "HL";
            }
            else //LowerLow
            {
              if (ShowRevPrice.GetYesNo())
                BarLabelText.Format("LL %s (%s)", ReversalPrice.GetChars(), LengthStr.GetChars());
              else
                BarLabelText = "LL";
            }
          }
        }

        break;
      }
    }

    s_UseTool Tool;
    Tool.Clear();
    Tool.ChartNumber = sc.ChartNumber;
    Tool.DrawingType = DRAWING_TEXT;
    Tool.ReverseTextColor = 0;
    Tool.BeginDateTime = sc.BaseDateTimeIn;
    
    float Offset;

    if(Peaks == 1.0f)
      Offset = LabelsOffset.GetFloat()*0.01f*(sc.High-sc.Low);
    else
      Offset = -LabelsOffset.GetFloat()*0.01f*(sc.High-sc.Low);
    
    Tool.BeginValue = Values + Offset;

    if (Peaks == 1.0f)
      Tool.Color = TextLabels.PrimaryColor;
    else
      Tool.Color = TextLabels.SecondaryColor;

    if (Peaks == 1.0f)
    {
      if(lastUpIndex > lastDnIndex) {
        UpLength[lastUpIndex] = 0;
      }
      UpLength = (float)Length;
      uL = (float)Length;
      lastUpIndex = i;
    } else {
      if(lastDnIndex > lastUpIndex) {
        DnLength[lastDnIndex] = 0;
      }
      DnLength = (float)Length;
      dL = (float)Length;
      lastDnIndex = i;
    }  
    

    Tool.FontSize = TextLabels.LineWidth;
    Tool.FontBold = FALSE;

    Tool.Text = BarLabelText;
    if (i == EndIndex)
    {
      Tool.AddMethod = UTAM_ADD_OR_ADJUST;
      Tool.LineNumber = UniqueID + 1;
    }
    else
    {
      Tool.AddMethod = UTAM_ADD_ALWAYS;
      Tool.LineNumber = UniqueID;
    }

    Tool.TextAlignment  = DT_CENTER | VerticalTextAlignment;

    if (ShowLabels.GetYesNo() || ShowRevPrice.GetYesNo())
    {
      sc.UseTool(Tool);
    }
  }
  int u = 0;
  for (u = sc.UpdateStartIndex; u < sc.ArraySize; u++)
  {
    if(sc.GetBarHasClosedStatus(u) == BHCS_BAR_HAS_CLOSED)
    {
      test = (float)u;
      /******* HIGH LINES *******/
      // remove duplicate lines
/*
      for(int y = 10;y <= 24;y++) {
        for(int z = 10;z <= 24;z++) {
          if((sc.Subgraph[y][u-1] == sc.Subgraph[z][u-1]) && (z != y) && (sc.Subgraph[z][u-1] > 0)) {
            sc.Subgraph[z] = 0;
            sc.Subgraph[z].Arrays[0] = u;
            sc.Subgraph[z][u-1] = 0;
            sc.Subgraph[z].Arrays[0][u-1] = u;
          }
        }
      }
*/
      // pre plot all lines
      for(int y = 10;y <= 24;y++) {
        sc.Subgraph[y].DataColor = uL.PrimaryColor;
        sc.Subgraph[y].LineWidth = LWidth.GetInt();
        sc.Subgraph[y] = sc.Subgraph[y][u-1];
        sc.Subgraph[y].Arrays[0] = sc.Subgraph[y].Arrays[0][u-1];
      }
      // Plot new highs
      int hnewZero = 0;
      if(uL > 0)
      {
        // remove duplicate lines
        float hlastLine = 0;
        for(int y = 10;y <= 24;y++) {
          if(sc.Subgraph[y][u-1] == hlastLine) {
            sc.Subgraph[y] = 0;
            sc.Subgraph[y].Arrays[0] = (float)u;
            sc.Subgraph[y][u-1] = 0;
            sc.Subgraph[y].Arrays[0][u-1] = (float)u;
          }
          if(sc.Subgraph[y][u-1] > 0) {
            hlastLine = sc.Subgraph[y][u-1];
          }
        }
        // Check to see if we have used all subgraphs - if so, clear the oldest
        int hfoundZero = 0;
        int maxHCnt = 0;
        int maxHSub = 0;
        for(int y = 10;y <= 24;y++) {
          if(sc.Subgraph[y][u-1] == 0) {
            hfoundZero = 1;
            break;
          } else if((u-sc.Subgraph[y].Arrays[0][u-1]) > maxHCnt) {
            maxHCnt = u - (int)sc.Subgraph[y].Arrays[0][u-1];
            maxHSub = y;
          }
        }
        int hZCnt = 0;
        if((hfoundZero == 0) && (hZCnt == 0))
        {
          sc.Subgraph[maxHSub][u-1] = 0;
          sc.Subgraph[maxHSub].Arrays[0][u-1] = (float)u;
          hZCnt = 1;
        }
        // See if we have a new high to plot
        int hLinePlotted = 0;
        for(int y = 10;y <= 24;y++)
        {
          if(sc.BaseDataIn[SC_HIGH] > sc.Subgraph[y][u-1])
          {
            if(hLinePlotted == 0) {
              sc.Subgraph[y] = sc.BaseDataIn[SC_HIGH];
              sc.Subgraph[y].Arrays[0] = (float)u;
              hLinePlotted = 1;
            } else {
              // avoid duplicates
              sc.Subgraph[y] = 0;
              sc.Subgraph[y].Arrays[0] = (float)u;
            }
          }
        }
      }
    
      /******* LOW LINES *******/
      // remove duplicate lines
/*
      for(int y = 25;y <= 39;y++) {
        for(int z = 25;z <= 39;z++) {
          if((sc.Subgraph[y][u-1] == sc.Subgraph[z][u-1]) && (z != y) && (sc.Subgraph[z][u-1] > 0)) {
            sc.Subgraph[z] = 0;
            sc.Subgraph[z].Arrays[0] = u;
            sc.Subgraph[z][u-1] = 0;
            sc.Subgraph[z].Arrays[0][u-1] = u;
          }
        }
      }
*/
      // pre plot all lines
      for(int y = 25;y <= 39;y++) {
        sc.Subgraph[y].DataColor = dL.PrimaryColor;
        sc.Subgraph[y].LineWidth = LWidth.GetInt();
        sc.Subgraph[y] = sc.Subgraph[y][u-1];
        sc.Subgraph[y].Arrays[0] = sc.Subgraph[y].Arrays[0][u-1];
      }
      // Plot new lows
      if(dL < 0)
      {
        // Check to see if we have used all subgraphs - if so, clear the oldest
        int lfoundZero = 0;
        int maxLCnt = 0;
        int maxLSub = 0;
        for(int y = 25;y <= 39;y++) {
          if(sc.Subgraph[y][u-1] == 0) {
            lfoundZero = 1;
            break;
          } else if((u-sc.Subgraph[y].Arrays[0][u-1]) > maxLCnt) {
            maxLCnt = u - (int)sc.Subgraph[y].Arrays[0][u-1];
            maxLSub = y;
          }
        }
        int lZCnt = 0;
        if((lfoundZero == 0) && (lZCnt == 0))
        {
          sc.Subgraph[maxLSub][u-1] = 0;
          sc.Subgraph[maxLSub].Arrays[0][u-1] = (float)u;
          lZCnt = 1;
        }
        // See if we have a new low to plot
        int lLinePlotted = 0;
        for(int y = 25;y <= 39;y++)
        {
          if((sc.BaseDataIn[SC_LOW] < sc.Subgraph[y][u-1]) || (sc.Subgraph[y][u-1] == 0))
          {
            if(lLinePlotted == 0) {
              sc.Subgraph[y] = sc.BaseDataIn[SC_LOW];
              sc.Subgraph[y].Arrays[0] = (float)u;
              lLinePlotted = 1;
            } else {
              // avoid duplicates
              sc.Subgraph[y] = 0;
              sc.Subgraph[y].Arrays[0] = (float)u;
            }
          }
        }
      }
    }
  }
  sc.PersistVars->i1 = EndIndex - 1;
}

[2023-07-03 15:51:11]
User431178 - Posts: 544
Here is the result I got after the changes you asked me to make to the code, and this is the result I got from the Builder.

I'll repeat what I wrote above

NOTE: The linked source code files all need further editing / updating (in addition to step 2 above) before they will compile sucessfully

Feel free to direct message me if you have questions about the required edits.
[2023-07-03 16:48:29]
User352781 - Posts: 24
Is there a reason why the source code you have for people to download is unedited? Can you send me the edited version, so that I can save it on my computer please.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account