cpauna
cpauna 26 Feb 2013, 16:15
The error occurs only when I load the indicator in an instance on the "Robors" page.
On the "Indicators" page everything is OK. Thank you for your support.
This is the code :
//#reference: C:\Users\Cristian\Documents\cAlgo\Sources\Indicators\myHaikinAshi.algo
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = false)]
public class Symbol_PipSize : Indicator
{//My HA derivative indicator
[Output("test", IsHistogram = false, Color = Colors.Green, Thickness = 1)] public IndicatorDataSeries PAD { get; set; }
//Variables and dataseries
private myHaikinAshi myhas;
private IndicatorDataSeries mypad;
protected override void Initialize()
mypad = CreateDataSeries();
myhas = Indicators.GetIndicator<myHaikinAshi>();
}
public override void Calculate(int index)
mypad[index] = myhas.PA[index] - myhas.PA[index - 1];
//mypad[index] is OK
PAD[index] = (mypad[index] + mypad[index-1])/2/Symbol.PipSize;
//After Symbol.PipSyze operation ... the result is ... NaN ...
//If I load an instance of this indicator in the indicators page everything is OK
//If I load this indicator in the robots page ... I have Nan results ... ?!?
//Thank you.
cpauna
26 Feb 2013, 16:15
The error occurs only when I load the indicator in an instance on the "Robors" page.
On the "Indicators" page everything is OK. Thank you for your support.
This is the code :
//#reference: C:\Users\Cristian\Documents\cAlgo\Sources\Indicators\myHaikinAshi.algo
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = false)]
public class Symbol_PipSize : Indicator
{//My HA derivative indicator
[Output("test", IsHistogram = false, Color = Colors.Green, Thickness = 1)] public IndicatorDataSeries PAD { get; set; }
//Variables and dataseries
private myHaikinAshi myhas;
private IndicatorDataSeries mypad;
protected override void Initialize()
{
mypad = CreateDataSeries();
myhas = Indicators.GetIndicator<myHaikinAshi>();
}
public override void Calculate(int index)
{
mypad[index] = myhas.PA[index] - myhas.PA[index - 1];
//mypad[index] is OK
PAD[index] = (mypad[index] + mypad[index-1])/2/Symbol.PipSize;
//After Symbol.PipSyze operation ... the result is ... NaN ...
//If I load an instance of this indicator in the indicators page everything is OK
//If I load this indicator in the robots page ... I have Nan results ... ?!?
//Thank you.
}
}
}
@cpauna