manage trade bug - page 2

 
SanMiguel:

Yes, but the spread is supposed to be included in target profits and stops automatically on MT4.

So, when MT4 says I am 20 pips in profit, the code above should move the stop to breakeven shouldn't it?

I think the problem is that price moves randomly and bid/ask gets few pips above the breakeven within a single tick.

 
robofx.org:

I think the problem is that price moves randomly and bid/ask gets few pips above the breakeven within a single tick.

No, it is going well past 20pips and it doesn't move to breakeven.

Besides,1 tick should fire the code.

So, there is nothing wrong with the code? Could it be on BUY (Ask) targets that it doesn't fire the code?

Is the spread built in? I thought that all BUYs had to have the spread added?