News Filter coding:)

 

Hi all,

Im looking for a newsfilter i can find some news filter but it doesn't work,i want to work with like example forexfactory.

I'm looking for newsfilter that dont trade when badnews is coming for ...min. Im not a coder so can you explain it how it works and what i need to do? in easy language:)

Big tnx for helping:)

 
mart87:
Hi all,

Im looking for a newsfilter i can find some news filter but it doesn't work,i want to work with like example forexfactory.

I'm looking for newsfilter that dont trade when badnews is coming for ...min. Im not a coder so can you explain it how it works and what i need to do? in easy language:)

Big tnx for helping:)

mart87

If you are looking for a way hot to know when some news are going to happen, best that you see some indicators that already do that. One that does tat in a simple (and non CPU intensive) way is posted here : https://www.mql5.com/en/forum/177102/page20

Also on that thread (this one : https://www.mql5.com/en/forum/177102) you can find some more indicators and EAs that can do that, but there is no simple way to explain it how it is done. The best is to download the code and see for yourself how various people did that

 

im looking for something like this:

rivate DateTime beforeNews;

private DateTime afterNews;

....

protected override void OnBarUpdate()

.....

beforeNews = ToTime(news);

beforeNews = beforeNews.AddMinutes(-10); // decrease by 10m

afterNews = ToTime(news);

afterNews = afterNews.AddMinutes(10); // increase by 10m

if (ToTime(Time[0]) beforeNews)

 
mart87:
im looking for something like this:

rivate DateTime beforeNews;

private DateTime afterNews;

....

protected override void OnBarUpdate()

.....

beforeNews = ToTime(news);

beforeNews = beforeNews.AddMinutes(-10); // decrease by 10m

afterNews = ToTime(news);

afterNews = afterNews.AddMinutes(10); // increase by 10m

if (ToTime(Time[0]) beforeNews)

There is an indicator on the last post here https://www.mql5.com/en/forum/175881 it will alert you minutes before and after the news.Maybe the code in there will help.

 

Thats the problem im not arround 24 hours, so when there is bad news it would be nice that the ea will stop trading (new trade's) i will lower the risk

for a account blow up

 
mart87:
Thats the problem im not arround 24 hours, so when there is bad news it would be nice that the ea will stop trading (new trade's) i will lower the risk for a account blow up

mart87

In those indicators you have all the code necessary to retrieve and use news events. As I said already, it is not as simple as you would probably wish so you will have to take some time to study the code of those to see how it is and can be done.

 

tnx for helping anyway:) I have seen you are a good programmer is see you have made forex tsd news reader:)

Can you maybe make a avoid news indicator for mine ea?

 
mart87:
tnx for helping anyway:) I have seen you are a good programmer is see you have made forex tsd news reader:) Can you maybe make a avoid news indicator for mine ea?

mart87

Even though I do not understand the post completely, I am assuming that you are asking if a simple function that does what you need can be made. If that is the question, the answer is that all you need to do such a a thing is in the indicator itself : acquiring the calendar (to know when the news are going to happen) as well as a procedure that checks if the news is about to happen or it passed some desired time ago. So, all the code is there already. All you need to do is to extract it

regards

Reason: