returns the execution policy. - page 7

 
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?
SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
 
Ivan_Invanov:

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

if((filling&SYMBOL_FILLING_FOK)==SYMBOL_FILLING_FOK)

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.
 
Dmitry Fedoseev:

No, they are not wrong. There is no contradiction either. There is just something you don't understand and stubbornly refuse to understand it.

No, I want to understand. Please explain it again.
 
Alexey Viktorov:

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.
Right or wrong. The cameraman is the one.
 
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.

 
Dmitry Fedoseev:

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(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);
  }
 
Ivan_Invanov:

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

 
Ivan_Invanov:

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 of SYMBOL_FILLING_FOK + SYMBOL_FILLING_IOC .

Print the SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC flags

Simply write

Print(SYMBOL_FILLING_FOK);
Print(SYMBOL_FILLING_IOC);

What you will see¿¿¿¿

 
Dmitry Fedoseev:

If SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE) returns 3, the code will return true

Thanks, I now realised I was doing the conjunction wrong.
 
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)
Reason: