|
OPEN CLOSE LOW HIGH PLOTName:
Specifically, it draws a line between the minimum and maximum values. It then adds horizontal lines at the opening and closing values (the opening values are drawn to the left of minimum/maximum line and closing values are drawn to the right of the minimum/maximum line. The appearance of the plot can be controlled by settings for the LINE command and its associated attribute setting commands. Specifically,
A common color scheme is to use green when the closing price is higher than the opening price and red when the closing pric is lower than the opening price. This is demonstrated in the Program example below.
<SUBSET/EXCEPT/FOR qualification> where <yopen> is the response variable containing the opening values; <yclose> is the response variable containing the closing values; <ylow> is the response variable containing the minimum values; <yhigh> is the response variable containing the maximum values; and where the <SUBSET/EXCEPT/FOR qualification> is optional. For this syntax, the x-axis value is set to the sequence number.
<SUBSET/EXCEPT/FOR qualification> where <yopen> is the response variable containing the opening values; <yclose> is the response variable containing the closing values; <ylow> is the response variable containing the minimum values; <yhigh> is the response variable containing the maximum values; <x> is the horizontal axis variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
OPEN CLOSE LOW HIGH PLOT YOPEN YCLOSE YLOW YHIGH X
The default value is -1 which means Dataplot will use
where X is the horizontal axis value.
. Step 1: Read the data
.
skip 25
column limits 13 80
read candlestick.dat yclose yopen ylow yhigh
skip 0
let n = size yopen
.
column limits 1 12
loop for k = 1 1 n
let irow = 25 + k
row limits irow irow
read string candlestick.dat s^k
end of loop
column limits
row limits
.
. Step 2: Set some plot control
.
case asis
title case asis
label case asis
tic mark label case asis
.
xlimits 1 27
major x1tic mark number 9
minor x1tic mark number 2
x1tic mark label format alpha
x1tic mark label content ^s1 ^s4 ^s7 ^s10 ^s13 ^s16 ^s19 ^s22 ^s25
tic mark offset units data
x1tic mark offset 0.8 3.8
x1tic mark label size 1.5
.
line solid all
line color green red green red green red
.
. Step 3: Generate the plot
.
title Open-Close-Low-High Plot
y1label Price
x1label Date
x2label Green: Close > Open, Red: Close < Open
.
open close low high plot yopen yclose ylow yhigh
Date created: 07/17/2025 |
Last updated: 07/17/2025 Please email comments on this WWW page to [email protected]. | |||||||||||||||||||||||||||||||||||||