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
When i==0 you are trying to access Supportbuffer[-1] , it doesn't exist
Also as you are counting down in your loop, you are comparing Supportbuffer[i] to a buffer element that has not yet been assigned a value.
When i==0 you are trying to access Supportbuffer[-1] , it doesn't exist
Also as you are counting down in your loop, you are comparing Supportbuffer[i] to a buffer element that has not yet been assigned a value.
Thank you for your reply.
I corrected the i==0 issue with the followings:
But array is still out of range on that line & even if I try to assign value like
Supportbuffer2[i] = 0; it shows array error on that line too.
Supportbuffer2[i] = Supportbuffer2[i] + MathAbs(i-(i-1));
That would not give an array out of range error, but it does not make any sense
MathAbs(i-(i-1))
will always equal 1
I can still see that there are still 4 instances where you try to access index i-1
That would not give an array out of range error, but it does not make any sense
will always equal 1
I can still see that there are still 4 instances where you try to access index i-1
Did you read my post??????
I can still see that there are still 4 instances where you try to access index i-1
Hello GumRai, I understood about the 4 instance, that's why in following code I added if(i!=0) after the loop starting. So that -1 never occurs.
Without i-1 how can I check the next bar in a backward loop?
Thank you WHRoeder I changed the data type of the buffer into double. Here is my current code. But still same problem with i-1 line even after adding i!=0 condition.
Why would you do
when you can just do
?
If you are still getting an array out of range error, check limit.
Hi with your suggestion I did i>0 so I don't need to check when i!=0 any more.
I solved the issue. I made a silly mistake at the initialization that's why such thing...
Thank you.