1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
<html><h1>candlesticks</h1><img src="candlesticks.gif"><p>
<a href="gall.using.html">How to download and try this example</a><br>
<pre><b>Usage: ploticus -png candlesticks.htm
Data source: quote.yahoo.com (Spreadsheet format)
Japanese candlesticks. Weekends are omitted.
<hr></b>
#proc page
#if @DEVICE in gif,png
scale: 0.7
#endif
#proc datesettings
omitweekends: yes
//<b> define top plotting area using <a href="../doc/areadef.html">proc areadef</a></b>
#proc areadef
title: Trailer Tongue Technologies Corp.
rectangle: 1 3 5 5
xscaletype: date dd-mmm-yy
xrange: 5-Apr-99 1-Jun-99
yrange: 50 60
yscaletype: log
#saveas: A
//<b> read data file using <a href="../doc/getdata.html">proc getdata</a></b>
#proc getdata
file: stock.csv
delimit: comma
fieldnames: date open high low close volume
//<b> reverse the record order, since the data is provided in reverse chronological
// order, using <a href="../doc/transform.html">proc processdata</a></b>
#proc processdata
action: reverse
//<b> set up X axis using <a href="../doc/xaxis.html">proc xaxis</a></b>
#proc xaxis
stubs: inc 5
stubformat: Mmmdd
stubrange: 5-Apr-99
grid: color=gray(0.8)
tics: none
#saveas: XAX
//<b> set up Y axis using <a href="../doc/yaxis.html">proc yaxis</a></b>
#proc yaxis
stubs: inc 2
// grid: color=gray(0.8)
axisline: none
tics: none
//<b> draw red (up) candlestick bars using <a href="../doc/bars.html">proc bars</a></b>
// thin high/low bar..
#proc bars
select: @@close > @@open
locfield: date
segmentfields: low high
thinbarline: width=0.3 color=red
// thicker open/close bar..
#proc bars
select: @@close > @@open
locfield: date
segmentfields: open close
barwidth: 0.04
outline: no
color: red
//<b> draw blue (down) candlestick bars using <a href="../doc/bars.html">proc bars</a></b>
// thin high/low bar..
#proc bars
select: @@close <= @@open
locfield: date
segmentfields: low high
thinbarline: width=0.3 color=blue
// thicker open/close bar..
#proc bars
select: @@close <= @@open
locfield: date
segmentfields: open close
barwidth: 0.04
outline: no
color: blue
// do volume
//<b> define bottom plotting area using <a href="../doc/areadef.html">proc areadef</a></b>
#proc areadef
#clone: A
rectangle: 1 1.6 5 2.6
yrange: 0 5000000
yscaletype: linear
title:
//<b> set up X axis using <a href="../doc/xaxis.html">proc xaxis</a></b>
#proc xaxis
label: Volume (1000s)
ticincrement: 5
grid: color=gray(0.8)
labeldetails: adjust=0,0.2 size=8
axisline: none
tics: none
//<b> set up Y axis using <a href="../doc/yaxis.html">proc yaxis</a></b>
#proc yaxis
stubs: inc 1000 1000
grid: color=gray(0.8)
axisline: none
tics: none
//<b> render histogram using <a href="../doc/bars.html">proc bars</a></b>
#proc bars
barwidth: 0.04
color: dullyellow
locfield: 1
lenfield: 6
outline: no
|