Quote:
users would not expect that a button named "stop" starts a new run

No one would expect it, me neither.

Quote:
Why not using simply the evaluate or cleanup function?

With pleasure. Could you please give me a hint how to call a function after the end of trading the with the evaluate function?

Quote:
From the manual:
For globally allocated memory areas, define a void cleanup() function that releases memory. The function will be automatically called at end or termination of the session.

Does this work:
Code:
void cleanup() {
   for(all_trades) 
  	print(TO_CSV, "%s, %s, %.1f, %.2fn", strdate("%y%m%d %H:%M:%S", TradeEnterTime), Asset, SpecialKey, TradeProfit);
}