chart screen center

 
Hello friends 
I designed an indicator for MetaTrader 5 that when you click on a button it randomly selects a price on the chart
Now I want this candle to be displayed in the middle of the chart after this point is found and I don't know what function I should use to identify the middle of the chart so that when I find a point I can pass it to it so that the user can see the point that was found in the middle of the chart 
Without having to scroll the chart left and right
 
naserazimi:
Hello friends 
I designed an indicator for MetaTrader 5 that when you click on a button it randomly selects a price on the chart
Now I want this candle to be displayed in the middle of the chart after this point is found and I don't know what function I should use to identify the middle of the chart so that when I find a point I can pass it to it so that the user can see the point that was found in the middle of the chart 
Without having to scroll the chart left and right
I'm not 100% sure exactly what you mean, but ChartNavigate() might help.
Documentation on MQL5: Chart Operations / ChartNavigate
Documentation on MQL5: Chart Operations / ChartNavigate
  • www.mql5.com
Performs shift of the specified chart by the specified number of bars relative to the specified position in the chart. Parameters chart_id [in]...