What's fron with referencing the indicator?
What's fron with referencing the indicator?
06 Aug 2013, 22:03
I want to reference to DEMA indicator in my robot, but I don't understand why I can't do that.
Indicator is working, I reference it in the robot, I declare it, but it's not recognized.
I know it is super simple question, but pls help someone.
Indicator:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = true)]
public class DEMA : Indicator
{
[Parameter]
public DataSeries DataSource { get; set; }
[Output("DEMA",Color = Colors.Yellow)]
public IndicatorDataSeries dema { get; set; }
[Parameter(DefaultValue = 14)]
public int Period { get; set; }
private ExponentialMovingAverage ema;
private ExponentialMovingAverage ema2;
protected override void Initialize()
{
ema = Indicators.ExponentialMovingAverage(DataSource,Period);//i need the correct DataSeries
ema2 = Indicators.ExponentialMovingAverage(ema.Result,Period);
}
public override void Calculate(int index)
{
dema[index] = (2* ema.Result[index] - ema2.Result[index]);
}
}
}
cAlgo_Fanatic
07 Aug 2013, 09:59
RE:
iRobot said:
Please follow these steps to add a reference of the indicator in the robot.
@cAlgo_Fanatic