如何限制结果在某些范围值之间的输出,例如:240 有人举个例子吗?我正在尝试使用此代码,但未给出结果:int NumberOfHighs = 1;
double outputvalue;
for (int i=0; i<BarsLimit; i++)
{
int totals[];
ArrayInitialize(totals, 0);
datetime StartTime=iTime(NULL, 0, i);
int startShift = iBarShift(NULL, 0, StartTime, false);
outputvalue = get_value(startShift, SOMEINPUT, SOMEINPUT);
totals[outputvalue]++;
if (outputvalue>=240.0 && outputvalue<250.0 && totals[outputvalue]<NumberOfHighs)
{
Print("StartTime; ", TimeToString(StartTime, TIME_DATE), " outputvalue: ", outputvalue);
........
}
}