News Alerts EA

 

Hi, i'd like to add some functionality to prevent a bot entering a trade a certain number of minutes after a big news event. In the line before a trade is placed, I have added a call to a sub routine named BigNewsAlert();

In this section, i'd like to check if any of the last 5 candles have got a range of 10+ pips (adjustable), so far I have this:

if(BigNewsAlert()){

PlaceTradeExample();

}



Bool BigNewsAlert(){

NoOfCandles = 10;

        for(int i = 0; i < NoOfCandles; i++){

//      If all (10) candles have individual ranges smaller than 10 pips (High-Low) then return true, else false.

        }

}

Please could somebody advise me what I need to put in that missing line?

As a follow up question, I have a prop firm account I am running currently with FTMO. Is there a way of checking if any news events are coming up in the next (x) number of bars on the minute chart? Would be useful to prevent my bot from entering any trades a set number of minutes before these events; even more useful if I knew how severe they are (FTMO provide a traffic light rating system on their website)? I'm sure I've seen charts with automatic new markers before. I assume this is provided by individual brokers however. Any insight would be greatly appreciated.

Thank you,

CPerry.  

 
CPerry:

Hi, i'd like to add some functionality to prevent a bot entering a trade a certain number of minutes after a big news event. In the line before a trade is placed, I have added a call to a sub routine named BigNewsAlert();

In this section, i'd like to check if any of the last 5 candles have got a range of 10+ pips (adjustable), so far I have this:

Please could somebody advise me what I need to put in that missing line?

As a follow up question, I have a prop firm account I am running currently with FTMO. Is there a way of checking if any news events are coming up in the next (x) number of bars on the minute chart? Would be useful to prevent my bot from entering any trades a set number of minutes before these events; even more useful if I knew how severe they are (FTMO provide a traffic light rating system on their website)? I'm sure I've seen charts with automatic new markers before. I assume this is provided by individual brokers however. Any insight would be greatly appreciated.

Thank you,

CPerry.  

Send the code then we can help you. We cant do anything with this piece.

Here is an edited example you can work from:

Files:
NewsTrader.mq5  34 kb
 
Thank you very much for the EA, always interesting to see how other people code. I think I have this worked out for post-news volatility. Pre-news I will work on soon so I will keep this thread open. Cheers again.