Exponential average error in indicator?
Forums › ProRealTime English forum › ProBuilder support › Exponential average error in indicator?
- This topic has 22 replies, 5 voices, and was last updated 5 years ago by pieroim.
-
-
10/30/2019 at 1:33 PM #11165910/30/2019 at 2:55 PM #111675
unfortunately it still does not work .. same error..
123456789101112131415161718192021if Barindex < 2 thenBU = CloseelseBU = BU[1]-BU[2]/3.414+(1/3.414)*CloseendifSignal = BUNoise = CloseSigmaSignal = STD[17](Signal)SigmaNoise = STD[17](Noise)a = SigmaSignal/SigmaNoisen = (2/a)-1if n < 1 thennn = 1elsenn = nendifMB = ExponentialAverage[nn](Close)Return MB COLOURED(0,250,0)yes, if I have a screenshot of it I go to develop the strategy on SierraChart with less doubt. In Sierra I have another account with american Futures Indexes but the SierraChart languave is very, very complex.. I would have preferred to continue the tests on prorealtime, but if it doesn’t work, there’s no other choice.
This indicator is developed in Prorealtime, I like the idea of the strategy where this indicator is the initial step, but to trasport it in SierraChart it is important for me to have a visual reference of it.
10/30/2019 at 3:19 PM #11168010/30/2019 at 3:36 PM #11168610/31/2019 at 10:45 AM #111735I 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 indexsc.StdDeviation(sc.BaseData[SC_LAST], SigmaNoiseV, PP);//SigmaNoise
float SigmaNoise = SigmaNoiseV[sc.Index]; //Access the study value at the current indexfloat 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;
}“
10/31/2019 at 11:01 AM #11173710/31/2019 at 1:27 PM #111741Should work fine now in version 11.1, always make calculation if there is enough bars to do them:
123456789101112131415161718192021222324252627period = 17if Barindex < 2 thenBU = CloseelseBU = BU[1]-BU[2]/3.414+(1/3.414)*Closeendifif barindex>period thenSignal = BUNoise = CloseSigmaSignal = STD[period](Signal)SigmaNoise = STD[period](Noise)a = SigmaSignal/SigmaNoisen = (2/a)-1if n < 1 thennn = 1elsenn = nendifMB = ExponentialAverage[nn](Close)endifReturn MB COLOURED(0,250,0)1 user thanked author for this post.
10/31/2019 at 3:48 PM #111752 -
AuthorPosts
Find exclusive trading pro-tools on