Symbol.PipSize return NaN in indicator Calculate(int index) procedure ...

Created at 26 Feb 2013, 10:37
CP

cpauna

Joined 04.02.2013

Symbol.PipSize return NaN in indicator Calculate(int index) procedure ...
26 Feb 2013, 10:37


Symbol.PipSize return NaN in indicator Calculate(int index) procedure ... thank you ...


@cpauna
Replies

cAlgo_Fanatic
26 Feb 2013, 12:18

Please see this post relating to Indicators Indicator Overlay

Otherwise, please post the code so that we can assist you.

Regards,


@cAlgo_Fanatic

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

cAlgo_Fanatic
27 Feb 2013, 12:42 ( Updated at: 19 Mar 2025, 08:57 )

Do you mean you are using this indicator as a reference in a Robot? If so please post the code of the Robot as well as myHaikinAshi Indicator or email it to support@ctrader.com so that we can look into it.

Regards,


@cAlgo_Fanatic