look at my code,why report 0 zero,but on test there was no trade order?
- if it is interesting for them personally, or
- if it is interesting for many members of this forum.
Freelance section of the forum should be used in most of the cases.
- 2024.10.29
- www.mql5.com
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Hi
Check the logs while you test the EA there are messages which tell you what the error is here. In your case it’s unsupported filling mode for the lot size which you need to define in the order request.
You can use something like this:
request.type_filling = GetFilling(Symbol()); … ENUM_ORDER_TYPE_FILLING GetFilling( const string Symb, const uint Type = ORDER_FILLING_FOK ) { const ENUM_SYMBOL_TRADE_EXECUTION ExeMode = (ENUM_SYMBOL_TRADE_EXECUTION)::SymbolInfoInteger(Symb, SYMBOL_TRADE_EXEMODE); const int FillingMode = (int)::SymbolInfoInteger(Symb, SYMBOL_FILLING_MODE); return((FillingMode == 0 || (Type >= ORDER_FILLING_RETURN) || ((FillingMode & (Type + 1)) != Type + 1)) ? (((ExeMode == SYMBOL_TRADE_EXECUTION_EXCHANGE) || (ExeMode == SYMBOL_TRADE_EXECUTION_INSTANT)) ? ORDER_FILLING_RETURN : ((FillingMode == SYMBOL_FILLING_IOC) ? ORDER_FILLING_IOC : ORDER_FILLING_FOK)) : (ENUM_ORDER_TYPE_FILLING)Type); }
that I do not recommend printing out all those messages in the OnTick function, those are printed every tick and then you cannot see the important messages with errors print those logs only when something new is happening, when you send order request or modify trades, detect a signal not on every tick.
Have a nice day👍📊