Yes.
count variable initialized once because this variable is static. Because there is endless loop start function will be called after next loading of EA only
In your case static int count=0 and int count=0 are the same
count variable initialized once because this variable is static. Because there is endless loop start function will be called after next loading of EA only
In your case static int count=0 and int count=0 are the same
Thank you for this. However, I would have thought static int=0 and int=0 are "not" the same, as if use int=0 then count will always equal 1 and will therefore not count properly. This is because int=0 is initialized with zero each iteriation of endless loop. Do you agree with this?
Many thanks.
Regards
RJF
I see. You are right.
My remark applied to variable outside the loop
My remark applied to variable outside the loop

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
I wanted to know if this is the correct way to program a endless loop counter (see code below). Is it ok to initialize the static variable once at zero within the start function? I want the count variable to always start at zero and then count the number of times the infinite loop loops.
Thanks in advance. Much appreciated.