public Oscillator_of_MACD(SlotTypes slotType)
{
// General properties
IndicatorName = "Oscillator of MACD";
PossibleSlots = SlotTypes.OpenFilter | SlotTypes.CloseFilter;
SeparatedChart = true;
// Setting up the indicator parameters
IndParam = new IndicatorParam();
IndParam.IndicatorName = IndicatorName;
IndParam.SlotType = slotType;
IndParam.IndicatorType = TypeOfIndicator.OscillatorOfIndicators;
// The ComboBox parameters
IndParam.ListParam[0].Caption = "Logic";
IndParam.ListParam[0].ItemList = new string[]
{
"The Oscillator of MACD rises",
"The Oscillator of MACD falls",
"The Oscillator of MACD is higher than the zero line",
"The Oscillator of MACD is lower than the zero line",
"The Oscillator of MACD crosses the zero line upward",
"The Oscillator of MACD crosses the zero line downward",
"The Oscillator of MACD changes its direction upward",
"The Oscillator of MACD changes its direction downward"
};
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 oscillator.";
IndParam.ListParam[1].Caption = "Smoothing method";
IndParam.ListParam[1].ItemList = Enum.GetNames(typeof(MAMethod));
IndParam.ListParam[1].Index = (int)MAMethod.Exponential;
IndParam.ListParam[1].Text = IndParam.ListParam[1].ItemList[IndParam.ListParam[1].Index];
IndParam.ListParam[1].Enabled = true;
IndParam.ListParam[1].ToolTip = "The Moving Average method used for smoothing the MACD value.";
IndParam.ListParam[2].Caption = "Base price";
IndParam.ListParam[2].ItemList = Enum.GetNames(typeof(BasePrice));
IndParam.ListParam[2].Index = (int)BasePrice.Close;
IndParam.ListParam[2].Text = IndParam.ListParam[2].ItemList[IndParam.ListParam[2].Index];
IndParam.ListParam[2].Enabled = true;
IndParam.ListParam[2].ToolTip = "The price the indicator is based on.";
IndParam.ListParam[3].Caption = "Signal line method";
IndParam.ListParam[3].ItemList = Enum.GetNames(typeof(MAMethod));
IndParam.ListParam[3].Index = (int)MAMethod.Exponential;
IndParam.ListParam[3].Text = IndParam.ListParam[3].ItemList[IndParam.ListParam[3].Index];
IndParam.ListParam[3].Enabled = true;
IndParam.ListParam[3].ToolTip = "The smoothing method of the signal line.";
IndParam.ListParam[4].Caption = "What to compare";
IndParam.ListParam[4].ItemList = new string[] { "Histogram 1 to Histogram 2", "Signal line 1 to Signal line 2", "MACD line 1 to MACD line 2" };
IndParam.ListParam[4].Index = 0;
IndParam.ListParam[4].Text = IndParam.ListParam[4].ItemList[IndParam.ListParam[4].Index];
IndParam.ListParam[4].Enabled = true;
IndParam.ListParam[4].ToolTip = "The smoothing method of the signal line.";
// The NumericUpDown parameters
IndParam.NumParam[0].Caption = "MACD1 slow MA";
IndParam.NumParam[0].Value = 26;
IndParam.NumParam[0].Min = 1;
IndParam.NumParam[0].Max = 200;
IndParam.NumParam[0].Enabled = true;
IndParam.NumParam[0].ToolTip = "The period of first MACD slow line.";
IndParam.NumParam[1].Caption = "MACD2 slow MA";
IndParam.NumParam[1].Value = 32;
IndParam.NumParam[1].Min = 1;
IndParam.NumParam[1].Max = 200;
IndParam.NumParam[1].Enabled = true;
IndParam.NumParam[1].ToolTip = "The period of second MACD slow line.";
IndParam.NumParam[2].Caption = "MACD1 fast MA";
IndParam.NumParam[2].Value = 12;
IndParam.NumParam[2].Min = 1;
IndParam.NumParam[2].Max = 200;
IndParam.NumParam[2].Enabled = true;
IndParam.NumParam[2].ToolTip = "The period of first MACD fast line.";
IndParam.NumParam[3].Caption = "MACD2 fast MA";
IndParam.NumParam[3].Value = 21;
IndParam.NumParam[3].Min = 1;
IndParam.NumParam[3].Max = 200;
IndParam.NumParam[3].Enabled = true;
IndParam.NumParam[3].ToolTip = "The period of second MACD fast line.";
IndParam.NumParam[4].Caption = "MACD1 Signal line";
IndParam.NumParam[4].Value = 9;
IndParam.NumParam[4].Min = 1;
IndParam.NumParam[4].Max = 200;
IndParam.NumParam[4].Enabled = true;
IndParam.NumParam[4].ToolTip = "The period of Signal line.";
IndParam.NumParam[5].Caption = "MACD2 Signal line";
IndParam.NumParam[5].Value = 13;
IndParam.NumParam[5].Min = 1;
IndParam.NumParam[5].Max = 200;
IndParam.NumParam[5].Enabled = true;
IndParam.NumParam[5].ToolTip = "The period of Signal line.";
// 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;
}