Discussion of article "Horizontal diagrams on MеtaTrader 5 charts" - page 5

 

Delays are just a consequence of optimisation. The first delay during initialisation. If the indicator (in the MT4 video) is set to a certain timeframe of the symbol, for which there is no history, or it is not complete, then the diagrams on the history may not be built, or will be built with errors. And I have observed this phenomenon. Please note that the indicator can be set on one timeframe, take the initial data from another, and show for the third. In order to draw charts on the history only once and immediately without errors, a piece of code is added to OnCalculate, which checks the readiness of the source data, and then skips five more calls of OnCalculate to ensure that now all the source data are ready. So that the user doesn't think that the indicator is hanging, the log shows the messages pass 1 .... pass 2, etc. As you can see, there is no recalculation, the load on the terminal is minimal. In the end, only the last diagram is recalculated. It happens once a minute. Is it a bad way? Maybe. But nothing cooler has come to my mind.

The second time the delay occurs in the mode when chart primitives are controlled by the indicator and not by the terminal. This is done to handle the occurrence of multiple CHARTEVENT_CHART_CHANGE events. I.e. when the user starts pulling the chart back and forth out of the blue. If we try to process such events as they come, the indicator will not be able to cope with constructions and will get a mess. That's why the indicator simply does nothing and returns control when the event occurs. But when the user stops generating an event, the indicator waits for three seconds to make sure that there will be no new events and only then redraws the diagrams in a new place. Only once! Yes, we get a delay. But we warn about it honestly, we do not consume unnecessary resources, and when there are questions, we explain our position. As it happens now )

Both the first and the second case are not necessary to manifest. And for myself I would not do these checks. But for others I have to. If I find, or someone suggests a better way, I will immediately start corrections.

 
try to implement via CCanvas, one object on the chart, if you need help, please write in a PM, or better in the contacts that I gave you earlier, because now I am rarely here )) I mainly write in Python.
 
Yes, I remember your thought. I plan to use this method and have a rough idea how to build such a diagram into the developed architecture.
 
I really liked it, but I couldn't get it to work
  • "Tick volumes for sale"
  • "Volumes of ticks to buy"
  • "Total tick volumes"
if you can help me
 
Enoir Heringer Da Silveira:
Мне действительно понравилось это, но я не мог заставить это работать.
  • "Объемы продаж клещей"
  • "Объемы тиков для покупки"
  • "Всего тиковых объемов"
если вы можете мне помочь
В статье описан подход, сам принцип. Индикаторы не предназначены для конкретной работы. Они изготовлены только для демонстрации этого принципа. В Маркете есть Демо индикатор на этом принципе. Он распространяется бесплатно. Название можно увидеть в моем профиле.