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
Thank you for your explanation.
I see it better now.
SCFX
Hi,
I scratch my head with that crazy error.
Still this simple indicator of 4 rows code disappear when I change timeframe.
Crazily enough, I applied the suggestions posted here already but still failed.
I feel so bad...
Please help me.
Many thanks,
SCFX
Hi,
I scratch my head with that crazy error.
Still this simple indicator of 4 rows code disappear when I change timeframe.
Crazily enough, I applied the suggestions posted here already but still failed.
I feel so bad...
Please help me.
Many thanks,
SCFX
Thanks for replying.
On my journal, there is no such notice but when I change TF, this indicator is removed.
I still cannot fix it yet.
SCFX
2014.05.18 08:41:31.080 Custom indicator H_889_boring GBPUSD,H1: removed
2014.05.18 08:41:25.441 Custom indicator H_889_boring GBPUSD,H4: loaded successfully
I still cannot fix it yet.
SCFX
That is because you are not trying very hard.
You will not learn anything if you get other people to do it for you, the only way is to do it yourslf so you understand it, the only way to do it yourself is to examine each line of code, break it down and figure out exactly what it is doing and there are several ways of doing that.
These are all things you could do that would help you find the cause of the problem
If you had clicked on the experts tab it would tells you your indicator did zero divide on this line, changing timeframes had nothing to do with it.
So that has to mean this High[i]-Low[i] was zero for some reason. If you look at the indicator on the chart you can see the indicator drew some of its values then stops at a bar where there is only one tick. If there is only one tick high[i] == low[i] so that would cause a zero divide
Now make sure high[i]-low[i] does not get used if it is zero.
Now you will see the experts tab tells you the code did not zero divide anymore but it generates array out of range error on this line.
if(high[i] - low[i] == 0)
So what happens if you take out all the calculations and condidtions to test the loop ?
Now the experts tab reports array out of range again, this time on this line:
So now you know your code causes array out of range every time a price array is used in the loop. So figure out what is wrong with the loop and why Close[i], Low[i], High[i] is out of range. You can seee the indicator draws all the way to the end of the chart so the error must be at the end, the highest array indexes.
It appears you are trying to make an indicator without learning how to code a loop that works correctly first. There are plenty of examples of how to do this. Look at the code for the included indicators and experiment with them until you understand exactly how they work then try to make an indicator to draw a simple single line that works properly before you try to make it perform calculations.
@ scfx
The only person who can fix is you. Or go to https://www.mql5.com/en/job
and post the job there.
...
Please SDC, no need to be so harsh, even if you are right.
Please SDC, no need to be so harsh, even if you are right.
lol I reworded my post a little bit ;)
Sorry, I misguided you, I apolgize, indicator can be coded like that :
If the chart has less than 3000 bars it will still be out of range.