I am using below code, so that unless user uses 15 min or daily or weekly or monthly time frame; it is going to show error message to prompt to correct the time period :
else if (State == State.Historical)
{
if ((BarsPeriod.Value != 15 && BarsPeriod.BarsPeriodType == BarsPeriodType.Minute)||
(BarsPeriod.BarsPeriodType != BarsPeriodType.Day)||(BarsPeriod.BarsPeriodType != BarsPeriodType.Week)||
(BarsPeriod.BarsPeriodType != BarsPeriodType.Month))
{
Draw.TextFixed(this, "Error", "change to 15 Min/Daily/ Weekly/ Monthly/", TextPosition.Center);
Log("change to 15 Min/ Daily/ Weekly/ Monthly", LogLevel.Error);
}
}
But for some strange reason, it is not working as expected. so far I could find in ref guide and in forum examples, that is the way. Anyone can suggest what might be missing or wrong there?
Comment