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
Yes.
@fxsaber, does it mean, that different brokers may have different ORDER_FILLING_* policies? Hard to understand. But as I said: I am new here ;)
Correct, see https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties#enum_order_type_filling
It depends on the broker which are supported. Can be 1 or more.
@fxsaber, does it mean, that different brokers may have different ORDER_FILLING_* policies? Hard to understand. But as I said: I am new here ;)
It's normal. It depends of the account type, the execution type (market/instant), the order type too (pending or market)...
It's normal. It depends of the account type, the execution type (market/instant), the order type too (pending or market)...
First of all: thanks to all.
@Alain Verleyen, ah, OK. But back to the initial question of this thread. I always assumed, that me, the customer (the trader in this case the EA) decides, how (! which fulfilling policy should be used !) the order has to be placed into market, e.g.
I (resp. the EA) want to decide, if I will sell to the specified amount of order size or not...
Or do I understand something completely wrong? Please see https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties
I (resp. the EA) want to decide, if I will sell to the specified amount of order size or not...
Or do I understand something completely wrong? Please see https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties
I know it seems quite confusing at first, but maybe a simple analogy might help here. Please don't take any disrespect with this, as I am not trying to dumb it down, just that other users may read the thread too and the analogy might be helpful.
Consider that you are going to a restaurant and when you sit down, they give you a "Menu". On this menu is listed what dishes are available (the broker informs you of what filling modes are available), and then you the customer proceed to choose which dish you want to consume (i.e. of the available filling modes, you choose the one you want to apply). However, the Restaurant can give you different "Menus", depending on where you sit (different symbols), so that dishes can be different.
The same applies here, so you should first use the "SymbolInfoInteger( ... , SYMBOL_FILLING_MODE )" to first obtain information about which filling modes are allowed for a particular symbol (which can be different among Symbols or Accounts or Brokers, etc.)
Once you have the list of available Filling modes, you can then decide which filling mode you want to use in the trade, or if you only want to use a particular Filling mode, you can check to see if it is allowed or not.
Now you can proceed with the order placement, with the appropriate filling mode or not at all if it is not available!
PS! Also remember to consider the following (from the Filling Modes documentation):
EDIT: One more thing, based on experience and not from the documentation. I have had the "displeasure" of cases of where what is reported as allowed for filling mode does not correspond with reality. Where the function confirms that filling mode "A" is allowed, but when I try to us it, it is rejected. So for these cases, I decided to add an input to the EA, where the user can override the selection of the filling mode to the one that is allowed in practice irrespective of what the Symbol Information is reporting. I know this adds to the confusion, but it is a possibility.I know it seems quite confusing at first, but maybe a simple analogy might help here. Please don't take any disrespect with this, as I am not trying to dumb it down, just that other users may read the thread too and the analogy might be helpful.
Consider that you are going to a restaurant and when you sit down, they give you a "Menu". On this menu is listed what dishes are available (the broker informs you of what filling modes are available), and then you the customer proceed to choose which dish you want to consume (i.e. of the available filling modes, you choose the one you want to apply). However, the Restaurant can give you different "Menus", depending on where you sit (different symbols), so that dishes can be different.
The same applies here, so you should first use the "SymbolInfoInteger( ... , SYMBOL_FILLING_MODE )" to first obtain information about which filling modes are allowed for a particular symbol (which can be different among Symbols or Accounts or Brokers, etc.)
Once you have the list of available Filling modes, you can then decide which filling mode you want to use in the trade, or if you only want to use a particular Filling mode, you can check to see if it is allowed or not.
Now you can proceed with the order placement, with the appropriate filling mode or not at all if it is not available!
PS! Also remember to consider the following (from the Filling Modes documentation):
EDIT: One more thing, based on experience and not from the documentation. I have had the "displeasure" of cases of where what is reported as allowed for filling mode does not correspond with reality. Where the function confirms that filling mode "A" is allowed, but when I try to us it, it is rejected. So for these cases, I decided to add an input to the EA, where the user can override the selection of the filling mode to the one that is allowed in practice irrespective of what the Symbol Information is reporting. I know this adds to the confusion, but it is a possibility.
Very helpful analogy, thank you. The situation that you mentioned in your EDIT is happening to me right now with a Demo Account at BDSwiss and with the Symbol EURUSD. It outputs "2" but when I set mrequest.type_filling to that number it still fails. I already tried ORDER_FILLING_FOK, ORDER_FILLING_IOC and ORDER_FILLING_RETURN. Nothing worked so far. Do you have any ideas how to approach that behaviour?
Very helpful analogy, thank you. The situation that you mentioned in your EDIT is happening to me right now with a Demo Account at BDSwiss and with the Symbol EURUSD. It outputs "2" but when I set mrequest.type_filling to that number it still fails. I already tried ORDER_FILLING_FOK, ORDER_FILLING_IOC and ORDER_FILLING_RETURN. Nothing worked so far. Do you have any ideas how to approach that behaviour?
I'm stuck in the same situation. I'm trying to close a position from the Python API. Whatever filling mode I use I always get the same error:
2020.12.14 21:12:31.759 Trades '######': failed market buy 0.01 CHFJPY, close #109459760 sell 0.01 CHFJPY 116.807 [Unsupported filling mode]
The account is a live account, no demo.
Did anybody find a solution for this?
I am trying to create a seriously basic buy script (so I can use hotkeys) I am on OANDA Japan.
I copied the first script directly from here:
https://www.mql5.com/en/docs/constants/structures/mqltraderequest
Example of the TRADE_ACTION_DEAL trade operation for opening a Buy position:
10030
TRADE_RETCODE_INVALID_FILL
Invalid order filling type
So I tried all 3 different types of fill mode, all fail the same way, and then I checked the fill mode and use it exactly, still the same error - what gives.
Very helpful analogy, thank you. The situation that you mentioned in your EDIT is happening to me right now with a Demo Account at BDSwiss and with the Symbol EURUSD. It outputs "2" but when I set mrequest.type_filling to that number it still fails. I already tried ORDER_FILLING_FOK, ORDER_FILLING_IOC and ORDER_FILLING_RETURN. Nothing worked so far. Do you have any ideas how to approach that behaviour?
I wonder if this could be a mistake in the documentation.
When it outputs 2 it is really FoK. 1 is IoC and 0 Return. I would need to check various brokers to see if this is consistent.
EDIT: What I mean to say is that if it outputs 2, you need to set it to 1.