SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

OPEN CLOSE LOW HIGH PLOT

Name:
    OPEN CLOSE LOW HIGH PLOT
Type:
    Graphics Command
Purpose:
    Generates an open-close-low-high plot.
Description:
    Open-close-low-high plots are used to display data where there is an opening value, a closing value and minimum and maximum values for a given time unit. For example, it can be used to display daily stock prices over a period of time. However, it can be applied to any data where there are start and end values for each time unit.

    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,

      Trace 1 - this is the line between the minimum and maximum value for cases where the closing value is higher than the opening value
      Trace 2 - this is the line between the minimum and maximum value for cases where the closing value is lower than the opening value
      Trace 3 - this is the horizontal line for the opening value for cases where the closing value is higher than the opening value
      Trace 4 - this is the horizontal line for the closing value for cases where the closing value is higher than the opening value
      Trace 5 - this is the horizontal line for the opening value for cases where the closing value is lower than the opening value
      Trace 6 - this is the horizontal line for the closing value for cases where the closing value is lower than the opening value

    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.

Syntax 1:
    OPEN CLOSE LOW HIGH PLOT <yopen> <yclose> <ylow> yhigh>
                            <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.

Syntax 2:
    OPEN CLOSE LOW HIGH PLOT <yopen> <yclose> <ylow> <yhigh> <x>
                            <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.
Examples:
    OPEN CLOSE LOW HIGH PLOT YOPEN YCLOSE YLOW YHIGH
    OPEN CLOSE LOW HIGH PLOT YOPEN YCLOSE YLOW YHIGH X
Note:
    The width of the horizontal lines can be controlled by entering the command

      SET CANDLESTICK PLOT BAR WIDTH <value>

    The default value is -1 which means Dataplot will use

      (X(2) - X(1))/2

    where X is the horizontal axis value.

Note:
    The CANDLESTICK PLOT displays the same information as the OPEN CLOSE LOW HIGH PLOT command, but in a different format.
Default:
    None
Synonyms:
    OCLH PLOT
Related Commands: Reference:
    Rockefeller, Barbara (2014), "Technical Analysis for Dummies," 3rd Edition, Wiley Publishing, Inc.
Applications:
    Financial Graphics
Implementation Date:
    2025/07
Program:
     
    . 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].