Question about 'total rates' and events.

 

Hello everyone, I apologize for my English as I am not a native speaker. Well, it's been about two days since I started to study MQL5 a little more deeply, I have some notion of programming, so I've managed to get by, I'm programming an indicator and I've already managed to do all the calculations I'd like, I even managed to draw the indicator chart, but I noticed that when the asset is modified with the indicator already open, sometimes there is a glitch that leaves the indicator random, I was able to come to the conclusion that the problem is due to the fact that I am using the value of rates_total for draw the indicator and that when I change the asset the first seconds that proceed, it progressively loads the value of the candles already drawn, I would like to know if there any event so that I can know if the rates_total has already been completely loaded and from that draw my chart.

Thanks in advance for your help, have a nice week!

 
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  2. See How to do your lookbacks correctly #9#14 & #19.

 
Gilson Meira: I apologize for my English as I am not a native speaker.
If you prefer to discuss issues in your own language, there is a Portuguese section of the site, including the forum.
Fórum MQL5
Fórum MQL5
  • www.mql5.com
MQL5: Fórum sobre sistemas de negociação automatizados e testes de estratégia
 
Fernando Carreiro # : Se você preferir assuntos em seu próprio idioma, há uma seção em português do site, incluindo o fórum .

Thank you very much for the nomination, I will ask the Brazilian community then!

 
William Roeder #:
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  2. See How to do your lookbacks correctly #9#14 & #19.

If you had looked closely at my question you would have noticed that it boils down to "Is there any way or event to detect when rates_total is fully loaded?"

And if you thought the question was poorly formulated, all you had to do was answer objectively with "yes/no", unfortunately I didn't find a topic about "how to objectively answer a question" if I find this topic I'll send you!
 
You can print rates_total on every calculate, as well as you can make an if statement to define what should and should not happen if prev_calculated is equal to rates_total or not. Also have you seen the variable observation tool in the debugger?
 
Gilson Meira #: If you had looked closely at my question you would have noticed that it boils down to "Is there any way or event to detect when rates_total is fully loaded?"

Rates_total is the number of bars on the chart. It is always fully loaded.