Calculation of shadows. How to get it in pips?

Created at 06 Dec 2016, 07:04
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
IR

iRobot

Joined 17.02.2013

Calculation of shadows. How to get it in pips?
06 Dec 2016, 07:04


I get strange very low values. How to get result in pips?

 

Thanks

 

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None, ScalePrecision = 1)]
    public class Shadows : Indicator
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Output("Upper Shadow", Color = Colors.Red, PlotType = PlotType.Histogram, Thickness = 2)]
        public IndicatorDataSeries UpperShadow { get; set; }

        [Output("Lower Shadow", Color = Colors.Green, PlotType = PlotType.Histogram, Thickness = 2)]
        public IndicatorDataSeries LowerShadow { get; set; }

        public override void Calculate(int index)
        {

            if (MarketSeries.Close[index] >= MarketSeries.Open[index])
            {
                UpperShadow[index] = (MarketSeries.High[index] - MarketSeries.Close[index]) ;
                LowerShadow[index] = (MarketSeries.Low[index] - MarketSeries.Open[index]) ;
            }


            else
            {
                UpperShadow[index] = (MarketSeries.High[index] - MarketSeries.Open[index]) ;
                LowerShadow[index] = (MarketSeries.Low[index] - MarketSeries.Close[index]) ;
            }
            

        }
    }



}


@iRobot
Replies

... Deleted by UFO ...

iRobot
06 Dec 2016, 21:40

Thanks lucian.

Could you please explain, why it is a division function ( / Symbol.PipSize), and not multiply function ( * Symbol.PipSize)?

 


@iRobot

iRobot
06 Dec 2016, 22:07

After some thinking I understood :)


@iRobot