Download MetaTrader 5

fixedmin, fixedmax

To add comments, please log in or register
Publish your article and win recognition from thousands of traders!
NTFS
650
NTFS 2013.04.02 11:39 

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! 

Alain Verleyen
Moderator
30737
Alain Verleyen 2013.04.02 11:47  
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
NTFS
650
NTFS 2013.04.02 12:19  
angevoyageur:

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

I works. Thank you! :)

To add comments, please log in or register