[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 22
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
People, help me out!
I'm writing this code (this is a snippet), all variables and arrays are set, the counter counts. Initially countDH=0. But there is a problem: nothing is written to xDelH array. Print (High[j], Time[j], countDH) returns the correct result but xDelH[countDH][0] always gives 0. Checking via the array size also returns 0.
Even if you write xDelH[countDH][0]=0.01; it still gives 0. Whatever I do, no matter where I put this code, it does not work anywhere.
What may it be because of? What is the reason? Please help me!
People, help me out!
I'm writing this code (this is a fragment), all variables and arrays are set, counter counts. But there is a problem with xDelH array, nothing is written to it. Print (High[j], Time[j], countDH) gives me correct result but xDelH[countDH][0] always returns 0. Checking via array size also returns 0. What may be the reason? What is the reason? Please help me!
Even if I write xDelH[countDH][0]=0.01; it still produces 0.
Check if xDelH is of the double type. Is this if inside for. The break operator is somehow wrongly placed. If you do it like below, what will happen?
People, help me out!
I'm writing this code (this is an excerpt), all variables and arrays are set, the counter counts. Initially countDH=0. But there is a problem: nothing is written to xDelH array. Print (High[j], Time[j], countDH) returns correct results, while xDelH[countDH][0] always gives 0. Checking via the array size also returns 0.
Even if you write xDelH[countDH][0]=0.01; it still gives 0. Whatever I do, no matter where I put this code, it does not work anywhere.
What may it be because of? What is the reason? Please help me!
I have double xDelH[][2]; if is in two for, one of which goes through j. The code you wrote works - it outputs 0.01
In your version, the size of the array is not specified in dimension 0, but in the example above it is:
Thank you! It's all working. Selected the size as follows: ArrayResize(xDelH,100);
One more question: if the array fills all 100 cells, and countDH will count to 120 for example, will the array size automatically increase to 120, or will I have to regularly resize the array another way?
Thank you! It's all working. Selected the size as follows: ArrayResize(xDelH,100);
One more question: if the array fills all 100 cells, and countDH will count to 120 for example, will the size of the array automatically increase to 120, or will I have to resize the array regularly in another way?
Nothing will be done automatically. If necessary:
Nothing will be done automatically. If necessary:
Thank you!
Alternatively, you can set more cells at once, e.g. 1000 if you know there will be no more than 1000. If you fill the array inside for, then in the same for you define the maximum number of iterations and before for you can change the size of the array, e.g..:
Alternatively, you can set more cells at once, e.g. 1000 if you know there will be no more than 1000. If you fill the array inside for, then in the same for you define maximal number of iterations and before for you can resize the array, for example..:
In my code, it's more convenient to define number of iterations through ArrayRange.
Why, if I write xDelH[countDH][0]=HBar[countH][0]; it will give 0 (although HBar[countH][0] is already filled and has its own value). Can I do this at all?