what does order send error 3 mean? how to correct them?

 

hello, friends, i met a problem when compiling the code below(abstracted):

it always shows there are 'order send error 3',from the error codes, i can find that error 3 means 'Invalid trade parameters',

i've check with the every parameter within OrderSend(symbol,OP_BUYSTOP,Lots_New,OpenPrice,slippage,SL,TP,"",0,MN,Green),

i cant find any wrong parameter. :(

do you know what's going on with that error? how to correct them? thanks a lot!

//-----------------------------------------------------------------------------------------------------

StopLoss=MathFloor(MathAbs((stopsell-Bid)/Point));
MN=TimeCurrent(); // Simple MagicNumber
Inform(13,Tip); // Message about an attempt to open
SL=Bid-StopLoss*Point; // StopLoss (price)
TP=Bid + TakeProfit*Point; // TakeProfit (price)
SL=StopCorrect(symbol, SL, slippage); //make sure the stoploss price is allowed
TP=TakeProfitCorrect(symbol, TP, slippage); //make sure the take profit price is allowe
OpenPrice = NormalizeDouble(vbuy, Digits);

Print(StringConcatenate
("Placing for ", symbol,
" pending BUY stop order with magic number ", MN));
Ticket=OrderSend(symbol,OP_BUYSTOP,Lots_New,OpenPrice,slippage,SL,TP,"",0,MN,Green);
if (Ticket<0) // Failed :(
{ // Check for errors:
if(Errors(GetLastError())==false)// If the error is critical,
return; // .. then leave.
}
//-------------------------------------------------------------------------------------------------------------

 

even more serious problem is, for 'OrderModify(OrderTicket(),OpenPrice,SL,TP,0,MediumVioletRed)',

i get order modify error 1, which means 'No error returned, but the result is unknown.'

what does this mean? how to correct then? thanks a lot.

 
bondtrader wrote >>

even more serious problem is, for 'OrderModify(OrderTicket(),OpenPrice,SL,TP,0,MediumVioletRed)',

i get order modify error 1, which means 'No error returned, but the result is unknown.'

what does this mean? how to correct then? thanks a lot.

not serious! system informing you that your code supplies already known order datums

you must read every word of the documents...

"If unchanged values are passed as the function parameters, the error 1 (ERR_NO_RESULT) will be generated."

 

oh, yes, but it seems to run into an endless circle in the journal, it always shows error 1, no ending, and the message time is always the time runing to ordermodify().

why is that?

 
bondtrader wrote >>

hello, friends, i met a problem when compiling the code below(abstracted):

it always shows there are 'order send error 3',from the error codes, i can find that error 3 means 'Invalid trade parameters',

i've check with the every parameter within OrderSend(symbol,OP_BUYSTOP,Lots_New,OpenPrice,slippage,SL,TP,"",0,MN,Green),

i cant find any wrong parameter. :(

do you know what's going on with that error? how to correct them? thanks a lot!

//-----------------------------------------------------------------------------------------------------

StopLoss=MathFloor(MathAbs((stopsell-Bid)/Point));
MN=TimeCurrent(); // Simple MagicNumber
Inform(13,Tip); // Message about an attempt to open
SL=Bid-StopLoss*Point; // StopLoss (price)
TP=Bid + TakeProfit*Point; // TakeProfit (price)
SL=StopCorrect(symbol, SL, slippage); //make sure the stoploss price is allowed
TP=TakeProfitCorrect(symbol, TP, slippage); //make sure the take profit price is allowe
OpenPrice = NormalizeDouble(vbuy, Digits);

Print(StringConcatenate
("Placing for ", symbol,
" pending BUY stop order with magic number ", MN));
Ticket=OrderSend(symbol,OP_BUYSTOP,Lots_New,OpenPrice,slippage,SL,TP,"",0,MN,Green);
if (Ticket<0) // Failed :(
{ // Check for errors:
if(Errors(GetLastError())==false)// If the error is critical,
return; // .. then leave.
}
//-------------------------------------------------------------------------------------------------------------

1. always use NormalizeDouble() when dealing with price data sent to Broker.

2. are you following the rules explained with many examples Order Characteristics and Rules for Making Trades

3. summary of (2) gives table of rules which must be obeyed by code Requirements and Limitations in Making Trades

4. "abstracted" code means you get back same type help. Code is not abstract. MUST have all code workings/calculations else help is not worthy of spending time...