1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
3 |
tmp=/var/tmp/stock4gp |
tmp=/var/tmp/stock4gp |
4 |
|
dir=/data/corp/esi |
5 |
|
|
6 |
#psql -t -A -F " " corp -c "select date(date),min(current),avg(current),max(current),type,count(*) from stocks group by date(date),type order by type,date(date)" -o $tmp |
psql -t -A -F " " corp -c "select date(date),min(current),avg(current),max(current),type,count(*) from stocks group by date(date),type order by type,date(date)" -o $tmp |
7 |
cat $tmp | grep -i lse > $tmp-lse |
cat $tmp | grep -i lse > $tmp-lse |
8 |
cat $tmp | grep -i ftse > $tmp-ftse |
cat $tmp | grep -i ftse > $tmp-ftse |
9 |
|
|
10 |
gnuplot -persist << EOF |
gnuplot -persist << EOF |
11 |
set terminal png color |
set terminal png color |
12 |
set output 'out.png' |
set output '$dir/out.png' |
13 |
set noclip points |
set noclip points |
14 |
set clip one |
set clip one |
15 |
set noclip two |
set noclip two |
97 |
set locale "C" |
set locale "C" |
98 |
plot '/var/tmp/stock4gp-lse' using 1:3:2:4 title 'LSE' with yerrorbars, '/var/tmp/stock4gp-lse' using 1:3 title 'average' with lines |
plot '/var/tmp/stock4gp-lse' using 1:3:2:4 title 'LSE' with yerrorbars, '/var/tmp/stock4gp-lse' using 1:3 title 'average' with lines |
99 |
EOF |
EOF |
100 |
|
|
101 |
|
convert $dir/out.png -quality 90 $dir/stocks.jpg |