protected override void OnStartUp()
        {
            onBasicBars = primType == RWT_HA.PrimaryOHLC.BARS;

            var b1 = RWT_HA.OHLCFactory.createPrimary(primType, Open, High, Low, Close, Input);
            var b2 = RWT_HA.OHLCFactory.createSecondary(b1, smoothType, smoothArg);

            bars      = new RWT_HA.Heiken_Ashi(b2);
            lastFilt  = 0.5 * (bars.High + bars.Low);
            lastProxy = lastFilt;

            filter = RWT_MA.MAFactory.create(filterType, filterArg);
            filter.init(lastFilt);


            linreg = new RWT_MA.LINREGSLOPE((double)lookback);
            linreg.init(lastFilt);

            dirUp = true;

            actualTolerance = tolerance;
            if (onBasicBars)
            {
                actualTolerance *= TickSize;
            }
        }
Example #2
0
        protected override void OnStartUp()
        {
            var prim = RWT_HA.OHLCFactory.createPrimary(primType, Open, High, Low, Close, Input);
            var sm   = RWT_HA.OHLCFactory.createSecondary(prim, smoothType, smoothArg);

            habars = RWT_HA.OHLCFactory.createSecondary(sm, RWT_HA.SecondaryOHLC.HEIKEN_ASHI, 0.0);
        }
        protected override void OnStartUp()
        {
            bars = RWT_HA.OHLCFactory.createPrimary(inputType, Open, High, Low, Close, Input);

            smoother = RWT_MA.MAFactory.create(smoothType, smoothArg);
            smoother.init(Input[0]);
            band = RWT_Bands.BandFactory.create(bandType, bars, lengthOfBand, bandArg);
            band.init(Input[0]);

            bandSmoother1 = RWT_MA.MAFactory.create(bandsmoothType, bandsmoothArg);
            bandSmoother1.init(Input[0]);
            bandSmoother2 = RWT_MA.MAFactory.create(bandsmoothType, bandsmoothArg);
            bandSmoother2.init(Input[0]);
        }
Example #4
0
        protected override void OnStartUp()
        {
            var b1 = RWT_HA.OHLCFactory.createPrimary(barsType, Open, High, Low, Close, Input);

            bars = RWT_HA.OHLCFactory.createSecondary(b1, barSmoothType, barSmoothArg);

            truerange = RWT_MA.MAFactory.create(dMType, dMLength);
            dplus     = RWT_MA.MAFactory.create(dMType, dMLength);
            dminus    = RWT_MA.MAFactory.create(dMType, dMLength);
            adx       = RWT_MA.MAFactory.create(aDXType, aDXLength);
            truerange.init(bars.High - bars.Low);
            dplus.init(0);
            dminus.init(0);
            adx.init(.5);
            ADX.Set(0);
            oldADX = 0;
        }
        public static Band create(BandType type, RWT_HA.OHLC bars, int len, double arg)
        {
            Band ans = null;

            switch (type)
            {
            case BandType.STDDEV:
                ans = new StdDevBand(len, arg);
                break;

            case BandType.STDASYMM:
                ans = new StdDevAsymmBand(len, arg);
                break;

            case BandType.RUNERR:
                ans = new RunnErrorBand(len, arg);
                break;

            case BandType.KELTNER:
                ans = new KeltnerBand(bars, len, arg);
                break;
            }
            return(ans);
        }
 public KeltnerBand(RWT_HA.OHLC b, int len, double mult)
 {
     bars       = b;
     length     = len;
     multiplier = mult;
 }