try:
if( temp != EMPTY_VALUE ) { switch(i) { case 0: case 2: case 4: case 6: upcount++; break; case 1: case 3: case 5: case 7: downcount++; break; default:break; }
https://book.mql4.com/operators/switch
Hope this helps
Enotrek
enotrek:
It works beautifully, thank you very much.
try:
https://book.mql4.com/operators/switch
Hope this helps
Enotrek

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
Can someone please tell me what's wrong with this code snippet, which is part of an EA I am trying to develop?
The indicator "myIndi8" has eight "extern" parameters and eight buffers, four of which are up arrows (0,2,4 and 6) and the other four are down arrows.
The indicator puts an EMPTY_VALUE into the buffer unless it should display an arrow, in which case it puts a double value into the buffer.
When I run the EA in Strategy Tester, it starts by taking both a long and a short position on the first bar. WHY?
The code where upcount and downcount are used is this...
I am truly hopeful the experts on this forum can shed light on this dilemma.
Thank you, Helmut