Пример #1
0
        public override void Calculate(int index)
        {
            var idx   = index + Instrument.IdxFirst;
            var mcs   = Instrument.EMATrueRange(idx - Periods, idx);
            var extrp = MA.Extrapolate(1, Periods, idx_: idx);
            var slope = extrp != null ? ((Monic)extrp.Curve).A : MA.FirstDerivative(idx);
            var ma    = MA[idx];

            MA0[index] = ma;
            Top[index] = ma + Distance * mcs + SlopeWeight * slope;
            Bot[index] = ma - Distance * mcs + SlopeWeight * slope;
        }