Not able to stop trading in friday and from 20:00 to 21:00 in ΕΑ
twenty=now_time.hour<21 && now_time.hour>20;
Hour is an integer — if it is greater than 20 it can never be less than 21.
Hour is an integer — if it is greater than 20 it can never be less than 21.
Thanks, you're right.
Anyway I've changed the value as below but the situation doesn't change.
TimeCurrent(now_time); we=now_time.day_of_week==5 && now_time.hour>=19; twenty=now_time.hour<=21.5 && now_time.hour>=19.8;

Moreover it doesn't seem to stop and close positions during the weekend and I'don't understand why....
Thanks in advance
Because the market is closed during the weekend.
Good afternoon,
I'm writing and EA in MQL5 with Bollinger Bands based on example I've found on this site.
I'm trying to say to the EA to stop trading Friday at 21:00 (server time) and during the week to avoid to trade from 20:00 to 21:00.
Unfortunately during the backtesting it doesn't work.
Below the entire code of the EA:
Thanks