How to add evenly spaced horizontal lines to a chart?

 

Hello, I'm trying to add horizontal lines at evenly spaced intervals to my chart but can't seem to find how to do it. I don't know if it's an indicator or something that's built into MT4 itself.


The picture below shows exactly what I'm looking for, which is horizontal lines spaced 25 pips apart, i.e. 0.6600, 0.6625, 0.6650, etc.


Can someone please point me in the right direction? I've been searching for hours but haven't even come close.



Thank you for any help.


.....Sean

 
Would WindowPriceMin() and WindowPriceMax() work for you?
 
arachnode.net:
Would WindowPriceMin() and WindowPriceMax() work for you?

Hi, arachnode. Thanks for your reply.


I'm pretty new to MT4, so not even sure what WindowPriceMin() and WindowPriceMax() are (I searched the net but only got 16 hits when using Google to search for "WindowPriceMin() +mt4" and none of those gave me anything useful that I could understand).


Guessing from the names of those functions(?) you suggested, wouldn't they just limit the screen to range between those two values? What if price went higher or lower than those values? Would I still see the horizontal lines I'm looking for as price moves upward and downward?


It seems that MT4 should have that built-in to one of the chart property menus, something like "Y-axis increment value" or something similar. Or maybe there's an indicator that will draw those lines at specified intervals but I can't seem to find that when searching for "how to place evenly spaced "horizontal lines" on +mt4 chart" or multiple variations thereof.


Thanks.


.....Sean

 

You are correct - those function gets the high/low for the window. Let me see what I can come up with, unless someone beats me to it...

I think the non-elegant way would be to pick the latest open price and create, say 100 lines (depending on your desired step) above and below the price and when the current bar shifts

move the objects.

Try these?

OBJPROP_XDISTANCE 102 int Integer value to set/get anchor X distance object property in pixels.
OBJPROP_YDISTANCE 103 int Integer value is to set/get anchor Y distance object property in pixels.

 

Ha! I found it. It's an indicator called SweetSpotsGOLD and it plots a line in whatever size increment you need (for use on a 5-digit broker, I just added a zero, so 25 became 250). I also found an older version called SweetSpots that only plotted every 50 pips.


arachnode, thanks so much for looking into this and I never thought it would be me beating you to the punch! <grin>


I would post the code but I ran into a few forums where the author asked that code that he posts not be posted on other forums. If you search the net, though, there are even EAs based on it. Go figure.


Cheers,


.....Sean


gl/gt

 

Hello,

A Tool: Horizontal Grid Plotter

Best regards,

Ais

 
Ais:

Hello,

A Tool: Horizontal Grid Plotter

Best regards,

Ais

Hi, Ais


Very nice. Thanks a lot!


.....Sean

Reason: