Anybody know why the error appear?? - page 2

 
buju:

try setting your SL to 3


mt4 has many bugs and brokers mod mt4 and then things dont work so well .....


Why 3? the error still persist. Yes the MT4 seems still having some bugs.


Roger:

It's because my broker has 5 digits and I didn't correct it for printing, oops.


I see

 
damn!! I hate to admit, the problem is on my side. It's a bit long to tell, but thanks for all of the responds, and sorry for metaquotes.
 
Alert(OrderOpenPrice(),"   ",StopLoss,"   ",Point,"   ",OrderOpenPrice()-StopLoss*Point);

Log file:

01:03:51 2009.10.05 12:00  EA GBPUSD,H1: Alert: 1.5954   30   0.0001   1.5984
On a 5 digit broker, your log file is misleading. Alert only prints to 4 digits. Always use
DoubleToStr(OrderOpenPrice()-StopLoss*Point,Digits)

Your second problem is that TIME can change values and send order takes time. Since there is no return/new Start() between the send and modify, you must add a refresh.

Your third problem is your trying to set your stop lost to 3.0 pips (30points) from the open price.

	// A pending order price can be no closer to the current price, than this
	// amount.	On IBFX it's equal to 30 (3.0 pips.) A TP or SL, can be no
	// closer to the order price (open, limit, or stop) or closing price (filled
	// order) than this amount.
	double	minGap.stops	= MarketInfo( Symbol(), MODE_STOPLEVEL )*Point;

	// If the current price is closer than this to the TP, SL, (or pending
	// price,) then the existing order can not be modified, closed, or deleted.
	// On IBFX it's equal to zero (in tester,) but I still can't change it if
	// it's closer than minGap.stops
	double	minGap.change	= MathMax( minGap.stops
							, MarketInfo( Symbol(), MODE_FREEZELEVEL )*Point );

You are stopped because once the order is open Bid is 1 pip (10points) away from from your stop (assuming spread is 2 pips.) and that is closer than minGap.change and minGap.stops. You can not modify the order at all if bid is closer then minGap.change to any of your stops. and you can not modify any stop closer to Bid than minGap.stops

Reason: