Also, the custom indicator seems to disappear from the chart/calculate incorrect values once it is left for a while. I have no idea why, has anyone else experienced this?
w_kitching:
Also, the custom indicator seems to disappear from the chart/calculate incorrect values once it is left for a while. I have no idea why, has anyone else experienced this?
Also, the custom indicator seems to disappear from the chart/calculate incorrect values once it is left for a while. I have no idea why, has anyone else experienced this?
your indicator has coding problems
ChartSetSymbolPeriod(0, _Symbol, _Period);
Thanks for all your comments!
Just to wrap this up if anyone else later has a similar issue..
The indicator cut out every now and then because of a zero divide error when calling a different symbols prices.
The solution was simply to put an if statement before the divide to check that the value is not zero!
Also the ChartSetSymbolPeriod works a treat to automatically refresh the chart.
Thank you for your help!

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
Hello,
I have searched and searched and can find nothing that helps me!
My problem is I have coded a custom indicator and the values of it change when you refresh the chart (right click and click 'refresh'). Once it has been refreshed once per bar, the values remain as correct.
I call on this indicator via iCustom in an EA and I am concerned it will only work correctly if I can refresh the indicator values all the time. However I cannot find a way to refresh the window in code.
I have tried the ChartRedraw(0) function and it does not work. I have also tried using ChartRedraw(1) incase the subwindow is chartID(1).
Does anyone know how to effectively refresh the indicator window?
Thanks in advance!
Will