using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator{
public class variable_sample : IndicatorObject {
public variable_sample(object _ctx):base(_ctx){}
private IPlotObject plot1, plot2;
private AverageFC f_avg;
VariableObject <double> simple_var;
VariableSeries <double> series_var;
[Input]
public int length { get; set; }
protected override void Create() {
plot1 = AddPlot(new PlotAttributes("1", EPlotShapes.Line, Color.Red));
plot2 = AddPlot(new PlotAttributes("2", EPlotShapes.Line, Color.Yellow));
f_avg = new Function.AverageFC(this);
simple_var = new VariableObject<double>(this);
series_var = new VariableSeries<double>(this);
}
protected override void StartCalc() {
f_avg.length = length;
f_avg.price = Bars.Close;
}
protected override void CalcBar() {
simple_var.Value = series_var.Value = f_avg[0];
plot1.Set(simple_var [0] - simple_var[1]);
plot2.Set(series_var[0] - series_var[1]);
}
}
}
When i compile it..i don't see error....But...i can't put in my graph..said me there is error....
Compile
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Compile
Hello shivax,
The name of the study should match the name in the code.
These two lines:
must be changed to:
The name of the study should match the name in the code.
These two lines:
Code: Select all
public class variable_sample : IndicatorObject {
public variable_sample(object _ctx):base(_ctx){}
Code: Select all
public class Prova2 : IndicatorObject {
public Prova2(object _ctx):base(_ctx){}