I have now checked the code. 1234==2 is false. Indeed, the numbers are being compared. What's the inscription then? And it turns out then that this function cannot return a triplet if both fok and ioc are available?
Ivan_Invanov: No, I want to understand. Please explain it again.
Everything has been explained five times. You need to start with yourself - admit that you don't understand something, not in the world someone is wrong and especially in the reference.
It's been explained five times over. You need to start with yourself - admit that you don't understand something, not in the world someone is wrong and especially in the certificate.
There may not be a mistake in the reference, but it is written in an incomprehensible way (maybe only for me). As I said, I checked the code and now the issue has fallen away. I was told in this thread that the function
SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
can return 3.
If it returns 3, then code like this won't work, right?
bool CTrade::SetTypeFillingBySymbol(conststring symbol)
{
//--- get possible filling policy types by symboluint 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);
}
There may not be an error in the help, but it is not clearly written (maybe only for me). As I said, I checked it with the code and the issue has now gone away. I was told in this thread that the function
can return 3.
If it returns 3, this code will not work, right?
If SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) returns 3, the code will return true
There may not be an error in the help, but it is not clearly written (maybe only for me). As I said, I checked it with the code and the issue has now gone away. I was told in this thread that the function
can return 3.
If it returns 3, then this kind of code won't work, right?
I'm trying to show you again what I've written on the second page of your topic
a bitwise operation can only answer the question: Can this or that fill policy be applied.
You should try to read carefully what's written. The SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) function
can return 1 which corresponds to SYMBOL_FILLING_FOK
can return 2 which corresponds to SYMBOL_FILLING_IOC
can return 3, which is the sum ofSYMBOL_FILLING_FOK + SYMBOL_FILLING_IOC.
Print the SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC flags
Thank you all for your replies. It's all sorted out. I made a mistake in logical operations, which is why the confusion arose. Thanks for messing with me)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
if 1234==2 is false, this code does not work.
bitwise check can only answer the question: Can this or that fill policy be applied?
They are bitwise operations that are not checked the way you want them to be. Exactly this line
reads like this:
If a variable (if it is shifted by SYMBOL_FILLING_FOK bit) equals SYMBOL_FILLING_FOK
If I'm self-taught, I'll be corrected by someone more experienced.No, they are not wrong. There is no contradiction either. There is just something you don't understand and stubbornly refuse to understand it.
These are bitwise operations and they're not as validated as you might think. Specifically, a line like this
reads like this:
If a variable (filled by SYMBOL_FILLING_FOK bit) is equal to SYMBOL_FILLING_FOK
If I'm self-taught, I'll be corrected by someone more experienced.No, I want to understand. Please explain it again.
Everything has been explained five times. You need to start with yourself - admit that you don't understand something, not in the world someone is wrong and especially in the reference.
It's been explained five times over. You need to start with yourself - admit that you don't understand something, not in the world someone is wrong and especially in the certificate.
There may not be a mistake in the reference, but it is written in an incomprehensible way (maybe only for me). As I said, I checked the code and now the issue has fallen away. I was told in this thread that the function
can return 3.
If it returns 3, then code like this won't work, right?
There may not be an error in the help, but it is not clearly written (maybe only for me). As I said, I checked it with the code and the issue has now gone away. I was told in this thread that the function
can return 3.
If it returns 3, this code will not work, right?
If SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) returns 3, the code will return true
There may not be an error in the help, but it is not clearly written (maybe only for me). As I said, I checked it with the code and the issue has now gone away. I was told in this thread that the function
can return 3.
If it returns 3, then this kind of code won't work, right?
I'm trying to show you again what I've written on the second page of your topic
a bitwise operation can only answer the question: Can this or that fill policy be applied.
You should try to read carefully what's written. The SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) function
Print the SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC flags
Simply write
What you will see¿¿¿¿
If SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) returns 3, the code will return true