How to make sum of last 30 values on indicator
Created at 27 Nov 2014, 20:31
How to make sum of last 30 values on indicator
27 Nov 2014, 20:31
Hi,
I have simple indicator which calculates some values and prints them on price chart on each bar...some bars don't have values
how to make sum of those values (in last 30 bars), and how to count them as they are not on each bar
my indicator is something like High - Low...so you can use that example to help me ..thanks
using System; using cAlgo.API; namespace cAlgo.Indicators { [Indicator(AccessRights = AccessRights.None)] class HighMinusLow : Indicator { [Output("Main")] public IndicatorDataSeries Result { get; set; } public override void Calculate(int index) { Result[index] = MarketSeries.High[index] - MarketSeries.Low[index]; } } }