DBIx::Chart "real" Candlestick

DBIx::Chart "real" Candlestick

am 29.07.2007 20:51:56 von tomtailor

Hello

Do anybody know how to draw a real candlesick bar chart with open,
high, low, close instead of high and low?
A "real" candlestick = http://tinyurl.com/3yayg7
DBD::Chart candlestick = http://www.presicient.com/dbdchart/dbdchart_frame.html#candl estick

Maybe I can combine 2 kind of charts to make it look like a real
candlestick?

Thanks for Help!

Christian Maier

PS testable sample code snipped (looks a bit wired yet cause of open,
high, low and close):
#!/usr/bin/perl

use DBI;

$dbh = DBI->connect('dbi:Chart:', undef, undef);

# multrange 3D barchart with imagemap
#

my @date = ("2007-01-01", "2007-01-02");
my @open = (10, 13);
my @high = (12, 13);
my @low = (9, 10);
my @close= (11, 12);

$dbh->do('CREATE TABLE candletest (datum date, o integer, h integer, l
integer, c integer)');
$sth = $dbh->prepare('INSERT INTO candletest VALUES(?, ?, ?, ?, ?)');

$sth->execute($date[0], $open[0], $high[0], $low[0], $close[0]);
$sth->execute($date[1], $open[1], $high[1], $low[1], $close[1]);

$sth = $dbh->prepare("SELECT candlestick from candletest
WHERE WIDTH=400 AND HEIGHT=400 AND
title = 'Sample THREE_D Bar Chart' AND
signature = 'Copyright(C) 2001, Presicient Corp.' AND
X_AXIS = 'datum' AND
Y_AXIS = 'high' AND
SHAPE='fillsquare' AND
SHOWGRID = 1 AND
COLORS=(red, blue) AND
SHOWVALUES=1 AND
MAPNAME = 'candlesample' AND
mapURL = 'http://www.presicient.com/samplemap.pl'"
);

$sth->execute;
$row = $sth->fetchrow_arrayref;

open(BAR, '>samp3dbar5.png');
binmode BAR;
print BAR $$row[0];
close BAR;
$dbh->do('DROP table candletest');
print "Candlestick Chart OK\n";

Re: DBIx::Chart "real" Candlestick

am 31.07.2007 18:11:53 von darnold

Christian Maier wrote:
> Hello
>
> Do anybody know how to draw a real candlesick bar chart with open,
> high, low, close instead of high and low?
> A "real" candlestick = http://tinyurl.com/3yayg7
> DBD::Chart candlestick = http://www.presicient.com/dbdchart/dbdchart_frame.html#candl estick
>
> Maybe I can combine 2 kind of charts to make it look like a real
> candlestick?
>
> Thanks for Help!
>
> Christian Maier
>

Sorry, no (or not yet). Another item on the (altogether too long)
TODO list, and I don't know when I'll be able to get a new release
out. Patches welcome.

You might be able to hack something with stacked floating barcharts,
but thats probably as close as you'll get with the current code.

Dean Arnold
Presicient Corp.

Re: DBIx::Chart "real" Candlestick

am 31.07.2007 22:19:12 von davidnicol

http://gnuplot.sourceforge.net/demo_4.3/candlesticks.html

On 7/31/07, Dean Arnold wrote:
> Christian Maier wrote:
> > Hello
> >
> > Do anybody know how to draw a real candlesick bar chart with open,
> > high, low, close instead of high and low?

--
Prioritize based on common sense?
Is that some kind of joke?