| 1 |
<html><h1>stock</h1><img src="stock.gif"><p> |
| 2 |
<a href="gall.using.html">How to download and try this example</a><br> |
| 3 |
<a href="stock.eps">Download the PostScript equivalent</a><pre><b> |
| 4 |
|
| 5 |
Usage: pl -gif stock.htm |
| 6 |
Data source: http://quote.yahoo.com "Spreadsheet format" |
| 7 |
<hr></b> |
| 8 |
|
| 9 |
#proc page |
| 10 |
#if @DEVICE in gif,png |
| 11 |
scale: 0.7 |
| 12 |
#endif |
| 13 |
|
| 14 |
//<b> read data file using <a href="../doc/getdata.html">proc getdata</a></b> |
| 15 |
#proc getdata |
| 16 |
file: stock.csv |
| 17 |
delimit: comma |
| 18 |
// showresults: yes |
| 19 |
|
| 20 |
|
| 21 |
//<b> reverse the record order, since the data is provided in reverse chronological |
| 22 |
// order, using <a href="../doc/transform.html">proc transform</a></b> |
| 23 |
#proc transform |
| 24 |
action: reverse |
| 25 |
|
| 26 |
//<b> define top plotting area using <a href="../doc/areadef.html">proc areadef</a></b> |
| 27 |
#proc areadef |
| 28 |
title: Trailer Tongue Technologies Corp. |
| 29 |
rectangle: 1 3 5 5 |
| 30 |
xscaletype: date dd-mmm-yy |
| 31 |
xrange: 01-Jan-99 01-Jun-99 |
| 32 |
yrange: 45 65 |
| 33 |
yscaletype: log |
| 34 |
#saveas: A |
| 35 |
|
| 36 |
//<b> set up X axis using <a href="../doc/xaxis.html">proc xaxis</a></b> |
| 37 |
#proc xaxis |
| 38 |
stubs: inc 1 month |
| 39 |
stubformat: Mmmyy |
| 40 |
grid: color=skyblue |
| 41 |
|
| 42 |
//<b> set up Y axis using <a href="../doc/yaxis.html">proc yaxis</a></b> |
| 43 |
#proc yaxis |
| 44 |
stubs: inc 5 |
| 45 |
grid: color=skyblue |
| 46 |
|
| 47 |
|
| 48 |
//<b> draw hi low bars using <a href="../doc/bars.html">proc bars</a></b> |
| 49 |
#proc bars |
| 50 |
locfield: 1 |
| 51 |
segmentfields: 3 4 |
| 52 |
thinbarline: color=gray(0.8) |
| 53 |
|
| 54 |
//<b> draw closing price curve using <a href="../doc/lineplot.html">proc lineplot</a></b> |
| 55 |
#proc lineplot |
| 56 |
xfield: 1 |
| 57 |
yfield: 5 |
| 58 |
linedetails: width=0.3 color=green |
| 59 |
|
| 60 |
//<b> compute and render moving average curve using <a href="../doc/curvefit.html">proc curvefit</a></b> |
| 61 |
#proc curvefit |
| 62 |
xfield: 1 |
| 63 |
yfield: 5 |
| 64 |
order: 50 |
| 65 |
legendlabel: 50 day\nmoving avg |
| 66 |
linedetails: color=orange |
| 67 |
|
| 68 |
//<b> render legend <a href="../doc/legend.html">proc legend</a></b> |
| 69 |
#proc legend |
| 70 |
location: max-2 max |
| 71 |
|
| 72 |
// do volume |
| 73 |
|
| 74 |
//<b> define bottom plotting area using <a href="../doc/areadef.html">proc areadef</a></b> |
| 75 |
#proc areadef |
| 76 |
#clone: A |
| 77 |
rectangle: 1 1.6 5 2.6 |
| 78 |
yrange: 0 30000000 |
| 79 |
yscaletype: linear |
| 80 |
title: |
| 81 |
|
| 82 |
//<b> set up X axis using <a href="../doc/xaxis.html">proc xaxis</a></b> |
| 83 |
#proc xaxis |
| 84 |
ticincrement: 1 month |
| 85 |
grid: color=skyblue |
| 86 |
label: Volume (1000s) |
| 87 |
labeldetails: adjust=0,0.2 size=8 |
| 88 |
|
| 89 |
//<b> set up Y axis using <a href="../doc/yaxis.html">proc yaxis</a></b> |
| 90 |
#proc yaxis |
| 91 |
stubs: inc 10000 1000 |
| 92 |
grid: color=skyblue |
| 93 |
|
| 94 |
//<b> render histogram using <a href="../doc/bars.html">proc bars</a></b> |
| 95 |
#proc bars |
| 96 |
barwidth: 0.001 |
| 97 |
locfield: 1 |
| 98 |
lenfield: 6 |
| 99 |
thinbarline: color=green |
| 100 |
|