problems with tick

 

hi, im a beginner and my problems is my ea working just fine during slow market. but when it comes to rush hour where ticks begin to move rapidly, sometimes it skipped or omit certain code. for example when

-- ( OrderClosePrice()==OrderTakeProfit() ) Alert("hit Take profit");

-- so lets say it hit the take profit, it supposed to show the Alert, but i doesnt. but again in slow market during day, it works just fine only sometimes during volatile market this glitch happened. And this is done in demo not real account. My question is, is this normal ( tick problems during volatile market) or its just my coding need improving?

 
springyard:

hi, im a beginner and my problems is my ea working just fine during slow market. but when it comes to rush hour where ticks begin to move rapidly, sometimes it skipped or omit certain code. for example when

-- ( OrderClosePrice()==OrderTakeProfit() ) Alert("hit Take profit");

-- so lets say it hit the take profit, it supposed to show the Alert, but i doesnt. but again in slow market during day, it works just fine only sometimes during volatile market this glitch happened. And this is done in demo not real account. My question is, is this normal ( tick problems during volatile market) or its just my coding need improving?

I suspect the issue is with your code, even if start() is running when the next tick arrives start() will continue and the tick will be missed . . . this is normal behaviour and will happen with ALL EAs.

You should read this thread: Can price != price ? your code will often not work even if OrderClosePrice() is equal to OrderTakeProfit()

 

if OrderClosePrice() is equal to OrderTakeProfit() then the trade will be closed

if you missed the tick with your EA then it might be the trade is allready done by setting you had given to broker

 
thank you all, very appreciate for the reply.. i will look to it. :)
 
RaptorUK:

I suspect the issue is with your code, even if start() is running when the next tick arrives start() will continue and the tick will be missed . . . this is normal behaviour and will happen with ALL EAs.

You should read this thread: Can price != price ? your code will often not work even if OrderClosePrice() is equal to OrderTakeProfit()


hi im trying to build a very simple EA just to understand how it works first.

Can you help me by giving some simple example of a code for

1. Alert when it hits take profit

2.Alert when it hits stop loss

my scenario is this:- after i execute lets say Order buy function, it sets the take profit to 20 pips and stop loss also to 20 pips.

now, i just need an example of a code to alert when it hits the take profit or stop loss. just a simple example. or maybe a variety way of writing this code i would appreciate it.

thanks :)

 
springyard:

hi im trying to build a very simple EA just to understand how it works first.

Can you help me by giving some simple example of a code for

1. Alert when it hits take profit

2.Alert when it hits stop loss

Please don't double post: https://www.mql5.com/en/forum/146010 if you continue to do so you will receive a BAN.