why invalid price,please help me

 

i print the Ask(),Bid() in the ticks,but sell stop is invalid.

for examp: Ask:2920.69 -- Bid:2920.63 ,i send the sell stop in 2920.54, is invalid price,

Would you mind tell me the reason?
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
  • www.mql5.com
All requests to execute trade operations are sent as a structure of a trade request MqlTradeRequest using function OrderSend() . The function...
 
c327515:

i print the Ask(),Bid() in the ticks,but sell stop is invalid.

for examp: Ask:2920.69 -- Bid:2920.63 ,i send the sell stop in 2920.54, is invalid price,

Would you mind tell me the reason?

did you ask your broker? they are ALWAYS your first point of contact. They are paid to give you support. We are just regular users of mt4/5 like you.

Check your symbols information. stop/pending orders require a certain distance from the live price. Find specification named STOPS LEVEL. This will usually say how many points away from the live price that you have to request for your stop trade to open.

If this says 0, then it is "floating". You will have to ask your broker for what this is. 0 means that it changes from minute to minute. I had a broker that I had to put my pending orders 75 points from current price to stop getting those errors.

 
c327515:

i print the Ask(),Bid() in the ticks,but sell stop is invalid.

for examp: Ask:2920.69 -- Bid:2920.63 ,i send the sell stop in 2920.54, is invalid price,

Would you mind tell me the reason?

Do you? I would check the digits and see if the value doesn´t have plenty of digits after the ".54"

 
c327515:

i print the Ask(),Bid() in the ticks,but sell stop is invalid.

for examp: Ask:2920.69 -- Bid:2920.63 ,i send the sell stop in 2920.54, is invalid price,

Would you mind tell me the reason?

you have to check the minimum distance allowed from current price for limit orders 

double minimum_allowed=_Point*((int)SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL));