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
You would code it exactly as you would say it
if calclong1==true Or calclong2==true And calclong3 ==true And calclong4 ==true And calclong5 ==true
now that is a bit ambiguous as it often can be when mixing || and &&
so we put in some extra brackets to make it clear
As William has pointed out with bools or boolean results the ==true is not really necessary
so would it be like this? ^^^
or like this? ^^
Should this work ?
so would it be like this? ^^^
or like this? ^^
They are both correct, assuming that the variables or functions return a bool result.
Should this work ?
I don't know as I cannot see where the variables are calculated.
They are both correct, assuming that the variables or functions return a bool result.
I don't know as I cannot see where the variables are calculated.
This is how the variables are created, but something is definitely still going wrong
Those are not assignments; they are initialization of a common (globally declared), or static variable with a constant. They work exactly the same way in MT4/MT5/C/C++.
They are initialized once on program load.
They don't update unless you assign to them.
In C/C++ you can only initialize them with constants, and they default to zero. In MTx you should only initialize them with constants. There is no default in MT5, or MT4 with strict (which you should always use).
MT4/MT5 actually compiles with non-constants, but the order that they are initialized is unspecified and
Don't try to use any price or server related functions in OnInit (or on load), as there may be no connection/chart yet:
Unlike indicators, EAs are not reloaded on chart change so you must reinitialize them, if necessary.
external static variable - MQL4 programming forum #2 2013.02.10
Those are not assignments; they are initialization of a common (globally declared), or static variable with a constant. They work exactly the same way in MT4/MT5/C/C++.
They are initialized once on program load.
They don't update unless you assign to them.
In C/C++ you can only initialize them with constants, and they default to zero. In MTx you should only initialize them with constants. There is no default in MT5, or MT4 with strict (which you should always use).
MT4/MT5 actually compiles with non-constants, but the order that they are initialized is unspecified and
Don't try to use any price or server related functions in OnInit (or on load), as there may be no connection/chart yet:
Unlike indicators, EAs are not reloaded on chart change so you must reinitialize them, if necessary.
external static variable - MQL4 programming forum #2 2013.02.10
Thanks, this makes more sense. I had a look at the static variable forum you linked but I cant understand how it will work with my code?
i do need exactly what your saying, for it to reset on every tick.
whats the best way for me to do it?
What part of “They don't update unless you assign to them” was unclear?
What part of “They don't update unless you assign to them” was unclear?
sorry im still really new to coding, how do i assign to them ?
would this mean they update ?
or is there an easier way ?