RO
shift in atr ?
11 Jul 2014, 10:27
hi
how set shift in cbot
like this
int shift = 0; double atr=iATR(NULL,60,14,shift);
i try this in calgo but how set shift
[Parameter("AtrPeriod", DefaultValue = "Hour")]
public TimeFrame AtrPeriod { get; set; }
protected override void OnStart()
{
var atrperiod = MarketData.GetSeries(AtrPeriod);
atr = Indicators.AverageTrueRange(atrperiod, 14, MovingAverageType.Simple);
}
and this in moving
double mov=iMA(NULL,60,55,ma_shift+3,0,0,shift+2);
i found this
/forum/calgo-reference-samples/733
but how it's work in cbot .?

Spotware
11 Jul 2014, 11:55
You can shift the index:
protected override void OnTick() { var index = MarketSeries.Close.Count - 1; var shift = 2; var shiftedValue = atr.Result[index - shift]; }@Spotware