void UsePreviousBarValue_Change()
{
if (miStrategyAUPBV.Checked == false)
{
// Confirmation Message
string sMessageText = Language.T("Are you sure you want to control \"Use previous bar value\" manually?");
DialogResult dialogResult = MessageBox.Show(sMessageText, Language.T("Use previous bar value"), MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dialogResult == DialogResult.Yes)
{ // OK, we are sure
Data.AutoUsePrvBarValue = false;
foreach (IndicatorSlot indicatorSlot in Data.Strategy.Slot)
foreach (CheckParam checkParam in indicatorSlot.IndParam.CheckParam)
if (checkParam.Caption == "Use previous bar value")
checkParam.Enabled = true;
}
else
{ // Not just now
miStrategyAUPBV.Checked = true;
}
}
else
{
Data.AutoUsePrvBarValue = true;
Data.Strategy.AdjustUsePreviousBarValue();
RepaintStrategyLayout();
Calculate(true);
}
return;
}