The code was designed to illustrate the use of the timer. This Expert Advisor opens a deal in random direction the moment a signal from the timer arrives.
If there are open positions present when the timer signal arrives, the EA will skip the timer signal.
Timer parameters, as well as the stop loss and take profit values can be set in the input parameters.