https://www.mql5.com/en/code/9197 - is hard coded for a 0.0100 grid size (100 pips on a non jpy chart.)
The second draws a grid every 5 points. Adjust for point size and desired size.
extern int GridSpace=50; GridS=GridSpace/10;
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Just wondering what the best solution might be to varying the grid size on charts in MT4 (other than decimal type intervals).
I notice to 2 grid indicators in the codebase that allow horizontal grid lines to be drawn on the charts
But despite viewing both through MetaQuotes Language Editor, my limited knowledge of programming is not allowing me to understand the techniques involved to alter the grid spacing (I hope this is not breaching etiquette, I am new to this!)
My desire is to be able to set the spacing to any number, 3,6,7, 14.......... (I trade predominantly indices, so whole numbers are of interest)
https://www.mql5.com/en/code/9197
https://www.mql5.com/en/code/7292
Perhaps there is a simple solution
Any help appreciated
Regards
Dave