Пример #1
0
        // constructor, called only once, setup multiple tick variables
        public oIndicatorDump(int pPeriods)
        {
            iPeriods = pPeriods;

            ATR         = new iATR(pPeriods);
            BB          = new iBollingerBands(iPeriods, -1);
            CCI         = new iCCI(iPeriods);
            Derivatives = new iDerivatives();
            EMA         = new iEMA(iPeriods);
            FMA         = new iFMA(iPeriods);
            HMA         = new iHMA(iPeriods);
            MACD        = new iMACD(12, 26, 9);
            Momemtum    = new iMomemtum(iPeriods);
            RSI         = new iRSI(iPeriods);
            Renko       = new iRenko(iPeriods);
            SMA         = new iSMA(iPeriods);
            STARCBands  = new iSTARCBands(iPeriods, 2);
            STDDEV      = new iSTDDEV(iPeriods);
            Slope       = new iSlope();
            StochRSI    = new iStochRSI(iPeriods);
            Stochastics = new iStochastics(3, 2, 1);
            Stub        = new iStub(iPeriods);
            Trend       = new iTrend(iPeriods);
            TrueRange   = new iTrueRange();
            WMA         = new iWMA(iPeriods);
        }
Пример #2
0
        public iBollingerBands(int pPeriods, double pWidth)
        {
            periods = pPeriods;
            STDDEV  = new iSTDDEV(pPeriods);

            if (pWidth <= 0)
            {
                // this formula was hand fitted to give
                // pPeriods:10 width: ~1.9
                // pPeriods:20 width: ~2.0
                // pPeriods:50 width: ~2.1
                // as recommended by John Bollinger

                width = Math.Log(pPeriods + 2, 10) * 0.33 + 1.55;
            }
            else
            {
                width = pWidth;
            }
        }