Good morning,
unfortunately I'm really stuck without your help. Does nobody have an idea which my indicator does not show the correct behavior once I use it in an EA?
Any feedback is highly appreciated!
Thanks!
Good morning,
unfortunately I'm really stuck without your help. Does nobody have an idea which my indicator does not show the correct behavior once I use it in an EA?
Any feedback is highly appreciated!
Thanks!
Nobody is going to be able to answer you as you have not provided all the code, but even if you did it is a big ask to expect others to do your debugging.
Clearly the answer is that either the indicator or the EA are not coded as intended, so you will need to review your code, use the debugger, compare values step by step to find the discrepencies.
Thanks for your reply. Neither am I expecting somebody to do my debugging, nor did I ask for it. But I was hoping for some ideas like "this could happen when...", which would make things a lot easier for me. I'm not a MQL4 expert, but if an Indicator is showing the intended behavior in a chart, but shows a different behavior once it's used in an EA, I would expect some bells are ringing inside the heads of the experts, but maybe I'm wrong.
I see your point in not providing the full code. I will further try to reduce my code to the bare minimum in order to locate the issue.
Thanks for your reply. Neither am I expecting somebody to do my debugging, nor did I ask for it. But I was hoping for some ideas like "this could happen when...", which would make things a lot easier for me. I'm not a MQL4 expert, but if an Indicator is showing the intended behavior in a chart, but shows a different behavior once it's used in an EA, I would expect some bells are ringing inside the heads of the experts, but maybe I'm wrong.
I see your point in not providing the full code. I will further try to reduce my code to the bare minimum in order to locate the issue.
The most probable case, is that in your EA you are collecting the wrong information from your Indicator, or you you are using different parameters when calling the Indicator (or EA). In other words, the problem is most likely in your EA code (which you did not provide) and probably not in your Indicator code.
Also, since an EA does not worry about "colours", only the data, I would leave those inputs at the end of the input list, so that they can be skipped in the iCustom() call. However, it's best to leave the colour information out of the inputs and defined by the normal display setup that MetaTrader provides.
-
The problem is your EA, which you don't show.
-
You should encapsulate your iCustom calls to make your code self-documenting.
take candle color hekin ashi - MQL4 and MetaTrader 4 #8-10 or #1 (2018)
The most probable case, is that in your EA you are collecting the wrong information from your Indicator, or you you are using different parameters when calling the EA. In other words, the problem is most likely in your EA code (which you did not provide) and probably not in your Indicator code.
Also, since an EA does not worry about "colours", only the data, I would leave those inputs at the end of the input list, so that they can be skipped in the iCustom() call.
Thank you, William and Fernando, this already helps me a lot. Really appreciate it. 👍
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good evening,
with Google and the documentation in this forum I solved a lot of my beginner problems, but now I'm stuck and I would really appreciate the help from the experts.
I like Heiken Ashi and as a programming exercise I added a Price Action Channel and a bar counter, which counts the number auf bullish and bearish candles in a row. Bullish candles are positive, bearish candles are negative. Once the direction of the candles changes, the counter starts either with 1 or with -1. The indicator itself works as intended, but as soon as I add it to an EA using iCustom, it changes the behaviour immediately. Please find below a screenshot as an example: The lower chart shows the indicator and the first red candle is counted with -1, as intended. The upper chart shows the EA and for some reason the counting doesn't work anymore. What really surprises me: Not only the Comment() from the EA shows the wrong value, even the data screen from the indicator itself shows the wrong value, so I assume this problem is related to the Indicator and not to the EA (EA = based on MT4 "Moving Average" example).
Screenshot and Indicator code are attached. Any help is really appreciated!
Thanks in advance!