stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Vertical Line Code?
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4514
Page 1 of 1
Author:  Big Be [ Wed Nov 25, 2015 7:38 pm ]
Post subject:  Vertical Line Code?

Is there a way to draw a long vertical line as an object?
Even if a bunch of stacked segments?

Big Be
Author:  milanese [ Wed Nov 25, 2015 9:08 pm ]
Post subject:  Vertical Line Code?

Big Be » Wed Nov 25, 2015 7:38 pm wrote:Is there a way to draw a long vertical line as an object?
Even if a bunch of stacked segments?

Big Be
not sure if I understood your question right, but maybe this helps you ---> http://docs.mql4.com/constants/objectco ... /obj_vline

Cheers :)

Tommaso
Author:  Big Be [ Wed Nov 25, 2015 9:37 pm ]
Post subject:  Vertical Line Code?

Not quite. I need it to have finite top and bottom ends, adjustable within my program.

Big Be
Author:  AnotherBrian [ Thu Nov 26, 2015 1:12 am ]
Post subject:  Vertical Line Code?

Big Be » Wed Nov 25, 2015 4:37 pm wrote:Not quite. I need it to have finite top and bottom ends, adjustable within my program.

Big Be
code it as a trendline, just vertical. Turn off "ray".
Author:  Big Be [ Thu Nov 26, 2015 6:43 am ]
Post subject:  Vertical Line Code?

AnotherBrian » Wed Nov 25, 2015 5:12 pm wrote:
Big Be » Wed Nov 25, 2015 4:37 pm wrote:Not quite. I need it to have finite top and bottom ends, adjustable within my program.

Big Be
code it as a trendline, just vertical. Turn off "ray".
AnotherBrian,
Well, you DID answer what I asked!

Unfortunately I did not know enough to refine the questions -
I am trying to add this on top of a grid of objects (similar to a spreadsheet but showing signals icons such as little squares and stars). I want to separate two groups of columns using the vertical line. The existing objects are all referenced to the edge of the window, not to the time or price, which is what the Trendline does.
Author:  SteveHopwood [ Thu Nov 26, 2015 7:21 pm ]
Post subject:  Vertical Line Code?

I am not going to get deeply involved in this because I hate computer graphics, so I merely offer this.

You are looking to draw 'objects' on your chart, so start by investigating OBJPROP

For example, an object is printed on the chart with an x and a y axis. These are set by using the OBJPROP_XDISTANCE and OBJPROP_YDISTANCE.

For example, here is my use in an ea I coded for a client:

Code: Select all

ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
where 'name' is the name of the button I created, and 'x, y' are the points on the chart x and y axis, in pixels.

I am probably not explaining this very well because I struggle with it myself. Perhaps it will help you get started - or maybe someone else will come along and help a bit more comprehensively.

I hope you get this sorted out.

:xm:
Author:  renexxxx [ Mon Nov 30, 2015 7:16 am ]
Post subject:  Vertical Line Code?

Big Be » Thu Nov 26, 2015 4:43 pm wrote: I am trying to add this on top of a grid of objects (similar to a spreadsheet but showing signals icons such as little squares and stars). I want to separate two groups of columns using the vertical line. The existing objects are all referenced to the edge of the window, not to the time or price, which is what the Trendline does.
Sorry to get so late to the party ... I've been away. If you want to place vertical lines on the chart, relative to an (x, y) position, and not to a chart time, you can use the OBJ_RECTANGLE_LABEL object. As an example have a look at the attached script. I'm sure you will work out how to draw horizontal lines now.

Rene.
Author:  Big Be [ Mon Nov 30, 2015 7:32 pm ]
Post subject:  Vertical Line Code?

Thanks Steve,
Thanks renexxxx,
I did find a way to do it by stacking pipe '|' characters.

renexxxx, your script does not give me a line. See attached.
Also, there is no way to remove the graphics from the chart?
Author:  AnotherBrian [ Mon Nov 30, 2015 7:35 pm ]
Post subject:  Vertical Line Code?

Big Be » Mon Nov 30, 2015 2:32 pm wrote:Thanks Steve,
Thanks renexxxx,
I did find a way to do it by stacking pipe '|' characters.

renexxxx, your script does not give me a line. See attached.
Also, there is no way to remove the graphics from the chart?
ObjectDelete() to remove stuff
Author:  SteveHopwood [ Mon Nov 30, 2015 11:13 pm ]
Post subject:  Vertical Line Code?

Big Be, the brevity of Rene's recent post should lead you to consider the irritation he is feeling.

The script he offered you should contain enough clues as to how you should proceed.

Those of us at SHF who know what we are talking about are mostly glad to help newbies on their way. Having done so, we expect said noobs to do some thinking for them selves.

The previous para was the gentle version of what I am saying.

Here is the blunt version.

Rene has handed on a plate to you the basics of what you need to know. The rest is up to you to find for yourself. Stop being wet and pathetic, and find the stuff you need given the pointers you have from Rene.

This thread is now locked.

:xm:
All times are UTC Page 1 of 1