|
CANDLESTICK PLOTName:
Specifically, it draws a box between the opening and closing values. In addition, it draws a line from the open/close values to the minimum and maximum values for the time unit. The appearance of the plot can be controlled by settings for the LINE and REGION and their associated attribute setting commands. Specifically,
Note that the REGION FILL switch is automatically set to ON for the first 2 traces. Two common choices are:
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.
CANDLESTICK 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
.
region fill color blue red
line blank blank solid solid
line color blue red black black
.
. Step 3: Generate the plot
.
title Candlestick Plot
y1label Price
x1label Date
x2label Blue: Close > Open, Red: Close < Open
.
candlestick plot yopen yclose ylow yhigh
Date created: 07/16/2025 |
Last updated: 07/16/2025 Please email comments on this WWW page to [email protected]. | ||||||||||||||||||||||||||||||||||||||||