Slippage?

 
The expert I entered for the contest is set to close all orders as soon as the profit is over 100 usd. However, it seems like there is a certain lag, so my orders are closed with much smaller profits, the last one was a loss :(. What could be the reason... slippage, server? My account: https://www.mql5.com/en/users/janklimo/

thanx
 
Dear Jan

You may close the positions by Stop loss,Take profit or if some conditions will reach.
1) You have no Stop Loss.
2)TakeProfit=Profit in pips*Cost of pip*Contract size.
So,Order 4263828: 1000points*$10*2.5=$25000
3) Let's suppose that you have some block of closing positions in your code. Look at the journals. There are no messages about requotes
or invalid prices, whatever.
So,what's conclusion ? You have a bug(bugs),sorry. If you will share your code may be somebody help you.

Good luck with no more lag
 

Thanks for your reply, digger. The logic is that whenever price moves, the total profit of all orders is calculated, I can't set fixed stop loss or take profit. If it is over $100, they are all closed. It works flawlessly at my personal computer, so I wonder what is the reason here.

 
janklimo wrote:

Thanks for your reply, digger. The logic is that whenever price moves, the total profit of all orders is calculated, I can't set fixed stop loss or take profit. If it is over $100, they are all closed. It works flawlessly at my personal computer, so I wonder what is the reason here.


In any case You have look the failures in terminal journal. If no-bugs. Try debug you code. There is new exellent debug feature in build 197-
visualization. It's really help me and I hope will usefull for you.

Regards 
Reason: