Login Page - Create Account

Support Board


Date/Time: Sat, 18 Apr 2026 19:38:49 +0000



Drawing routines fail in latest Sierra Chart version

View Count: 38

[2026-04-18 10:00:04]
User787032 - Posts: 38
I have several indicators that use the same routines that allow users to select a drawstyle when placing signals on the chart. These routines were working correctly up to and including release 2895, but now they no longer plot on the chart.
The routines are coded as follows:

void markIt3(SCStudyGraphRef sc, int y)
{              
            sc.Subgraph[y].Name        = "MomData";            
            sc.Subgraph[y].LineWidth      = sc.Input[5].GetInt();
            sc.Subgraph[y].PrimaryColor    = sc.Input[8].GetColor();
            return;
}
void mStyle(SCStudyGraphRef sc, int jj, int k)
{  
  switch ( jj )
  {
    case 0:  sc.Subgraph[k].DrawStyle = DRAWSTYLE_DASH; break;
    case 1:  sc.Subgraph[k].DrawStyle = DRAWSTYLE_RIGHTHASH; break;
    case 2:  sc.Subgraph[k].DrawStyle = DRAWSTYLE_LEFTHASH; break;    
    case 3: sc.Subgraph[k].DrawStyle = DRAWSTYLE_POINT; break;
    case 4: sc.Subgraph[k].DrawStyle = DRAWSTYLE_TRANSPARENT_CIRCLE_VARIABLE_SIZE; break;
    case 5: sc.Subgraph[k].DrawStyle = DRAWSTYLE_CIRCLE_HOLLOW_VARIABLE_SIZE; break;    
    case 6: sc.Subgraph[k].DrawStyle = DRAWSTYLE_SQUARE; break;
    case 7: sc.Subgraph[k].DrawStyle = DRAWSTYLE_SQUARE_OFFSET_LEFT_FOR_CANDLESTICK; break;
    case 8: sc.Subgraph[k].DrawStyle = DRAWSTYLE_SQUARE_OFFSET_RIGHT_FOR_CANDLESTICK; break;
    case 9: sc.Subgraph[k].DrawStyle = DRAWSTYLE_TRIANGLEUP; break;
    case 10: sc.Subgraph[k].DrawStyle = DRAWSTYLE_TRIANGLEDOWN; break;
    case 11: sc.Subgraph[k].DrawStyle = DRAWSTYLE_TRIANGLEDOWN; break;
    default: sc.Subgraph[k].DrawStyle = DRAWSTYLE_DASH;
  }
  return;  
How do these have to be modified in order to work in release 2899?
[2026-04-18 18:42:16]
Sierra_Chart Engineering - Posts: 23537
We do not know what the problem is. We do not observe any problem like this.

It does not make any sense to us. But we cannot debug your own study functions. Maybe the study relies on Time and Sales or Volume at Price data? If so, the study will need to be recompiled for newer versions.


You can verify that these Draw Styles work correctly just by using this function and setting the Draw Style to Triangle Up (An example):
SCSFExport scsf_MovingAverageSimple(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Subgraph_Avg = sc.Subgraph[0];

  SCInputRef Input_Data = sc.Input[0];
  SCInputRef Input_Length = sc.Input[3];

  if (sc.SetDefaults)
  {
    sc.GraphName = "Moving Average - Simple";

    sc.GraphRegion = 0;
    sc.ValueFormat = VALUEFORMAT_INHERITED;
    sc.AutoLoop = 1;

    Subgraph_Avg.Name = "Avg";
    Subgraph_Avg.DrawStyle = DRAWSTYLE_LINE;
    Subgraph_Avg.PrimaryColor = RGB(0, 255, 0);
    Subgraph_Avg.LineWidth = 1;
    Subgraph_Avg.DrawZeros = true;

    Input_Data.Name = "Input Data";
    Input_Data.SetInputDataIndex(SC_LAST);

    Input_Length.Name = "Length";
    Input_Length.SetInt(10);
    Input_Length.SetIntLimits(1, MAX_STUDY_LENGTH);

    return;
  }

  sc.DataStartIndex = Input_Length.GetInt() - 1;

  sc.SimpleMovAvg(sc.BaseDataIn[Input_Data.GetInputDataIndex()], Subgraph_Avg, Input_Length.GetInt());
}

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-04-18 18:43:17

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

Login

Login Page - Create Account