What value does it print when it fails ?
Hi guys,
I'm having issues with the iCustom command. Basically it's working sometimes and not others, which I find a little bizarre. Here is my code.
This function is currently called every tick, and seems to work great for a while after initial compilation, and calls up the correct values. Then all of a sudden it just stops working properly and fails every time it's run. Can anyone give me any reason as to why this might be happening. And crucially, why it only happens sometime?I'm not expert in MT4, but, just my observations...
- Your first IF statemente is useless, since you are starting at i=1.
- You declared a 7-element array and are not using the first element (0).
- You are calling "Super Trend" with the very same values of "i" - which is 1 through 6. Always. Do you know if this indicator is using internally ArraySetAsSeries()? Otherwise you are getting the very same values from the indicator buffers...
;)
The problem is with the iCustom call, and I'm pretty sure I now know WHAT the problem is, I just don't know how to fix it. When I run the indicator on a chart is draws a line from it's buffers. But occasionally it will fail and stop keeping up with the chart, meaning that I have to reinitialise the indicator to see the line. I'm wondering if there's some problem with the actual indicator (I don't have the source code for it) that makes it stop working after a certain amount of time and this is why the code I've written works for a few hours then suddenly just stops and only reads as an empty buffer value, and also that it starts working again when I recompile it.
The assumptions I am making are that my use of the iCustom command is essentially correct, and that when iCustom is used in a script the indicator it is reading from is initialised ONLY when the script is initialised, and not every time the iCustom function is called within the script.
If the second of those assumptions is correct, is there a way to make it reinitialise the indicator every time iCustom is called?
The problem is with the iCustom call, and I'm pretty sure I now know WHAT the problem is, I just don't know how to fix it. When I run the indicator on a chart is draws a line from it's buffers. But occasionally it will fail and stop keeping up with the chart, meaning that I have to reinitialise the indicator to see the line. I'm wondering if there's some problem with the actual indicator (I don't have the source code for it) that makes it stop working after a certain amount of time and this is why the code I've written works for a few hours then suddenly just stops and only reads as an empty buffer value, and also that it starts working again when I recompile it.
The assumptions I am making are that my use of the iCustom command is essentially correct, and that when iCustom is used in a script the indicator it is reading from is initialised ONLY when the script is initialised, and not every time the iCustom function is called within the script.
If the second of those assumptions is correct, is there a way to make it reinitialise the indicator every time iCustom is called?
Don't mix your terminology. Are you using a script? How can you recompile if you don't have the source code?
Don't mix your terminology. Are you using a script? How can you recompile if you don't have the source code?
I reinitialise the indicator, and recompile my EA. Correct terminology used (I believe) in each case, sorry if it was confusing.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
I'm having issues with the iCustom command. Basically it's working sometimes and not others, which I find a little bizarre. Here is my code.
This function is currently called every tick, and seems to work great for a while after initial compilation, and calls up the correct values. Then all of a sudden it just stops working properly and fails every time it's run. Can anyone give me any reason as to why this might be happening. And crucially, why it only happens sometime?