Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

compiled but didn't appear as an indicator

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

    compiled but didn't appear as an indicator

    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "Plot2"));
    Add(new Plot(Color.FromKnownColor(KnownColor.DarkViolet), PlotStyle.Line, "Plot3"));
    Add(new Line(Color.FromKnownColor(KnownColor.DarkOliveGree n), 25, "Plus25"));
    Add(new Line(Color.FromKnownColor(KnownColor.Khaki), 0, "Zeroline"));
    Add(new Line(Color.FromKnownColor(KnownColor.Lavender), -25, "Minus25"));

    Var2 = new DataSeries(this);
    Var3 = new DataSeries(this);
    Var4 = new DataSeries(this);
    Var5 = new DataSeries(this);
    Var6 = new DataSeries(this);
    Var7 = new DataSeries(this);
    Var8 = new DataSeries(this);
    Var9 = new DataSeries(this);
    Var10 = new DataSeries(this);


    CalculateOnBarClose = true;
    Overlay = false;
    PriceTypeSupported = false;
    }
    /// <summary>
    /// Called on each bar update event (incoming tick)
    public class CRW : Indicator
    {
    #region Variables
    // Wizard generated variables
    private int period = 14; // Default setting for Period
    // User defined variables (add any user defined variables below)
    private DataSeries Var2;
    private DataSeries Var3;
    private DataSeries Var4;
    private DataSeries Var5;
    private DataSeries Var6;
    private DataSeries Var7;
    private DataSeries Var8;
    private DataSeries Var9;
    private DataSeries Var10;
    #endregion
    /// <summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    /// </summary>
    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "Plot2"));
    Add(new Line(Color.FromKnownColor(KnownColor.DarkOliveGree n), 25, "Plus25"));
    Add(new Line(Color.FromKnownColor(KnownColor.Khaki), 0, "Zero"));
    Add(new Line(Color.FromKnownColor(KnownColor.Lavender), -25, "Minus25"));

    Var2 = new DataSeries(this);
    Var3 = new DataSeries(this);
    Var4 = new DataSeries(this);
    Var5 = new DataSeries(this);
    Var6 = new DataSeries(this);
    Var7 = new DataSeries(this);
    Var8 = new DataSeries(this);
    Var9 = new DataSeries(this);
    Var10 = new DataSeries(this);

    //CalculateOnBarClose = true;
    //Overlay = false;
    //PriceTypeSupported = false;
    }
    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {

    Var2.Set(Close[0] - Close[1]);

    if(Close[0]-Close[1]>=0)
    {
    Var3.Set(Var2[0]);
    }
    else
    {
    Var3.Set(0);
    }

    Var4.Set(Close[1] - Close[0]);

    if(Close[0] - Close[1] <= 0)
    {
    Var5.Set(Var4[0]);
    }
    else
    {
    Var5.Set(0);
    }
    Var6.Set(SUM(Var3, 16)[0]/SUM(Var5, 16)[0]);

    Var7.Set(100-100/(1+Var6[0]));

    Var8.Set(EMA(Var7, 16)[0]);

    Var9.Set(EMA(Var8, 8)[0]);

    Var10.Set(EMA(Var8, 45)[0]);

    Plot0.Set(Var8[0] - Var10[0]);
    Plot2.Set(Var9[0] - Var10[0]);
    }

    #2
    You are missing one first line in the OnBarUpdate()
    if (CurrentBar < 1) return;

    Comment


      #3
      thank you soooooooooooooooo much, working now

      working now

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      568 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      548 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X