When you call :
m_adx_indic = (ADX)AddIndicator("ADX") (see example below)
Can you specify which datastream you are using ? (BarsOfData(1...N).Close).
At the creation of an object, in "protected override void Create() ",
you need to give the datastream to the function :
m_adx1 = new Function.ADX(this, 2 );
how do you give the datastream with (ADX)AddIndicator("ADX") ?
or any other indicator ?
(Mov_Avg_1_Line)AddIndicator("Mov_Avg_1_Line") etc..
Thank you
Code: Select all
namespace PowerLanguage.Indicator{
public class a1 : IndicatorObject {
public a1(object _ctx):base(_ctx){}
private IPlotObject plot1;
private ADX m_adx_indic;
protected override void Create() {
plot1 = AddPlot();
m_adx_indic = (ADX)AddIndicator("ADX");
m_adx_indic.length = 20;
}
protected override void CalcBar(){
plot1.Set(m_adx_indic.Plots[0].Values[0]);
}
}
}