Looking for solution to changing grid size

 

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

 

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;
Reason: