protected override decimal Calculate(int index) { decimal shortMA = _shortSma.GetValue(index); decimal longMA = _longSma.GetValue(index); return(shortMA.Minus(longMA) .DividedBy(longMA) .MultipliedBy(Decimals.HUNDRED)); }
protected override decimal Calculate(int index) { decimal typicalPrice = _typicalPriceInd.GetValue(index); decimal typicalPriceAvg = _smaInd.GetValue(index); decimal meanDeviation = _meanDeviationInd.GetValue(index); if (meanDeviation.IsZero()) { return(Decimals.Zero); } return((typicalPrice.Minus(typicalPriceAvg)).DividedBy(meanDeviation.MultipliedBy(FACTOR))); }
protected override decimal Calculate(int index) { return(_price.GetValue(index).Minus(_sma.GetValue(index - _timeShift))); }
protected override decimal Calculate(int index) { return(_sma5.GetValue(index).Minus(_sma34.GetValue(index))); }