MQL4参考 检测 IsOptimization

IsOptimization

Checks if Expert Advisor runs in the Strategy Tester optimization mode.

bool  IsOptimization();

Returned value

Returns true if Expert Advisor runs in the Strategy Tester optimization mode, otherwise returns false.

Example:

  if(IsOptimization()) return(0);