public Trailing_Stop_Limit(SlotTypes slotType)
{
// General properties
IndicatorName = "Trailing Stop Limit";
PossibleSlots = SlotTypes.Close;
WarningMessage = "The Trailing Stop Limit indicator trails once per bar." +
" It means that the indicator doesn't move the position's SL at every new top / bottom, as in the real trade, but only when a new bar begins." +
" The Stop Loss remains constant during the whole bar. Take Profit level is constant by definition.";
// 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";
IndParam.ListParam[0].ItemList = new string[]
{
"Exit at the trailing Stop Loss or at the constant Take Profit level",
};
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 = "Trailing mode";
IndParam.ListParam[1].ItemList = new string[]
{
"Trails once a bar",
};
IndParam.ListParam[1].Index = 0;
IndParam.ListParam[1].Text = IndParam.ListParam[1].ItemList[IndParam.ListParam[1].Index];
IndParam.ListParam[1].Enabled = true;
IndParam.ListParam[1].ToolTip = "Mode of operation of Trailing Stop.";
// The NumericUpDown parameters
IndParam.NumParam[0].Caption = "Initial Stop Loss";
IndParam.NumParam[0].Value = 200;
IndParam.NumParam[0].Min = 5;
IndParam.NumParam[0].Max = 5000;
IndParam.NumParam[0].Enabled = true;
IndParam.NumParam[0].ToolTip = "The initial Stop Loss value (in pips).";
IndParam.NumParam[1].Caption = "Take Profit";
IndParam.NumParam[1].Value = 200;
IndParam.NumParam[1].Min = 5;
IndParam.NumParam[1].Max = 5000;
IndParam.NumParam[1].Enabled = true;
IndParam.NumParam[1].ToolTip = "The constant Take Profit value (in pips).";
return;
}