I try to disable chart scrolling and scaling by the ChartSetInteger function with the property CHART_KEYBOARD_CONTROL (in MT4). Disabling scrolling is successful in this way, but unfortunately scaling cannot be disabled in this way. Every time you press "+" or "-" on the numeric keypad, the chart will scale undesirably. Is there any solution? I tried to remember the current scale when pressing "+" or "-", and then set this scale back. Unfortunately, it is not possible to do this immediately after pressing the keys, and one has to wait for the scale changing before undoing it. This, of course, results in a very ugly flickering of the graph.
If anyone has a better solution I would be very grateful for sharing.
- Scale Fix One-to-One feature
- I cannot find a price scale to the right of my chart.
- Change timeframe of the current chart with a script doesn't work
Since no one's responding, I did some research myself. So far the best solution is to handle this problem in the OnChartEvent function. This solution does not cause annoying chart "flickering" (at least in most cases).
#define ON_SCALE_CHANGE (97) void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam) { long scale; // Handle custom chart event ON_SCALE_CHANGE if(id==(ON_SCALE_CHANGE+CHARTEVENT_CUSTOM)) // if the scale hasn't changed yet if((scale=ChartGetInteger(ChartID(),CHART_SCALE))==lparam) EventChartCustom(ChartID(),ON_SCALE_CHANGE,scale,0.0,""); // reset the chart scale else ChartSetInteger(ChartID(),CHART_SCALE,lparam); // keydown "+" (on numeric keyboard) if(id==CHARTEVENT_KEYDOWN && lparam==107) EventChartCustom(ChartID(),ON_SCALE_CHANGE,ChartGetInteger(ChartID(),CHART_SCALE),0.0,""); // keydown "-" (on numeric keyboard) if(id==CHARTEVENT_KEYDOWN && lparam==109) EventChartCustom(ChartID(),ON_SCALE_CHANGE,ChartGetInteger(ChartID(),CHART_SCALE),0.0,""); } #undef ON_SCALE_CHANGE
If anyone has a more elegant solution, it would be great if you would share it.
Petr Nosek #:
The more elegant solution is to use a modern software, try MT5
Since no one's responding, I did some research myself. So far the best solution is to handle this problem in the OnChartEvent function. This solution does not cause annoying chart "flickering" (at least in most cases).
If anyone has a more elegant solution, it would be great if you would share it.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register