LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE [SOLVED]
LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
I am looking for a single line to be drawn like a Line Graph based on close. However instead of using the close price, the code should plot the high of the bar,if the bar is an UpBar and the low of the bar ,if the bar is a DownBar. So in the end ,all we get is a Single line.I have this working for another platform.In the Picture,the yellow line is the High or Low line and the green line is the closing prices.I have also a attached a picture with OHLC bars to illustrate this concept.
- Attachments
-
- HIGHLOW-2.png
- (8.35 KiB) Not downloaded yet
-
- HIGHLOW-1.png
- (11.47 KiB) Not downloaded yet
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
What if C = C[1] ?
Try this:
Try this:
Code: Select all
var: plot.point(0);
if C > C[1] then Plot.point = H
else
if C < C[1] then Plot.point = L;
Plot1( Plot.point );
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
Thanks for the reply.I am getting a compile error though.
------ Compiled with error(s): ------
Unknown Function
line 7, column 0
------ Compiled with error(s): ------
Unknown Function
line 7, column 0
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
Please copy the code and try again.Thanks for the reply.I am getting a compile error though.
------ Compiled with error(s): ------
Unknown Function
line 7, column 0
I have corrected the missing PLOT number.
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
Thanks Mr TJ. It now works exactly as I needed. Really appreciate your help. I am posting a working picture for benefit of other users.
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE [SOLVED]
With the picture...
- Attachments
-
- HIGH LOW CHAR1.png
- (48.5 KiB) Not downloaded yet
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
Can this be enhanced such that we can give different color options for the Up and Down Waves ?
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: LINE GRAPH BUT BASED ON HIGH/LOW INSTEAD OF CLOSE
Go to Wiki
Look under
7 PowerLanguage Keyword Reference
Plotting (15 P)
Look up SetPlotColor
Look under
7 PowerLanguage Keyword Reference
Plotting (15 P)
Look up SetPlotColor