Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help : Indicator does not display

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help : Indicator does not display

    My indicator does not plot anything.
    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]);
    }




    #2
    Originally posted by kuroro13 View Post
    My indicator does not plot anything.
    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]);
    }




    Value3.Set(Math.Log(Value1[0]));

    You might want to check Value1[0] for zero value

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    163 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X