Forex_Strategy_Builder.Moving_Averages_Crossover.Moving_Averages_Crossover C# (CSharp) Method

Moving_Averages_Crossover() public method

Sets the default indicator parameters for the designated slot type
public Moving_Averages_Crossover ( SlotTypes slotType ) : System
slotType SlotTypes
return System
        public Moving_Averages_Crossover(SlotTypes slotType)
        {
            // General properties
            IndicatorName = "Moving Averages Crossover";
            PossibleSlots = SlotTypes.OpenFilter | SlotTypes.CloseFilter;

            // Setting up the indicator parameters
            IndParam = new IndicatorParam();
            IndParam.IndicatorName = IndicatorName;
            IndParam.SlotType      = slotType;

            // The ComboBox parameters
            IndParam.ListParam[0].Caption  = "Logic";
            IndParam.ListParam[0].ItemList = new string[]
            {
                "The Fast MA crosses the Slow MA upward",
                "The Fast MA crosses the Slow MA downward",
                "The Fast MA is higher than the Slow MA",
                "The Fast MA is lower than the Slow MA",
            };
            IndParam.ListParam[0].Index    = 0;
            IndParam.ListParam[0].Text     = IndParam.ListParam[0].ItemList[IndParam.ListParam[0].Index];
            IndParam.ListParam[0].Enabled  = true;
            IndParam.ListParam[0].ToolTip  = "Logic of application of the indicator.";

            IndParam.ListParam[1].Caption  = "Base price";
            IndParam.ListParam[1].ItemList = Enum.GetNames(typeof(BasePrice));
            IndParam.ListParam[1].Index    = (int)BasePrice.Close;
            IndParam.ListParam[1].Text     = IndParam.ListParam[1].ItemList[IndParam.ListParam[1].Index];
            IndParam.ListParam[1].Enabled  = true;
            IndParam.ListParam[1].ToolTip  = "The price both Moving Averages are based on.";

            IndParam.ListParam[3].Caption  = "Fast MA method";
            IndParam.ListParam[3].ItemList = Enum.GetNames(typeof(MAMethod));
            IndParam.ListParam[3].Index    = (int)MAMethod.Simple;
            IndParam.ListParam[3].Text     = IndParam.ListParam[3].ItemList[IndParam.ListParam[3].Index];
            IndParam.ListParam[3].Enabled  = true;
            IndParam.ListParam[3].ToolTip  = "The method used for smoothing the Fast Moving Averages.";

            IndParam.ListParam[4].Caption  = "Slow MA method";
            IndParam.ListParam[4].ItemList = Enum.GetNames(typeof(MAMethod));
            IndParam.ListParam[4].Index    = (int)MAMethod.Simple;
            IndParam.ListParam[4].Text     = IndParam.ListParam[4].ItemList[IndParam.ListParam[4].Index];
            IndParam.ListParam[4].Enabled  = true;
            IndParam.ListParam[4].ToolTip  = "The method used for smoothing the slow Moving Averages.";

            // The NumericUpDown parameters
            IndParam.NumParam[0].Caption   = "Fast MA period";
            IndParam.NumParam[0].Value     = 13;
            IndParam.NumParam[0].Min       = 1;
            IndParam.NumParam[0].Max       = 200;
            IndParam.NumParam[0].Enabled   = true;
            IndParam.NumParam[0].ToolTip   = "The period of Fast MA.";

            IndParam.NumParam[1].Caption   = "Slow MA period";
            IndParam.NumParam[1].Value     = 21;
            IndParam.NumParam[1].Min       = 1;
            IndParam.NumParam[1].Max       = 200;
            IndParam.NumParam[1].Enabled   = true;
            IndParam.NumParam[1].ToolTip   = "The period of Slow MA.";

            IndParam.NumParam[2].Caption   = "Fast MA shift";
            IndParam.NumParam[2].Value     = 0;
            IndParam.NumParam[2].Min       = 0;
            IndParam.NumParam[2].Max       = 100;
            IndParam.NumParam[2].Point     = 0;
            IndParam.NumParam[2].Enabled   = true;
            IndParam.NumParam[2].ToolTip   = "The shifting value of Fast MA.";

            IndParam.NumParam[3].Caption   = "Slow MA shift";
            IndParam.NumParam[3].Value     = 0;
            IndParam.NumParam[3].Min       = 0;
            IndParam.NumParam[3].Max       = 100;
            IndParam.NumParam[3].Point     = 0;
            IndParam.NumParam[3].Enabled   = true;
            IndParam.NumParam[3].ToolTip   = "The shifting value of Slow MA.";

            // The CheckBox parameters
            IndParam.CheckParam[0].Caption = "Use previous bar value";
            IndParam.CheckParam[0].Checked = PrepareUsePrevBarValueCheckBox(slotType);
            IndParam.CheckParam[0].Enabled = true;
            IndParam.CheckParam[0].ToolTip = "Use the indicator value from the previous bar.";

            return;
        }