예제 #1
0
        protected override void Initialize()
        {
            Buffer = CreateDataSeries();

            // Moving Average Type according to input MA_Type
            switch (MAType)
            {
            case 1:
                // Simple Moving Average
                _sma = Indicators.SimpleMovingAverage(MAApplied, MAPeriod);
                break;

            case 2:
                // Exponential Moving Average
                _ema = Indicators.ExponentialMovingAverage(MAApplied, MAPeriod);
                break;

            case 3:
                // Smoothed Moving Average
                _wsma = Indicators.GetIndicator <Wsma>(MAApplied, MAPeriod);
                break;

            case 4:
                // Linear Weighted Moving Average
                _lwma = Indicators.GetIndicator <Lwma>(MAApplied, MAPeriod);
                break;

            case 5:
                // Double Exponential Moving Average
                _dema = Indicators.GetIndicator <Dema>(MAApplied, MAPeriod);
                break;

            case 6:
                // Triple Exponential Moving Average
                _tema = Indicators.GetIndicator <Tema>(MAApplied, MAPeriod);
                break;

            case 7:
                // T3 Moving Average
                _t3MA = Indicators.GetIndicator <T3MA>(MAApplied, MAPeriod, T3MAVolumeFactor);
                break;
            }
        }
예제 #2
0
파일: Xpma.cs 프로젝트: Mikai47/cAlgoBot
        protected override void Initialize()
        {
            Buffer = CreateDataSeries();

            // Moving Average Type according to input MA_Type
            switch (MAType)
            {
                case 1:
                    // Simple Moving Average
                    _sma = Indicators.SimpleMovingAverage(MAApplied, MAPeriod);
                    break;
                case 2:
                    // Exponential Moving Average
                    _ema = Indicators.ExponentialMovingAverage(MAApplied, MAPeriod);
                    break;
                case 3:
                    // Smoothed Moving Average		
                    _wsma = Indicators.GetIndicator<Wsma>(MAApplied, MAPeriod);
                    break;
                case 4:
                    // Linear Weighted Moving Average  
                    _lwma = Indicators.GetIndicator<Lwma>(MAApplied, MAPeriod);
                    break;
                case 5:
                    // Double Exponential Moving Average
                    _dema = Indicators.GetIndicator<Dema>(MAApplied, MAPeriod);
                    break;
                case 6:
                    // Triple Exponential Moving Average
                    _tema = Indicators.GetIndicator<Tema>(MAApplied, MAPeriod);
                    break;
                case 7:
                    // T3 Moving Average
                    _t3MA = Indicators.GetIndicator<T3MA>(MAApplied, MAPeriod, T3MAVolumeFactor);
                    break;
            }
        }