Description Usage Arguments Value Author(s) Examples
Draws a new line plot using a a dataframe with one or many metric values.
1 2 3 4 5 6 7 8 9 |
formula |
Formula that describes data titles to be plotted. |
data |
Dataframe with metric data. Dataframe must have a variable 'legend'. If you want to correctly display the time in POSIX format, name the variable as 'time'. |
title |
Plot title. |
subtitle |
Plot subtitle. |
font_size |
Baseline font size. |
line_size |
Line thickness. |
bw |
Black and white color scheme flag. |
axis.text.size |
Axis font size. |
title.size |
Title font size. |
plot
Kostin Andrey <andrey.kostin@portfolioeffect.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
portfolio=portfolio_create(fromTime="2014-10-02 09:30:00", toTime="2014-10-02 16:00:00")
portfolio_settings(portfolio,resultsSamplingInterval='60s')
positionSPY=position_add(portfolio,'SPY',500)
positionC=position_add(portfolio,'C',600)
metricSPY=compute(log_return(positionSPY))[[1]]
metricSPY=data.frame(metricSPY,legend="SPY return")
util_plot2df(value~time,metricSPY,title="Return, SPY")
metricC=compute(log_return(positionC))[[1]]
metricC=data.frame(metricC,legend="C return")
metric=rbind(metricSPY,metricC)
util_plot2df(value~time,metric,title="Return")
data(aapl.data)
data(goog.data)
data(spy.data)
AAPLprice=data.frame(Price=aapl.data[,'Value'],time=aapl.data[,'Time'],legend='AAPL price')
GOOGprice=data.frame(Price=goog.data[,'Value'],time=goog.data[,'Time'],legend='GOOG price')
SPYprice=data.frame(Price=spy.data[,'Value'],time=spy.data[,'Time'],legend='SPY price')
price=rbind(AAPLprice,GOOGprice,SPYprice)
util_plot2df(Price~time,price,title="Stock prices")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.