- How to set Order Filling Type?
- BuyStop gives invalid filling type error
- problems with history quality and order filling type
How ? where in your code did you check ?
Also it should be like this :
I have not checked it in the code. I contacted FxPro to check what should be order filling type. They suggested IOC. For testing purpose I used SystemInfoInteger function which returns 2.
Surprisingly, this code works perfect with meta quotes demo account.
I have not checked it in the code. I contacted FxPro to check what should be order filling type. They suggested IOC. For testing purpose I used SystemInfoInteger function which returns 2.
Surprisingly, this code works perfect with meta quotes demo account.
Forum on trading, automated trading systems and testing trading strategies
fxsaber, 2017.04.09 09:37
Look at here.I have added following code in my class.
bool TradeManager::IsFillingTypeAllowed(string symbol,int fill_type) { int filling = (int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE); return((filling & fill_type)==fill_type); } void TradeManager::SetFillingType() { if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_FOK)) { fillType=ORDER_FILLING_FOK; } else if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_IOC)) { fillType=ORDER_FILLING_IOC; } else { fillType=ORDER_FILLING_RETURN; } }
This code is setting fillType to 1. By the MQL documentation, the fill type 1 is FOK and not IOC. Am I missing anything here?
How ? where in your code did you check ?
Also it should be like this :
This is the code to send order
SetFillingType(); CT.Request(trdReq); trdReq.action = TRADE_ACTION_DEAL; trdReq.magic = 9000786; trdReq.symbol = Symbol(); trdReq.volume = lotBuy; trdReq.type = ORDER_TYPE_BUY; trdReq.type_filling = fillType; string sb = Symbol(); //bool ordSendRes = OrderSend(trdReq,trdResult); bool ordSendRes = CT.Buy(lotBuy,sb);
And this is setFillingType Method
void TradeManager::SetFillingType() { if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_FOK)) { fillType=ORDER_FILLING_FOK; } else if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_IOC)) { fillType=ORDER_FILLING_IOC; } else { fillType=ORDER_FILLING_RETURN; } } bool TradeManager::IsFillingTypeAllowed(string symbol,int fill_type) { int filling = (int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE); return((filling & fill_type)==fill_type); }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use