ENUM_ORDER_TYPE order_type = ORDER_TYPE_BUY;
This one is not in your request.
That's right, but it doesn't change anything. Just tried...
Well you can look at the examples.
All the way below https://www.mql5.com/en/docs/constants/structures/mqltraderequest

- www.mql5.com
I've acted exactly by the book:
//--- declare and initialize the trade request and result of trade request MqlTradeRequest request={0}; MqlTradeResult result={0}; //--- parameters of request request.action =TRADE_ACTION_DEAL; // type of trade operation request.symbol =Symbol(); // symbol request.volume =0.1; // volume of 0.1 lot request.type =ORDER_TYPE_BUY; // order type request.price =SymbolInfoDouble(Symbol(),SYMBOL_ASK); // price for opening request.deviation=5; // allowed deviation from the price request.magic =EXPERT_MAGIC; // MagicNumber of the order //--- send the request if(!OrderSend(request,result)) PrintFormat("OrderSend error %d",GetLastError()); // if unable to send the request, output the error code //--- information about the operation PrintFormat("retcode=%u deal=%I64u order=%I64u",result.retcode,result.deal,result.order);
... The same result :( ...
the Tester answers: "failed market buy 0.10 EURUSD [Unsupported filling mode]"

- www.mql5.com
I've acted exactly by the book:
... The same result :( ...
the Tester answers: "failed market buy 0.10 EURUSD [Unsupported filling mode]"
Are you saying that a textbook example isn't working?
Exactly! It isn't.
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Особенности языка mql5, тонкости и приёмы работы
fxsaber, 2017.07.11 10:50
// The EA returns fully-formed trading requests (including manual) #define TOSTRING(A) #A + " = " + (string)(A) + "\n" #define TOSTRING2(A) #A + " = " + EnumToString(A) + " (" + (string)(A) + ")\n" string ToString( const MqlTradeRequest &Request ) { return(TOSTRING2(Request.action) + TOSTRING(Request.magic) + TOSTRING(Request.order) + TOSTRING(Request.symbol) + TOSTRING(Request.volume) + TOSTRING(Request.price) + TOSTRING(Request.stoplimit) + TOSTRING(Request.sl) + TOSTRING(Request.tp) + TOSTRING(Request.deviation) + TOSTRING2(Request.type) + TOSTRING2(Request.type_filling) + TOSTRING2(Request.type_time) + TOSTRING(Request.expiration) + TOSTRING(Request.comment) + TOSTRING(Request.position) + TOSTRING(Request.position_by)); } void OnTradeTransaction( const MqlTradeTransaction&, const MqlTradeRequest& Request, const MqlTradeResult& ) { if (Request.action) Print(ToString(Request)); }
If there is a problem with the same Filling, run this Expert Advisor and create the order you need manually (F9 in the terminal). The generated sales request will be printed by the EA.
Select "Buy by Market". Result:
Request.action = TRADE_ACTION_DEAL (1) Request.magic = 0 Request.order = 1254116 Request.symbol = BTCUSD Request.volume = 1.0 Request.price = 0.0 Request.stoplimit = 0.0 Request.sl = 0.0 Request.tp = 0.0 Request.deviation = 0 Request.type = ORDER_TYPE_BUY (0) Request.type_filling = ORDER_FILLING_IOC (1) Request.type_time = ORDER_TIME_GTC (0) Request.expiration = 1970.01.01 00:00:00 Request.comment = Request.position = 0 Request.position_by = 0Try to do the same on your account.
I've installed MT4. The same code is working on it comprehensively (w/o 100030). Thanks.

- 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 know that this topic has been discussed more than hundred of times.
But still...
The code is following:
It always returns "Unsupported filling mode" in spite of my attempt to set an appropriate filling type.
I've read many topics before ask.
I'd appreciate any help.