Esempio n. 1
0
        private int AddIndicators()
        {
            int toAddForFirstLayer = 0;

            Indicator.Clear();
            if (sma.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.SMA, (int)smaPeriod.Value));
                toAddForFirstLayer++;
            }

            if (wma.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.WMA, (int)wmaPeriod.Value));
                toAddForFirstLayer++;
            }

            if (ema.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.EMA, (int)emaPeriod.Value));
                toAddForFirstLayer++;
            }

            if (roc.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.ROC, (int)rocPeriod.Value));
                toAddForFirstLayer++;
            }

            if (macd.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.MACD, (int)macdPeriod.Value));
                toAddForFirstLayer++;
            }

            if (oscill.CheckState == CheckState.Checked)
            {
                Indicator.Add(new KeyValuePair <Indi, int>(Indicators.Indicators.Oscillator, (int)oscillValue.Value));
                toAddForFirstLayer++;
            }

            return(toAddForFirstLayer);
        }