Ejemplo n.º 1
0
        public PBBandWidth(Bars bars, int period, string description)
            : base(bars, description)
        {
            base.FirstValidValue = period;

            PBandLower PBL = PBandLower.Series(bars, period);
            PBandUpper PBU = PBandUpper.Series(bars, period);

            for (int bar = FirstValidValue; bar < bars.Count; bar++)
            {
                base[bar] = 200 * (PBU[bar] - PBL[bar]) / (PBU[bar] + PBL[bar]);
            }
        }
Ejemplo n.º 2
0
        public static PBandLower Series(Bars bars, int period)
        {
            string description = string.Concat(new object[] { "Projection Band Lower (", period, ")" });

            if (bars.Cache.ContainsKey(description))
            {
                return((PBandLower)bars.Cache[description]);
            }

            PBandLower _PBandLower = new PBandLower(bars, period, description);

            bars.Cache[description] = _PBandLower;
            return(_PBandLower);
        }
Ejemplo n.º 3
0
        public PBFastOsc(Bars bars, int period, int FSmooth, string description)
            : base(bars, description)
        {
            base.FirstValidValue = Math.Max(FSmooth, period) * 3;

            PBandLower PBL = PBandLower.Series(bars, period);
            PBandUpper PBU = PBandUpper.Series(bars, period);

            DataSeries A      = bars.Close - PBL;
            DataSeries B      = PBU - PBL;
            DataSeries Result = EMA.Series((A / B) * 100, FSmooth, EMACalculation.Modern);

            for (int bar = FirstValidValue; bar < bars.Count; bar++)
            {
                base[bar] = Result[bar];
            }
        }