I think this is the result of the indicator.. (red Line)
I’m not sure because the SierraChart language is very, very difficult and I’m programming whit it from 5 days..
I would have preferred to continue the studies on proreal .. maybe if the problem with the v11 is solved it would be excellent..
News from Nicolas?
This the Sierra code:
”
// The top of every source code file must include this line
#include “sierrachart.h”
// For reference, refer to this page:
// https://www.sierrachart.com/index.php?page=doc/AdvancedCustomStudyInterfaceAndLanguage.php
// This line is required. Change the text within the quote
// marks to what you want to name your group of custom studies.
SCDLLName(“Piero Custom Study DLL”)
//This is the basic framework of a study function. Change the name ‘TemplateFunction’ to what you require.
SCSFExport scsf_MEYERBUTTERWORTH(SCStudyInterfaceRef sc)
{
SCSubgraphRef MEYERBUTTERWORTH = sc.Subgraph[0];
SCSubgraphRef BUTTERWORTH = sc.Subgraph[1];
SCFloatArrayRef SigmaSignalV = sc.Subgraph[2].Arrays[0];
SCFloatArrayRef SigmaNoiseV = sc.Subgraph[3].Arrays[0];
SCInputRef Length = sc.Input[1];
if (sc.SetDefaults)
{
sc.GraphName = “Filtro Meyer-Butterworth”;
sc.AutoLoop = 1;
sc.GraphRegion = 1;
MEYERBUTTERWORTH.Name = “MEYERBUTTERWORTH”;
MEYERBUTTERWORTH.DrawStyle = DRAWSTYLE_LINE;
MEYERBUTTERWORTH.LineWidth = 1;
MEYERBUTTERWORTH.PrimaryColor = COLOR_RED;
MEYERBUTTERWORTH.DrawZeros = true;
BUTTERWORTH.Name = “BUTTERWORTH”;
BUTTERWORTH.DrawStyle = DRAWSTYLE_LINE;
BUTTERWORTH.LineWidth = 1;
BUTTERWORTH.LineStyle = LINESTYLE_DOT;
BUTTERWORTH.PrimaryColor = RGB(128,128,255);
BUTTERWORTH.DrawZeros = true;
sc.Subgraph[0].Name = “Meyer Butterworth”;
sc.Subgraph[1].Name = “Butterworth”;
Length.Name = “PP”;
Length.SetInt(17);
return;
}
sc.DataStartIndex = Length.GetInt();
int PP = sc.DataStartIndex;
double risultato;
if (sc.Index < 2)
{
risultato = sc.BaseData[SC_LAST][sc.Index];
}
else
{
risultato = sc.Subgraph[1][sc.Index-1]-(sc.Subgraph[1][sc.Index-2]/3.414)+((1/3.414)*sc.BaseData[SC_LAST][sc.Index]);
}
BUTTERWORTH[sc.Index] = risultato;
// Noise = sc.BaseData[SC_last][sc.Index];
sc.StdDeviation(sc.Subgraph[1], SigmaSignalV, PP);//SigmaSignal
float SigmaSignal = SigmaSignalV[sc.Index]; //Access the study value at the current index
sc.StdDeviation(sc.BaseData[SC_LAST], SigmaNoiseV, PP);//SigmaNoise
float SigmaNoise = SigmaNoiseV[sc.Index]; //Access the study value at the current index
float a = SigmaSignal/SigmaNoise;
float n = (2/a)-1;
float nn;
if (n<1)
{
nn=1;
}
else
{
nn=n;
}
//MB=ExponentialAverage[nn](close);
sc.ExponentialMovAvg(sc.BaseData[SC_LAST], sc.Subgraph[0], nn);
return;
}
“