Download MetaTrader 5

Display cut off bars on the chart?

To add comments, please log in or register
Nikolay
175
Nikolay  

When I use F12 "Step by Step" sometimes a bar that goes beyond the visible bottom or top of the chart is not displayed fully:


1) Is there any MT4 settings that can help correctly displaying such bars?

2) Is there a way to program correctly displaying such bars?

Keith Watford
Moderator
10065
Keith Watford  
Try pressing F8 and make sure that the scale fix boxes are not checked
Nikolay
175
Nikolay  

the scale fix checkboxes are disabled.

A cut off bar is displayed after the next bar closes.

whroeder1
15073
whroeder1  
Don't link to images, insert the image
Nikolay
175
Nikolay  

Thanks WHRoeder! Image inserted.

And clarified that it happens when I use F12 "Step by Step".

whroeder1
15073
whroeder1  
nikolaygmt: happens when I use F12 "Step by Step".
Old bug 2012/08/18:
// In the tester (visual mode,) on the first tick, these routines return
// left=100, right=37 (depends on default bar scaling.) This is what the
// chart looks like when you maximize it while it is generating the FXT
// file. After that, it appears like the left/right are correct but the
// hi/lo are one tick behind the displayed chart. I don't know about
// live charts.
The scale doesn't resize until the end of processing the tick. F12 is one tick.
Nikolay
175
Nikolay  

Thanks WHRoeder! I programmed a workaround. Does not show the full source code, but main logic is there and works in most cases when the user is using a self defined hotkey for F12 to navigate the chart.

   else if (id == CHARTEVENT_CHART_CHANGE) {
      if (isF12Pressed) {
         double chartLow;
         double chartHigh;
         ch.getChartVisibleLowHigh(chartLow, chartHigh);
         double winMaxPrice = WindowPriceMax();
         double winMinPrice = WindowPriceMin();
         
         if (ComparePrice(chartLow, LT, winMinPrice) || ComparePrice(chartHigh, GT, winMaxPrice)) {
            ch.setScaleFix(true);
            ch.setScaleFixMinMax(chartLow, chartHigh);
         }
         else {
            ch.setScaleFix(false);
         }
         
         isF12Pressed = false;
      }
   }
To add comments, please log in or register