command doing ''right-click Refresh'' on the chart to change values depending on zoom level

 

I need to modify the thickness of a few  trend lines and rectangles, depending on the level of zoom on the chart, so i use

if(ChartScaleGet(0)>3){thickness =...}

else {thickness = ...}


in my drawRectangle(...) function.


but that works only on new candles, because I limit my for-loops to the new candle... like here https://www.mql5.com/en/forum/105977/page2#comment_3006343


so I would like a function to emulate the right-click ''refresh''  to update the chart, but only when the Zoom is going from number 0,1,2 to 3, 4, 5.

 

No need for a refresh. Just remember the original scale in a static variable. If it changes, modify your object(s).