Errors, bugs, questions - page 2333

 
Vladimir Pastushak:

bool file_exists=(bool)FileGetInteger(FileName,FILE_EXISTS);

In any case it returns true if there is file or not, and error 5019 if there is no file. According to help, it should return false if there is no file.

bool file_exists=FileIsExist(FileName); Works correctly

Please decide which variant of the function you want to use - https://www.mql5.com/ru/docs/files/filegetinteger


Документация по MQL5: Файловые операции / FileGetInteger
Документация по MQL5: Файловые операции / FileGetInteger
  • www.mql5.com
[in]  Идентификатор свойства файла. Значение может быть одним из значений перечисления ENUM_FILE_PROPERTY_INTEGER. Если используется второй вариант функции, то можно получать значения только следующих свойств: [in]  Указывает на местоположение файла. Если параметр равен false, то просматривается каталог данных терминала, в противном случае...
 
fxsaber:

I would be comfortable if a macro is mentioned at least once somewhere in #define, #ifdef, #undef, etc. Even if it is not defined.

This is because you have many identifiers in capital letters, whereas there is an unspoken rule that capital letters are reserved for macros (macro highlighting not in colour but in font)

 
A100:

This is because you have many identifiers in capital letters, while there is an unspoken rule that capital letters are reserved for macros (macro highlighting not in colour but in font)

No. Convenient because the logic is unambiguous.

 
fxsaber:

No. Convenient because the logic is unambiguous.

My logic is simple: X before #define X is not yet a macro, and after #undef X it is no longer a macro (respectively X is colored only where it is a macro)
 
A100:
My logic is simple: X before #define X is not yet a macro and after #undef X is no longer a macro (respectively X is highlighted only where it is a macro)

I use mqh, which has no #define, but does have #ifdef. Why they should not be highlighted is not clear.

 
fxsaber:

I've never tried to determine by colour. Moreover, if everything is in #ifdef, MQL4 and MQL5 may have different subcolours. The easiest way is to do ALT+G on macro name to see if it's there or not.

#define  PRICEST_TICK_PRICE //(1)
//...
#undef   PRICEST_TICK_PRICE //(2)
//...
void OnStart()
{
        int PRICEST_TICK_PRICE; //(3)
}

When in line (3) I press ALT+G -> move to line (1).

Question: is the macro there or not?

 
A100:

When in line (3), I press ALT+G to go to line (1).

Question: is the macro there or not?

I don't understand your moaning, to put it mildly. I know how to work with macros. I am well aware of what ALT+G means and how a macro can be undone via #undef. I like this particular editor's behaviour.

Nerdiness is sometimes good, but not in this case.

 
fxsaber:

I use mqh, which has no #define, but does have #ifdef. Why they should not be highlighted is not clear.

If earlier there is no #define X, then X in #ifdef X - is not highlighted (*) because - here everything is normal (at least in MetaEditor)

I have only one question to the Developers: why in MetaEditor X is highlighted in #define X, if earlier there was no #define X, while it happens above in (*)

Your question was the opposite: why is X not highlighted on the site

 

Which symbol property is responsible for prohibiting an SL/TP open position?


 
fxsaber:

Which symbol property is responsible for prohibiting an SL/TP open position?


Probably Market or Instant execution

Reason: