Anton Wibowo:
Error 10030 (TRADE_RETCODE_INVALID_FILL) in MQL5 means "unsupported filling type." This usually happens when you specify a type_filling (like ORDER_FILLING_FOK) that the broker or symbol does not support.I am very new to MQL5 language - why above code give me Error 10030?
Please help
You need to dynamically get the allowed filling modes for the current symbol and use one of them.
Bosco Antonio Vega #:
Error 10030 (TRADE_RETCODE_INVALID_FILL) in MQL5 means "unsupported filling type." This usually happens when you specify a type_filling (like ORDER_FILLING_FOK) that the broker or symbol does not support.
Error 10030 (TRADE_RETCODE_INVALID_FILL) in MQL5 means "unsupported filling type." This usually happens when you specify a type_filling (like ORDER_FILLING_FOK) that the broker or symbol does not support.
You need to dynamically get the allowed filling modes for the current symbol and use one of them.
Please example code
bool makePosition(orderType type){ ZeroMemory(request); request.symbol=_Symbol; request.volume=volume; request.action=TRADE_ACTION_DEAL; request.type_filling=ORDER_FILLING_FOK; double price=0;
The code above already specify ORDER_FILLING_FOK statement
Why still error?
That is the same as your original posted code - Likely your broker doesn't support ORDER_FILLING_FOK so your code needs to dynamically work out which filling mode it supports.
You could try hard-coding it to ORDER_FILLING_IOC - it might work. But not a good fix because if you change broker it could stop working again.
I don't have a code example of how to assign it dynamically, but if you do the search that I suggested, you'll likely find something.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am very new to MQL5 language - why above code give me Error 10030?
Please help