I am very new to MQL5 language - why above code give me Error 10030?
Please help
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.
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.
I am very new to MQL5 language - why above code give me Error 10030?
Please help