If the compiler doesn't complain - no difference.
Not really important, just the 'true' seems to be a 1-byte boolean constant, while TRUE and True are 4-byte integer constants of value 1.
(Massively pedantic answer...
Yes, it's MT4 inheriting from Windows, which in turn is reflecting the historic differences between C and C++. C has - strictly, had - no boolean data type and no "true" constant. Therefore, the Windows API fills the gap by defining a BOOL, which is simply "typedef int BOOL", and by defining the constant TRUE, which is simply "#define TRUE 1". C++ does have a bool data type, and does have a "true" constant. MQL4 inherits these two separate things. This has been tidied up in MQL5, which only has "true", and doesn't have "TRUE" or "True".)
(Massively pedantic answer...
Yes, it's MT4 inheriting from Windows, which in turn is reflecting the historic differences between C and C++. C has - strictly, had - no boolean data type and no "true" constant. Therefore, the Windows API fills the gap by defining a BOOL, which is simply "typedef int BOOL", and by defining the constant TRUE, which is simply "#define TRUE 1". C++ does have a bool data type, and does have a "true" constant. MQL4 inherits these two separate things. This has been tidied up in MQL5, which only has "true", and doesn't have "TRUE" or "True".)
MQL4 is loosely based on C++ which has always had a bool type.
ANSI C did not have a bool until 1999. The current ANSI standard is C11 (2011)
Many compilers did not implement all the C99 features and so C90 may still be the most portable version
https://stackoverflow.com/questions/1608318/is-bool-a-native-c-type
- stackoverflow.com
ANSI C did not have a bool until 1999. The current ANSI standard is C11 (2011)
Yes, that is indeed what I meant by "C has - strictly, had - no boolean data type". From Windows's point of view, C doesn't have a bool because the core of the Windows API predates 1999.
Yes, that is indeed what I meant by "C has - strictly, had - no boolean data type". From Windows's point of view, C doesn't have a bool because the core of the Windows API predates 1999.
Seems like Microsoft finally implemented the bool type in their C compiler with the release of Visual Studio 2013...
https://msdn.microsoft.com/en-us/library/hh409293(v=vs.120).aspx
Seems like Microsoft finally implemented the bool type in their C compiler with the release of Visual Studio 2013...
Windows API obviously continues to use its own definition of BOOL; too late to change that.
Digressing almost completely, my favourite Windows->MQL4 legacy is one I've mentioned a couple of times before on this forum...
Question: why isn't is possible for an indicator or a line object in MT4 to be dashed, dotted etc if it is more than 1 pixel wide? Answer: it's almost certainly inheriting the limitations of the Windows CreatePen() function. That dates back at least to 1995, and may well derive from Windows 3, or even beyond - I can no longer remember.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Советник Sector открывает сделки по встроенному в него индикатору Trend Strength, он, также как и индикатор, работает с тиковой историей. Фильтрами, позволяющими сократить количество убыточных сделок, служат показания встроенного индикатора.
Советник Sector отслеживает тиковую историю и определяет по ней кратковременные "взрывные" трендовые движения, в сторону которых в последующем идет тренд. Sector использует два типа входа в рынок:
Особенности советника Sector
Входные параметры
Параметры перенесенные из индикатора Trend Strength:
Добавлен параметр Length of history определяющий интервал в минутах для отслеживания тиковой истории.
Параметр Min. numbers of the trend отражает минимальное абсолютное значение силы тренда, при котором может быть открыта сделка.
Торговые параметры: StopLoss, TakeProfit, Lot, Slippage, Magic. Параметры: StopLoss 2, TakeProfit 2, Magic 2 - открытых по входу 2.
Параметры TradeMon и TradeFr определяют торговлю по понедельникам и пятницам.
Советник Sector может сопровождать открытые сделки Trailing Stop (TS), параметры TS:
На рынке возможны ситуации, когда возникает сигнал на покупку или продажу в то время, как открыта противоположная сигналу позиция. Параметр Signal Inverted определяет действие советника в такой ситуации:
На таймфреймах H4 и D1 эффективно повторно открывать позицию на следующем баре, советник открывает такие позиции при соблюдении следующих условий: