I have checked the log file and got the following message error :
"Error on plotting indicator "xx": please check the OnBarUpdate() method or the Plot() method : out of bound issue"
Tried to find where it comes from without success
Here is the code :
#region Variables
// Wizard generated variables
privateint period = 10; // Default setting for Period
// User defined variables (add any user defined variables below)
private DataSeries Value1;
privatedouble MyVal =0.0;
private DataSeries Value2;
private DataSeries Value3;
#endregion
protectedoverridevoid Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
CalculateOnBarClose = true;
Overlay = false;
PriceTypeSupported = false;
Value1= new DataSeries(this);
Value2= new DataSeries(this);
Value3= new DataSeries(this);
}
protectedoverridevoid OnBarUpdate()
{
if (CurrentBar >= 40)
{
Value1.Set(TEMA(Input,period)[0]);
Value3.Set(Math.Log(Value1[0]));
for (int n = 1; n<41 ; n++)
{
MyVal=MyVal+LinRegSlopeSFX(Value3,false,n,0)[0]*Math.Sqrt(n);
}
}
Value2.Set(MyVal*100);
MyVal=0;
Plot0.Set(Value2[0]);
}
Comment