for(int v=0;v<ArraySize(levels);v++) { if(levels[v]==NormalizeDouble(PriceCheck,Digits)) adds=false; break; }
for(int g=0;g<ArraySize(levels);g++) { if(levels[g]==NormalizeDouble(PriceCheck,Digits)) add=false; break; }
No matter what the size of the loop, the break will stop it after the first pass
for(int v=0;v<ArraySize(levels);v++) { if(levels[v]==NormalizeDouble(PriceCheck,Digits)) { adds=false; break; } }
for(int g=0;g<ArraySize(levels);g++) { if(levels[g]==NormalizeDouble(PriceCheck,Digits)) { add=false; break; } }
add the curly braces so that the loop completes
Can't believe I missed that! Thanks!
Richard
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, how do I remove duplicate values from an array? I have tried to add a check to stop it adding duplicate values in the first place - but this doesn't seem to work.
Thanks!
Richard