public bool SetUsePrevBarValueCheckBox(int slot)
{
bool isChanged = false;
for (int param = 0; param < Slot[slot].IndParam.CheckParam.Length; param++)
{
if (Slot[slot].IndParam.CheckParam[param].Caption == "Use previous bar value")
{
bool isOrigChecked = Slot[slot].IndParam.CheckParam[param].Checked;
bool isChecked = true;
// Open slot
if (Slot[slot].SlotType == SlotTypes.Open)
{
isChecked = true;
}
// Opening logic condition slot
else if (Slot[slot].SlotType == SlotTypes.OpenFilter)
{
isChecked = EntryExecutionTime != ExecutionTime.AtBarClosing;
}
// Close slot
else if (Slot[slot].SlotType == SlotTypes.Close)
{
isChecked = true;
}
// Closing logic condition slot
else if (Slot[slot].SlotType == SlotTypes.CloseFilter)
{
isChecked = ExitExecutionTime != ExecutionTime.AtBarClosing;
}
if (isChecked)
{
for (int iPar = 0; iPar < Slot[slot].IndParam.ListParam.Length; iPar++)
{
if (Slot[slot].IndParam.ListParam[iPar].Caption == "Base price" &&
Slot[slot].IndParam.ListParam[iPar].Text == "Open")
{
isChecked = false;
}
}
}
if (isChecked != isOrigChecked)
{
isChanged = true;
Slot[slot].IndParam.CheckParam[param].Checked = isChecked;
}
}
}
return isChanged;
}