/// <summary> /// Sets the params values /// </summary> void ParamChanged(object sender, EventArgs e) { string sName = ((Control)sender).Name; if (sName == "cbxSameDirAction") { // ComboBox Account Currency sameDirAverg = (SameDirSignalAction)cbxSameDirAction.SelectedIndex; } if (sName == "chbPermaSL") { // NumericUpDown nudPermaSL nudPermaSL.Enabled = chbPermaSL.Checked; cbxPermaSLType.Enabled = chbPermaSL.Checked; bUsePermanentSL = chbPermaSL.Checked; } if (sName == "cbxPermaSLType") { // ComboBox cbxPermaTPType permanentSLType = (PermanentProtectionType)cbxPermaSLType.SelectedIndex; } if (sName == "nudPermaSL") { // NumericUpDown nudPermaSL iPermSL = (int)nudPermaSL.Value; } if (sName == "chbPermaTP") { // NumericUpDown nudPermaTP nudPermaTP.Enabled = chbPermaTP.Checked; cbxPermaTPType.Enabled = chbPermaTP.Checked; bUsePermanentTP = chbPermaTP.Checked; } if (sName == "cbxPermaTPType") { // ComboBox cbxPermaTPType permanentTPType = (PermanentProtectionType)cbxPermaTPType.SelectedIndex; } if (sName == "nudPermaTP") { // NumericUpDown nudPermaTP iPermTP = (int)nudPermaTP.Value; } if (sName == "chbBreakEven") { // NumericUpDown nudBreakEven nudBreakEven.Enabled = chbBreakEven.Checked; bUseBreakEven = chbBreakEven.Checked; } if (sName == "nudBreakEven") { // NumericUpDown nudBreakEven iBreakEven = (int)nudBreakEven.Value; } if (sName == "cbxOppDirAction") { // ComboBox Leverage oppDirAverg = (OppositeDirSignalAction)cbxOppDirAction.SelectedIndex; } if (sName == "rbConstantUnits") { // Use account percent entry bUseAccountPercentEntry = false; lblPercent1.Visible = bUseAccountPercentEntry; lblPercent2.Visible = bUseAccountPercentEntry; lblPercent3.Visible = bUseAccountPercentEntry; } if (sName == "rbVariableUnits") { // Use account percent entry bUseAccountPercentEntry = true; lblPercent1.Visible = bUseAccountPercentEntry; lblPercent2.Visible = bUseAccountPercentEntry; lblPercent3.Visible = bUseAccountPercentEntry; } if (sName == "nudMaxOpenLots") { // NumericUpDown nudEntryLots dMaxOpenLots = (double)nudMaxOpenLots.Value; } if (sName == "nudEntryLots") { // NumericUpDown nudEntryLots dEntryLots = (double)nudEntryLots.Value; } if (!bUseAccountPercentEntry && dEntryLots > dMaxOpenLots) { dEntryLots = dMaxOpenLots; nudEntryLots.Value = (decimal)dEntryLots; } if (sName == "nudAddingLots") { // NumericUpDown nudAddingLots dAddingLots = (double)nudAddingLots.Value; } if (sName == "nudReducingLots") { // NumericUpDown nudReducingLots dReducingLots = (double)nudReducingLots.Value; } return; }