Download MetaTrader 5

Screenshot only taking the RHS of the graph after Navigate

To add comments, please log in or register
Add our Facebook page to friends. Follow the latest news!
gr101 2015.10.19 21:19 


I'm trying to take a screenshot of the 680th bar (see below).

When I run the code  below on the chart the screenshot does not navigate to the -680th position. It takes a screenshot of the chart as it is when you open the chart.

If I step through the code (leaving a break point on the ChartScreenshot line) it does move the chart back to the -680th position... however the screenshot reflects it from Bar[0].

ChartSetInteger(0, CHART_AUTOSCROLL, 0, false);
ChartSetInteger(0, CHART_SCALE, 0, 3);
ChartNavigate(0, CHART_END, -680);

bool result = ChartScreenShot(0, "MyFile_right.jpg", 400, 400, ALIGN_RIGHT);

Any ideas what I need to add or amend?


To add comments, please log in or register