fixedmin, fixedmax

 

Hello!

I wrote a simple script

#include    <Charts\Chart.mqh> 
#include    <ChartObjects\ChartObjectsLines.mqh>
string gSymbol = "GBPUSD";

void OnStart()
  {
//---
     CChart lChart;
      lChart.Open(gSymbol, PERIOD_M15);
      lChart.FixedMin(1.28);
      lChart.FixedMax(1.29);
      Print("lChart.FixedMin(1.28);", lChart.FixedMin(1.28)); 
      Print("lChart.FixedMax ", lChart.FixedMax(1.29));      
      lChart.Redraw();
      while(!IsStopped()) {};
  }

 Now I expect GBPUSD chart to be shown in MT5 in between of Max and Min boundaries. But that is not what happens. The chart is displayed as if no FixedMin, FixedMax parameters were set. 

Could someone comment on it?

Thank you! 

 
ns_k:

Hello!

I wrote a simple script

 Now I expect GBPUSD chart to be shown in MT5 in between of Max and Min boundaries. But that is not what happens. The chart is displayed as if no FixedMin, FixedMax parameters were set. 

Could someone comment on it?

Thank you! 

You have to activate scalefix mode, add the following line in your code :

      lChart.ScaleFix(true);
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties - Documentation on MQL5
 
angevoyageur:

You have to activate scalefix mode, add the following line in your code :

I works. Thank you! :)