Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 18:36:39 +0000



Post From: custom indicator AC

[2013-06-10 14:41:18]
942abel - Posts: 7
hello again

I changed the last line (as dialogue / /) and I've added what you indicated me, but I get error.
this error:


error: expected constructor, destructor, or type conversion before '(' token
-- End of Build --





/*****************************************************************************

For reference, please refer to the Advanced Custom Study Interface
and Language documentation on the Sierra Chart website.

*****************************************************************************/

/// AO = SMA(median price, 5)-SMA(median price, 34)
/// AC = AO-SMA(AO, 5)

// This line is required. Change the text within the quote
// marks to what you want to name your group of custom studies.
SCDLLName("Custom Study DLL")


SCSFExport scsf_AC_DC_Histogram3(SCStudyInterfaceRef sc)
{
SCSubgraphRef ACDC = sc.Subgraph[0];
SCSubgraphRef Temp3 = sc.Subgraph[3];
SCSubgraphRef Temp4 = sc.Subgraph[4];
SCSubgraphRef Temp5 = sc.Subgraph[5];

SCSubgraphRef Temp6 = sc.Subgraph[6];

SCInputRef InputData = sc.Input[0];
SCInputRef MA1Length = sc.Input[2];
SCInputRef MA2Length = sc.Input[3];
SCInputRef MA4Length = sc.Input[5];

if (sc.SetDefaults)
{
sc.GraphName = "AC/DC Histogram 3";

sc.GraphRegion = 1;
sc.ValueFormat = 3;
sc.AutoLoop = 1;
sc.FreeDLL = 0;

ACDC.Name = "AC/DC3";
ACDC.DrawStyle = DRAWSTYLE_BAR;
ACDC.SecondaryColor = RGB(255,0,0);
ACDC.AutoColoring = AUTOCOLOR_SLOPE;
ACDC.DrawZeros = false;

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

MA1Length.Name = "Moving Average 1 Length";
MA1Length.SetInt(34);
MA1Length.SetIntLimits(1, MAX_STUDY_LENGTH);

MA2Length.Name = "Moving Average 2 Length";
MA2Length.SetInt(5);
MA2Length.SetIntLimits(1, MAX_STUDY_LENGTH);

MA4Length.Name = "Moving Average 4 Length";
MA4Length.SetInt(5);
MA4Length.SetIntLimits(1, MAX_STUDY_LENGTH);

return;
}

sc.DataStartIndex = max(MA1Length.GetInt(), MA2Length.GetInt()) + MA4Length.GetInt();

sc.SimpleMovAvg(sc.BaseDataIn[InputData.GetInputDataIndex()], Temp3, MA1Length.GetInt());
sc.SimpleMovAvg(sc.BaseDataIn[InputData.GetInputDataIndex()], Temp4, MA2Length.GetInt());

if (sc.Index > 0)
Temp5[sc.Index] = Temp4[sc.Index] - Temp3[sc.Index];


///sc.SimpleMovAvg(Temp5, ACDC, MA4Length.GetInt());

sc.SimpleMovAvg(Temp5, Temp6, MA4Length.GetInt());
ACDC[sc.Index] = Temp5[sc.Index] - Temp6[sc.Index];
}


what is wrong?

thank you very much