Calculation of shadows. How to get it in pips?
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]) ;
}
}
}
}
... Deleted by UFO ...