public Round_Number(SlotTypes slotType)
{
// General properties
IndicatorName = "Round Number";
PossibleSlots = SlotTypes.Open | SlotTypes.Close;
// Setting up the indicator parameters
IndParam = new IndicatorParam();
IndParam.IndicatorName = IndicatorName;
IndParam.SlotType = slotType;
IndParam.IndicatorType = TypeOfIndicator.Additional;
// The ComboBox parameters
IndParam.ListParam[0].Caption = "Logic";
if (slotType == SlotTypes.Open)
IndParam.ListParam[0].ItemList = new string[]
{
"Enter long at the higher round number",
"Enter long at the lower round number"
};
else if (slotType == SlotTypes.Close)
IndParam.ListParam[0].ItemList = new string[]
{
"Exit long at the higher round number",
"Exit long at the lower round number"
};
else
IndParam.ListParam[0].ItemList = new string[]
{
"Not Defined"
};
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.";
// The NumericUpDown parameters
IndParam.NumParam[0].Caption = "Vertical shift";
IndParam.NumParam[0].Value = 0;
IndParam.NumParam[0].Min = -2000;
IndParam.NumParam[0].Max = +2000;
IndParam.NumParam[0].Enabled = true;
IndParam.NumParam[0].ToolTip = "A vertical shift above the higher and below the lower round number.";
// The NumericUpDown parameters
IndParam.NumParam[1].Caption = "Digits";
IndParam.NumParam[1].Value = 2;
IndParam.NumParam[1].Min = 2;
IndParam.NumParam[1].Max = 4;
IndParam.NumParam[1].Enabled = true;
IndParam.NumParam[1].ToolTip = "Number of digits to be rounded.";
return;
}