s-news
[Top] [All Lists]

Re: Candlestick plot

To: <s-news@wubios.wustl.edu>
Subject: Re: Candlestick plot
From: "Guy Yollin" <gyollin@insightful.com>
Date: Mon, 6 Aug 2007 10:35:15 -0700
Cc: "Olanrewaju Sanni" <o_sanni@yahoo.com>
In-reply-to: <52899.24244.qm@web62309.mail.re1.yahoo.com>
References: <52899.24244.qm@web62309.mail.re1.yahoo.com>
Thread-index: AcfYOs8t8U1fcevkSsqlBDxUcz/vyAAE8k5A
Thread-topic: [S] Candlestick plot

Given a time series object named price.ts with columns of "Open", "High", "Low", "Close", "Volume"

 

The following line should produce a trellis plot with candlesticks in the upper panel and volume bars in the lower panel:

 

trellisPlot(price.ts[,"Volume"],price.ts[,1:4],scales=list(y=list(relation="free")),

      plot.type=c("stackbar","hloc"),type="c",trellis.args=(list(lwd=2,col=4,line.col=2,width=0.03)))

 

The width may need to be adjusted depending on density of the data; the above setting work well for about 4 months of daily data.

 

 

Best,

 

-- Guy

 

 

 

Guy Yollin
Director of Financial Engineering
Insightful Corporation
gyollin@insightful.com

 

 

 

 


From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Olanrewaju Sanni
Sent: Monday, August 06, 2007 8:01 AM
To: s-news@wubios.wustl.edu
Subject: [S] Candlestick plot

 

Hi subscribers,

Can any tell me how to plot  candlestick chart with s-plus finmetrics.

 

Lanre Sanni

 

 


Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.

<Prev in Thread] Current Thread [Next in Thread>