How to draw a horiz line? |
Post Reply |
Author | ||||
kneighbour
Regular Joined: 12 Feb 2005 Location: Australia Posts: 57 |
Post Options
Quote Reply
Topic: How to draw a horiz line? Posted: 27 Feb 2005 at 1:40pm |
|||
What i would like to do is draw a horizontal line at a calclated level. ie I want to draw a line at a set price (say $3.00) - how is this done?
|
||||
Peter
BullCharts Staff Joined: 09 Sep 2004 Location: Australia Posts: 241 |
Post Options Quote Reply Posted: 28 Feb 2005 at 9:42am | |||
If you want to draw some fixed horizontal lines, use the horzline attribute. Eg: [horzline=20,80]
If you want to draw a calculated line, just make the calculation and return it as a result. Eg: 3*5; If you want to make the calculation based on current prices, etc, then use the lastvalue function. Eg: lastvalue( Low * 0.9); This will calculate the result for the last bar and return that result on every bar. |
||||
kneighbour
Regular Joined: 12 Feb 2005 Location: Australia Posts: 57 |
Post Options Quote Reply Posted: 28 Feb 2005 at 8:09pm | |||
The way I read the manual, this puts lines at (in this example) the 20% and 80% points. Presumable on an oscillator. For aprice chart would I use [horzline=1.23] (for a line at $1.23)
So this would be [horzline=3*5] ??
So this would be [horzline=lastvalue( Low * 0.9)] ??
This raises a good point - presumably this would fill the screen with horizontal lines? Can you alter the width of a line? |
||||
Peter
BullCharts Staff Joined: 09 Sep 2004 Location: Australia Posts: 241 |
Post Options Quote Reply Posted: 01 Mar 2005 at 10:53am | |||
The horzline attribute only allows fixed numbers to be entered. (not
calculations). Therefore, to get around the problem, we just return the
calculation as a normal plot, but in such a way that it always returns
the same result and appears as a horizontal line. (this is how people
usually achieve horizontal lines in Metastock scripts).
Eg: {Fixed horizontal line} [horzline=20,80] {Calculated horizontal line) 5*10; {Calculated horizontal line based on price info } lastvalue( Low * 0.9) |
||||
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |