Learn R Programming

PortfolioEffectHFT (version 1.7)

util_plot2d: Line plot of portfolio metric (for a time series)

Description

Draws a new line plot using a time series of metric values.

Usage

util_plot2d(metric, title=NULL, subtitle=NULL, font_size=10, line_size=1.2, bw=FALSE, legend="", axis.text.size=1.5, title.size=2)

Arguments

metric
Time series of (time, value) returned by metric functions.
title
Plot title.
subtitle
Plot subtitle.
font_size
Baseline font size.
line_size
Line thickness.
bw
Black and white color scheme flag.
legend
Plot legend.
axis.text.size
Axis font size.
title.size
Title font size.

Value

Examples

Run this code
## Not run: 
# data(aapl.data) 
# data(goog.data) 
# data(spy.data) 
# portfolio=portfolio_create(priceDataIx=spy.data)
# portfolio_settings(portfolio,portfolioMetricsMode="price",windowLength = '3600s')
# positionGOOG=position_add(portfolio,'GOOG',100,priceData=goog.data)   
# positionAAPL=position_add(portfolio,'AAPL',300,priceData=aapl.data) 
# util_plot2d(compute(log_return(portfolio))[[1]],title="Portfolio return")
# ## End(Not run)

Run the code above in your browser using DataLab