MT5 Very simple news filter
-
The original idea was not mine, but I came up with an extremely simple version to manage news events. Essentially it detects a news event object on the chart and if so it will prevent any new trades opening, all settings are managed in the indicator for news events.
Original Thread - https://fxdreema.com/forum/topic/1973/News-EA/39
Apply the FXSSI news indicator to your chart and set the news up, e.g. 4hrs before and after on 3 star.
Apply the EA - Simple comment box top left for News - Detected or not.
https://fxdreema.com/shared/PWmLKlzOc
https://fxssi.com/forex-news-indicator-mt4 (MT5 download is on this link)
-
Check if 0 is the next event (I think it could be in the past)
-
You can choose within the indicator whether you have past events or not, so if you set past events to 1 hour, after that hour if there is one news event active it will dissapear and trading will resume.
-
Ok, so then the next event is always 0?
-
Well kinda of, the first event from left to right no matter if it is before or after the news is always 0
So hence why the settings are controlled within the indicator. When a news event is no longer displayed on the chart after e.g. 4 hours the objects get recreated and thus again the first even from left to right is 0 again.
-
@Ipod Your idea of the FXSS.Cal indicator was brillent, i built an optimized version that uses different parameters, works 100% no need to find the 0, or 1, anyway any idea where i can get my hands on the .MQ5 raw file, i believe i can optimize the indicator to be used for backtesting
-
@chrisbe would you mind to share it and describe how it works if needed?
-
@chrisbe There is no way to get the mq5 raw file without hacking the file (I do not have contacts for that), you could commission someone on mql5 to make a news filter with an additional option to be able to download a csv file and allow that to be used during backtests.
Otherwise with this you can only forward test sadly, but I am glad you find it useful. Can you share your project so I can maybe improve my own personal news filter.
-
@Ipod Hello, true, i workkd out a way to use the back test but for MT4 currently MT5, it involved downloading the past news data and saving to your MT Platform, will shear when am done
-
@Ipod Sure will shear it with you shortly, updating a few codes in it
-
@chrisbe Great!
Let me know how you get on
-
Hello Guys, been away from FXdreema in a while, n=but here is the updated news filter works very well,
https://fxdreema.com/shared/XC1HgM9Hc,THIS EA HAS BEEN MADE USING FXSSI.Calendar.ex5 AS A NEWS INDICATOR, IT DOESNT NEED TO BE IMPORTED INTO FX DREEMA TO WORK, PARAMETERS HAVE BEEN SET TO USE TRUE OR FALSE TO STOP, CLOSE AND PREVENT TRADE BEFORE NEWS HOUR, DEFAULT PARAMETER IS SET IN SECONDS, 1 HOUR BEFORE NEWS AND 30 MINUTES AFTER NEWS THIS CAN BE CHANGED, DEFAULT PARAMETER FOR STOPING TRADE IS High_Impact OR Medium_Impact, if High_Impact_Only IS SET TO TRUE, ONLY HIGH IMPACT NEWS WILL BE USED, ELSE IF SET TO FALSE BOTH HIGH AND MEDIUM IMPACT NEWS WILL BE USED
-
@chrisbe Thank you very much for sharing.
-
@chrisbe Nice, thanks for sharing that's some nice code and a great addition.
Personally I prefer minutes as the input, I think some minor changes to the over all options / configuration will make this an exceptional fxdreema news filter that was previously extremly difficult. I will try to implement some features my self.
I'll have to learn to code and understand this but my vision is something as below. As most prop firms these days void trades that open through news events etc.
Constants
- News Filter - True / False
- Low Impact - 5
- Med Impact - 60
- High Impact - 240
Low, Med and High are in minutes, and 0 would = false or turned off. Generally I use the same value for pre and post news so that's not a huge issue to me.
One single variable output "NewsDetected" so in the code, if any of the low, medium or high are detected in those times it sets "NewsDetected" to true and then trading blocks can be determined from that single condition block.
Maybe have a variable "News_Detected" and at the end of the code if Low, Med, High add up to 0 then news is allowed, if anyone of them set to 1 would add the total to =>1 then trading is disabled.
Something like this.

-
@Ipod Hello, if you want minutes all yu need to do is adjust the time, remember the time is in seconds, the default seconds in the constant section is 3600 seconds which is 1 hour, just convert the minutes you want to seconds and put the value there thats it
-
@chrisbe Hi is this still valid?

I dont understand the custom mql code and others which are not connected to anything. What do they do and what are their functions, seems like this link is no longer valid?
-
@zentex74 Hello
It is valid anything not connected you can delete, the conditions i used to demonstrate is a simple moving average, you can replace the moving average with your own conditions -
Sorry for the late reply, thanks for your response
-
-
The code is currently unavailable.