Download MetaTrader 5
To add comments, please log in or register
Interessiert am Partnerprogramm MQL5.community? Veröffentliche Links und verdiene Geld damit!
Michal Jurnik
24
Michal Jurnik 2014.12.07 14:34 
Hi guys, I would like to know if it is possible to detect chart scroll. Whenever somebody scrolls right/left I would like to redraw my indicator. Any ideas how to do it? Thank you for reply!
Carl Schreiber
5939
Carl Schreiber 2014.12.07 19:12  
If your indicator is coded correctly it shouldn't be necessary!
whroeder1
13605
whroeder1 2014.12.07 20:00  
Just_Mike: I would like to know if it is possible to detect chart scroll. Whenever somebody scrolls right/left I would like to redraw my indicator. Any ideas how to do it?
  1. First left bar in window - MQL4 forum
  2. Just use IndicatorCounted and draw all lines, no redraw required.
Michal Jurnik
24
Michal Jurnik 2014.12.07 20:07  
gooly:
If your indicator is coded correctly it shouldn't be necessary!
I need force OnCalculate, not just redraw. Sorry for misunderstanding expression. 
whroeder1
13605
whroeder1 2014.12.07 21:00  
Just_Mike: I need force OnCalculate, not just redraw. Sorry for misunderstanding expression. 
  1. You can't
  2. Unnecessary. Just set your buffers and you are done. The terminal will draw if the user scrolls.
  3. Your question has been answered three times.
Halley
198
Halley 2014.12.07 21:41  

In the OnEvent() method check for the CHARTEVENT_CHART_CHANGE event. If you need the parameters for the OnInit(), you have to synthesize them by other means (e.g ArrayCopySeries). 

Michal Jurnik
24
Michal Jurnik 2014.12.09 11:34  
DeepThought:

In the OnEvent() method check for the CHARTEVENT_CHART_CHANGE event. If you need the parameters for the OnInit(), you have to synthesize them by other means (e.g ArrayCopySeries). 

Definitely good way how to make it! Thank you a lot for idea!
Michal Jurnik
24
Michal Jurnik 2014.12.09 11:37  
WHRoeder:
Just_Mike: I need force OnCalculate, not just redraw. Sorry for misunderstanding expression. 
  1. You can't
  2. Unnecessary. Just set your buffers and you are done. The terminal will draw if the user scrolls.
  3. Your question has been answered three times.

Sry mate, it hadn't been answered three times. It wasn't answer what I was looking for. DeepThought gave me right answer but thank you for try!
whroeder1
13605
whroeder1 2014.12.09 13:38  
Just_Mike: Sry mate, it hadn't been answered three times. It wasn't answer what I was looking for. DeepThought gave me right answer but thank you for try!
  1. Just because it wasn't the answer you were looking for doesn't change the fact that it has been answered three times. You can't force OnCalculate. Four times!
  2. On detecting chart scroll, DeepThought gave you an answer. I gave you another.
  3. As gooly and I have both said, what you're asking for is unnecessary.
/
To add comments, please log in or register