Does the code you post work for val=-0.1? This will be an ORDER_TYPE_SELL, which correctly needs the bid price for entry price.
val=0.1 (ORDER_TYPE_BUY) will require
Request.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
Also, I think Request.deviation should be set to 50 to allow adequate slippage with a 5 digit broker
Paul
- 2012.06.14
- Paul
- paulsfxrandomwalk.blogspot.com
Does the code you post work for val=-0.1? This will be an ORDER_TYPE_SELL, which correctly needs the bid price for entry price.
val=0.1 (ORDER_TYPE_BUY) will require
Also, I think Request.deviation should be set to 50 to allow adequate slippage with a 5 digit broker
Paul
Hi Paul,
Thank you for bid/ask advice. I tried to recompile your FraMa cross EA V1_2 (I only changed LOG to Print) and I get the same error code:
2010.02.08 10:58:05 FraMa cross EA V1_2 (EURUSD,H1) Problem with OrderSend in AdjustPosition(): Unknown retcode 10027 in RetCodeToStr()
My MT5 build number is 244. Can you confirm this EA works properly on the latest build for you?
Hi Paul,
Thank you for bid/ask advice. I tried to recompile your FraMa cross EA V1_2 (I only changed LOG to Print) and I get the same error code:
2010.02.08 10:58:05 FraMa cross EA V1_2 (EURUSD,H1) Problem with OrderSend in AdjustPosition(): Unknown retcode 10027 in RetCodeToStr()
My MT5 build number is 244. Can you confirm this EA works properly on the latest build for you?
Yes, just tried it on build 244 and it successfully issued a buy and sell order in a few minutes on an M1 chart. I wouldn't write it in quite the same way now, because the behaviour of OrderSend has changed.
Metaquotes seems very quiet about retcode 10027, which isn't listed.
Paul
Solved.
was overwritten by
I had first and second option under 'Allow AutoTrading' enabled.
I found the meaning of 10027 by displaying MqlTradeResult.comment
2010.02.08 22:37:53 PlaceOrderTest (EURUSD,M1) 10027 AutoTrading disabled by client
Strange that MetaQuotes remained silent.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I cannot place a correct order using my function and the server returns a code not defined in
https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes
2010.02.04 09:38:45 CheckSymbolInfo (EURUSD,H1) PlaceMarketOrder() return code: 10027
2010.02.04 09:38:45 CheckSymbolInfo (EURUSD,H1) OrderSend failure.What does this 100027 code mean and could you help to figure out what is wrong with my code?
value passed to PlaceMarketOrder is 0.1 or -0.1