Improved implementation of waiting loop. This version is running with
Dukascopy API 2.9.10.1. Needs further refactoring and testing though.