Help with Scalping EA entry filters

 

Hello, 

I have written a scalping EA, however I am new to mql5 programming and not 100% on how to implement the following.

I would like to add a time filter, thought this would be simple but everything i've tried for this still opens some trades outside of the hours I set.

I would also like to add a filter for price spikes. I would like to be able to prevent a trade being entered if the entry price is for example 50 pips from the opening price of the current bar. Again everything I've tried over the last couple of weeks doesnt seem to work as expected. still learning and looking for some help on this, which should help me improve.

If my coding is a mess or if i could achieve what i've written with more efficient code. please point this out. can only learn from it. 

Many thanks Jack

Files:
 
jack3394:

Hello, 

I have written a scalping EA, however I am new to mql5 programming and not 100% on how to implement the following.

I would like to add a time filter, thought this would be simple but everything i've tried for this still opens some trades outside of the hours I set.

I would also like to add a filter for price spikes. I would like to be able to prevent a trade being entered if the entry price is for example 50 pips from the opening price of the current bar. Again everything I've tried over the last couple of weeks doesnt seem to work as expected. still learning and looking for some help on this, which should help me improve.

If my coding is a mess or if i could achieve what i've written with more efficient code. please point this out. can only learn from it. 

Many thanks Jack

If you go to René Balkes channel, where the original code is from, and search the videos he made. You can find how to do all the above and more! I hope that helped you somewhat.