Leonardo Fernandez:
Hi!
I've been writing a code but its getting loong, i cant find a way to make it smaller, i need candle[1] to be different than all candles between [2] and [9] (just an example). How do i do that without having to write candle[1] != candle[2] &&... one by one?
int candle[9]; //code to fill candle array bool isEqual=false; int size=ArraySize(candle); for(int x=2; x<size; x++) { if(candle[1]==candle[x]) { isEqual=true; break; } } if(isEqual) { //Do whatever when an equal value is found } else { //Do whatever when an equal value is NOT found }
Not compiled or tested.
Leonardo Fernandez: i need candle[1] to be different than all candles between [2] and [9] (just an example). How do i do that without having to write candle[1] != candle[2] &&... one by one?
-
Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 programming forum #2 2013.06.07 - Write a loop like Keith showed.
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
Hi!
I've been writing a code but its getting loong, i cant find a way to make it smaller, i need candle[1] to be different than all candles between [2] and [9] (just an example). How do i do that without having to write candle[1] != candle[2] &&... one by one?