zreboo:
Hi All,
I need help with This code, it compiles without Errors but when test it , it's not working .
I hope you guys help solve this problem 😊Your Booleans are doing nothing as they are always true and your if logic is wrong, try this instead
not tested
void TimeCheck() { MqlDateTime TimeNow; TimeToStruct(TimeCurrent(),TimeNow); if ( TimeNow.day_of_week >= closday && TimeNow.hour >= Close_Hour ) { CloseAllPositions(); } }
Paul Anscombe:
Your Booleans are doing nothing as they are always true and your if logic is wrong, try this instead
not tested
Hi Paul,
Thanks for the help. I tried the code, but it is not compatible with the expert advisor because there are other Function that depend on the Time-Check method and it shows an error. TimeCheck '- expression of' void 'type is illegal
But I think I should simplify the code more and then test it.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi All,
I need help with This code, it compiles without Errors but when test it , it's not working .
I hope you guys help solve this problem 😊