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
@William Roeder
Not this:Actually I was referring to this bit:
I see, so it must be this I guess...
https://docs.mql4.com/predefined/bars
Ok I have nothing to add to this beyond the "return false" statement in my first comment
As already mentioned by others your "for" cycle is wrong. You need something like this:
After you fixed that for loop you need logical OR:
bool flag=false;
for(...)
{
flag ||= (conditions);
}
That way if the conditions are true for minimum one bar, flag becomes true.
As already mentioned by others your "for" cycle is wrong. You need something like this:
Hi thanks for the reply. Is the loop not counting back across the bars i.e. starting at i and counting through i-- which is every bar on that chart. my thinking was i-- replaced with i=10 would count back until the 10th bar. but I guess its not that simple? then the logic is if the if statement is true across any on those bars then it would return true. if not false?
Thanks anyway it didn't help I posted it in the wrong thread at first it has just confused me further>
Loops will work the same way in MQL4 and MQL5.
Loops will work the same way in MQL4 and MQL5.
Oh. What I was trying to say was "Take a look at the reference"