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
There could be any number of reasons... The best-known ones are division by zero, leaving the array.
Thank you.
What is output outside the array? I apologise for my ignorance.
I only have 3 divisions:
This is where division by zero could potentially occur:
A basic check is needed.
It is when, for example:
On the last iteration there will be an exit outside the array.
This is where division by zero could potentially occur:
A basic check is needed.
This is when, for example:
At the last iteration there will be an exit outside the array.
Cool, should we check if the function works correctly?
Is there no problem with a meter like this?
Well, what happens when the balance goes to zero and the function works correctly? :)
The for statement does not have the type of variable i defined. The variable Magic is not defined. In the line.
OrderSelect() function is unnecessary. I haven't noticed anything else.issue with error (Error CopyBuffer - error number: 4806) - I remove it, I cure it bySleep(1000); - I put it down to indicator not having enough time to create.
The issue with the error (4194304 bytes not available) remains.
It will most likely be created. But before copying the data, we must check whether the data we want to receive (has the indicator had time to calculate?). The BarsCalculated function should help.
Then you request all timeframes by symbol. If this data is ready - it is downloaded from the disk into the memory, if not - it starts to be built (the memory is also consumed) + 100 indicators with a different period for each TF, and all this in the memory. The data is not immediately unloaded from the memory (in case you want to request it again)...
Reduce the number of bars on the chart.
The for statement does not have the type of variable i defined. The variable Magic is not defined. In the line
OrderSelect() is redundant. I haven't noticed anything else.There is one outside the operator.
It is likely to have been created. Only before copying the data, you should check if the data is available (has the indicator settled?). The BarsCalculated function should help.
Then you request all timeframes by symbol. If the data is ready - it is downloaded from the disk into the memory, if not - it starts to be built (the memory is also consumed) + 100 indicators with a different period for each TF, and all this in the memory. The data is not immediately unloaded from the memory (in case you want to request it again)...
Reduce the number of bars on the chart.
The number of bars does not change anything,
The problem is hidden in the periods, for variants
does not work, 19-5=14 - different periods,
If they are reduced to 4, then everything works, for example:
Although foru IndicatorRelease(m_handle) - is indeed incorrectly used.
I think that even if you don't release handles with IndicatorRelease function, it should work anyway,
So, the problem is in the number of different periods.
Or...