returns the execution policy.
returned values
iok is 2
fok is 1
gtc is 0
Is this correct? Can't there be two policies available?
There can be one and two ...
//+------------------------------------------------------------------+ //| проверяет разрешенность указанного режима заполнения | //+------------------------------------------------------------------+ bool IsFillingTypeAllowed(string symbol,int fill_type) { //--- получим значение свойства, описывающего режим заполнения int filling=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE); //--- вернем true, если режим fill_type разрешен return((filling&fill_type)==fill_type); }

- www.mql5.com
a bit check is needed. for example:
ENUM_ORDER_TYPE_FILLING OrderTypeFilling(const string symbol) { int FillingFlags = (int)SymbolInfoInteger(symbol, SYMBOL_FILLING_MODE); if((FillingFlags & SYMBOL_FILLING_FOK) == SYMBOL_FILLING_FOK) return ORDER_FILLING_FOK; else if((FillingFlags & SYMBOL_FILLING_IOC) == SYMBOL_FILLING_IOC) return ORDER_FILLING_IOC; else return ORDER_FILLING_RETURN; }
if(x>0.0) break; if(x<0.0) y++;
Why is this not the same as return. Return will return control to the calling program, which proceeds to the next operator. Break forces a transition to the next operator. Can the calling program ignore the next operator?
Thank you. Can you also explain why break is sometimes written in if statement, example from official advisor.
Why is this not the same as return. Return will return control to the calling program, which proceeds to the next statement. break forces the program to go to the next operator. Can the calling program ignore the next operator?
Give me a link to the documentation where this
if(x>0.0) break; if(x<0.0) y++;
example ...
This is from Moving Average v1.00 2009-2017 .It's an example in the mt5 terminal. Line 64.
1. Don't try to take the code out of context.
2. Read the End Break Operator Help carefully.
3. Only after you have completed tasks 1 and 2 can you continue to ask questions.

- www.mql5.com
1. Don't try to take the code out of context.
2. Read the End Break Operator Help carefully.
3. Only after you have completed tasks 1 and 2 can you continue to ask questions.
I don't understand, you're saying it could be one or two. There is only one variable in the function. Can you tell me with an example.
iok is 2
fok is 1
gtc is 0
what then returns if ioc and fok
I don't understand, you are saying that there can be one or two. There is only one variable in the function. Can you tell me with an example.
Example from CTrade trade class. First it is checked for'SYMBOL_FILLING_FOK', then for'SYMBOL_FILLING_IOC'.
//+------------------------------------------------------------------+ //| Set order filling type according to symbol filling mode | //+------------------------------------------------------------------+ bool CTrade::SetTypeFillingBySymbol(const string symbol) { //--- get possible filling policy types by symbol uint filling=(uint)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE); if((filling&SYMBOL_FILLING_FOK)==SYMBOL_FILLING_FOK) { m_type_filling=ORDER_FILLING_FOK; return(true); } if((filling&SYMBOL_FILLING_IOC)==SYMBOL_FILLING_IOC) { m_type_filling=ORDER_FILLING_IOC; return(true); } //--- return(false); }
The check is performed by usingthe 'AND bitwise operation'.
Bitwise AND operation
The bitwise AND operation of the binary representations x and y. The value of the expression contains 1 (TRUE) in all bits where both x and y contain non-zero; and 0 (FALSE) in all other bits.
b = ((x & y) != 0);
Example:
char a='a',b='b'; //--- операция И char c=a&b; Print("a = ",a," b = ",b); Print("a & b = ",c); // Результат будет такой: // a = 97 b = 98 // a & b = 96
More about bitwise operations.

- www.mql5.com

- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
iok is 2
fok is 1
gtc is 0
Is this correct? Can't there be two policies available?