Order line code help please

 

Normally pending order lines, current trades, TP's and SL's run the entire horizontal length of chart and I was wondering if there is a way to write logic for EA so that the lines are 'compartmentalized' into a smaller sector surrounding current price.

Perhaps at the very least, I don't understand why MT4 does not have the lines terminate where the 'chart shift' point is.

I want this because, if you have quite a few orders etc, it tends to clutter the screen and interfere with any graphics you might have showing on the RHS.

Any help of sample code would be appreciated

Thanks

OceanFx

 

??

Anyone?...........

 

The lines you mention can be switched off by unclicking 'Show Trade Levels' from the 'Tools' menu.

Once done, 'custom' trade lines could be coded into an EA, so what you ask is possible to do, but each EA would need a 'custom refit'...

 

... or maybe the custom trade lines could be drawn by an indicator? as way of avoiding "custom refit"...

 

Hmmm thanks

Thanks Guys

I was aware that you can switch off the 'show order lines' in Tools but I didn't think about approaching it from a 'new indicator' point of view.

Another case of trying to bend the existing setup when I should have ripped the whole thing out and started over.

I suppose the most efficient method would be to write a small indicator maybe named "Show orders" which 'senses' present and pending trades etc placing the lines wherever you wish?

Hmm, OK.....now if only I could code. LOL It's OK, I have a C++ programmer I am paying but he is a bit lost with MT4 and I required input so thanks again.

However, if anyone can knock up a piece of sample code to guide him on his way, it would be helpful.

Thanks!

OceanFx

 

The attached indicator can be a start point. I suppose you'll need to add ticket number decoration as well as a marker of the open time, etc. etc. there are of course all sorts of things one can do....

Files:
 

Thanks Ralph

Thanks Ralph, that's really kind of you to make the effort.

I will give it a burl and no doubt it shall assist my programmer.

Much appreciated

OceanFx

Reason: