This:
short result = 0; result = result + 1;
will set result always to 1.
You would need (as far as I can see this from this little code snippet):
static short result; if (price == target) { result = result + 1; .. }
Little hint: read in the editor's reference about static variables or global variables.
abricot91:
if (price == target) | Won't work. |
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 would like to code an indicateur wich mark +1 each time that a price is crossed.
example : if price hit 3 times 9600, indicator will mark "9600 +3".
My first idea was :
But If I want to make that for each price what is better way (algorithm)