You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
My test: the by_val works much faster than the by_ref.
Can you try by ref with const in by_ref?
My test: the by_val works much faster than the by_ref.
Same here, which is why I don't use refs unless I need them.... It's not even about the speed it just makes passing args a pain in the !@#.
You missed the float FLT_MAX
You're absolutely right! Thanks!
I forgot it was even a type in MQL... 😜 Honestly though, I don't recall ever actually seeing it used in an MQL program.
Passing by reference copies the reference to the stack - and adds some more indirect stuff.
Same here, which is why I don't use refs unless I need them.... It's not even about the speed it just makes passing args a pain in the !@#.
You're absolutely right! Thanks!
I forgot it was even a type in MQL... 😜 Honestly though, I don't recall ever actually seeing it used in an MQL program.
Why btw you choose not to use the IsNone(type) methods by fxsaber?
Great idea!
BTW, thanks fxsaber!
#define NONE_DOUBLE DBL_MAX
#define NONE_FLOAT FLT_MAX
#define NONE_INT INT_MAX
#define NONE_UINT UINT_MAX
#define NONE_LONG LONG_MAX
#define NONE_ULONG ULONG_MAX
#define NONE_CHAR CHAR_MAX
#define NONE_UCHAR UCHAR_MAX
#define NONE_SHORT SHORT_MAX
#define NONE_USHORT USHORT_MAX
#define NONE_COLOR clrNONE
#define NONE_DATETIME -1
#define NONE_POINTER NULL
#define NONE_STRING "__NONE-*-*-STRING__"
In the case of using IsNone the defines become redundant - which I think it's much better because it enforces to use only the functions alone
#define NONE_DOUBLE DBL_MAX
#define NONE_FLOAT FLT_MAX
#define NONE_INT INT_MAX
#define NONE_UINT UINT_MAX
#define NONE_LONG LONG_MAX
#define NONE_ULONG ULONG_MAX
#define NONE_CHAR CHAR_MAX
#define NONE_UCHAR UCHAR_MAX
#define NONE_SHORT SHORT_MAX
#define NONE_USHORT USHORT_MAX
#define NONE_COLOR clrNONE
#define NONE_DATETIME -1
#define NONE_POINTER NULL
#define NONE_STRING "__NONE-*-*-STRING__"
Yes, the only time you need to use the NONE/IS_NONE macros is when working with templates. Otherwise it is more efficient to use constants and expressions.
Yes, the only time you need to use the NONE/IS_NONE macros is when working with templates. Otherwise it is more efficient to use constants and expressions.
Btw, there's another interesting use for this lib that crossed my mind.
You can pass to functions/methods any combination of parameters with default values (not restricted to the end of parameters list)
*-in that case it is better to give the default positive value in the function method itself (for parm2=5.1):
Which allows to call without the caller knowing the actual default value of the 2nd parameter.