...
Any ideas of the top of your head what the problem might be or where I should look for it?
The problem is in your code, you need to manage the errors correctly when you try to get data (from other symbols, timeframes or indicators).
I had a similar situation where I was returning 0 from OnCalculate()
Forum on trading, automated trading systems and testing trading strategies
Trying to convert an mql4 to mql5 breakeven indicator but nothing is drawn on the chart.
Vladislav Boyko, 2024.06.30 17:21
@Conor Mcnamara, it looks like you are right. I took the standard ATR and made it always return 0. In the strategy tester, the indicator subwindow remains empty in this case. Additionally, the buffer is also not shown in the data window. All this despite the fact that, judging by the performance, the buffer values are calculated for all bars with each tick.
.
But to avoid guessing, make a copy of your indicator, remove all unnecessary stuff - replace the calculation of buffers with something simple (copy the close price into the buffer, for example), make sure that the problem is still reproducible and publish here the code that will allow other users to reproduce the problem.
After you do what I wrote above, we can have a substantive discussion. For now, this is empty chatter and fortune telling on coffee grounds.
The problem is in your code, you need to manage the errors correctly when you try to get data (from other symbols, timeframes or indicators).
Dude, thanks for telling me nothing. I was clear in the post that the problem must be in my code. That was no help.
That's like a driver training student asking his teacher, "What am I doing wrong?" and the guy answers, "You need to drive better!" 🤣
Uh... duhr.
Hey guys, why is there so much disdain on this forum?
My question was perfectly valid.
What's wrong with someone asking if anyone has already run into this?
I didn't ask you to debug or analyze my code.
So, from the responses so far, the simple answer to the question I actually asked, ("Any ideas of the top of your head what the problem might be or where I should look for it?" in case you need a reminder,) is: "No."
That's all you had to say. Or nothing at all, just as fine. Tells me the same thing.
In my questions, I try to give you the necessary info to answer the question I'm going to ask, and then I ask it. It's usually the last sentence/paragraph in the post.
Please answer that, simply.
The rest is BS.
When the situation you described repeats, check the log for runtime errors (array out of range or division by zero, for example). Perhaps your indicator crashes when OnCalculate is executed for the first time
I'll try putting a super-simple indicator on the chart as per your suggestion, and then build it up from there. I'll let you know if I figure it out.
I'll try putting a super-simple indicator on the chart as per your suggestion, and then build it up from there. I'll let you know if I figure it out.
In order to check whether there are runtime errors in the log, it is not necessary to create a new indicator. I suggested that you make a new simplified indicator so that other users can reproduce the situation you describe.
Dude, thanks for telling me nothing. I was clear in the post that the problem must be in my code. That was no help.
That's like a driver training student asking his teacher, "What am I doing wrong?" and the guy answers, "You need to drive better!" 🤣
Uh... duhr.
I am STRONGLY suggesting you to change your tone and attitude when you are replying to people trying to help you.
You don't show any code so it's not possible to help with more details. With a positive attitude you will see that my answer is correct and lead you in the right direction.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Here's what I see when I start the MT5 terminal, also when its running but my internet connection is interrupted. The indicator plot shows briefly (subsecond) and then disappears:
All I need to do is switch the timeframe of the chart to anything and then back and the window shows up like it should have to begin with:
In one way, it's a minor annoyance, although it's wearisome when I've got 6 - 10 charts open at the same time.
On the other hand, it indicates that I'm consistently coding my indicators in such a way as to behave like this. I thought it might be a problem with any custom indicator, but if I add one from the Examples or the Bill Williams folder, it doesn't behave this way.
Any ideas of the top of your head what the problem might be or where I should look for it?