Indicator as DataSeries
Indicator as DataSeries
20 Sep 2018, 02:42
Hi Everyone,
I am trying develop e Robot using a TriangularMovingAverage with CommodityChannelIndex. In cTrader, we can put a CommodityChannelIndex and after put a TriangularMovingAverage USING AS SOURCE this CommodityChannelIndex.
So, how can I write in C# to TriangularMovingAverage accept the CommodityChannelIndex in parameter method?
I tried write:
cci01 = Indicators.CommodityChannelIndex(CCI_Period);
DataSeriesCCI = CreateDataSeries();
tma01 = Indicators.TriangularMovingAverage(DataSeriesCCI, MA_Period);
and: (because i am tring many ways)
DataSeriesCCI[0] = cci01.Result.LastValue;
for (int i = 1; i <= 50; i++)
{
DataSeriesCCI[i] = cci01.Result.Last(i);
}
for (int i = 0; i <= 50; i++)
{
tma01.Calculate(i);
}
considering:
CommodityChannelIndex cci01;
TriangularMovingAverage tma01;
IndicatorDataSeries DataSeriesCCI;
When I print the value of tma01.Result.Last(1), for example, shows 17/08/2018 00:00:00.255 | tma01.Result.Last(1): NaN
Do anyone know the correct way to write in Robots?
Regards...
PanagiotisCharalampous
20 Sep 2018, 10:13
Hi julioc1010,
See below
Best Regards,
Panagiotis
@PanagiotisCharalampous