Code Library / Trade Management
News Time Filter
Pause trading during high-impact news.
Language: MQL4 · Category: Trade Management · Tags: news filter, NFP, MQL4
Source code
bool IsNews(){
int h=TimeHour(TimeCurrent());
if(DayOfWeek()==5&&Day()<=7&&h==13) return true;
return false;
}
bool CanTrade(){return !IsNews();}How to use this snippet
This is a building block, not a finished trading system. Paste it into your own MQL4 project, compile it, and test it on a demo account with your broker's real spreads before relying on it. If MetaEditor reports errors, the compilation error fixer can help.