The function stops an Expert Advisor and unloads it from a chart.
No return value.
The Expert Advisor is not stopped immediately as you call ExpertRemove(); just a flag to stop the EA operation is set. That is, any next event won't be processed, OnDeinit() will be called and the Expert Advisor will be unloaded and removed from the chart.
When calling ExpertRemove() in the strategy tester after successful initialization of an EA, a test is completed normally with the call of OnDeinit() and OnTester(). In this case, the entire trading statistics and an optimization criterion value are obtained.