util_line2d: Adds line chart to existing plot

Description Usage Arguments Value Author(s) Examples

View source: R/plot.R

Description

Adds another line chart on the existing plot using a time series of metric values.

Usage

1
util_line2d(metric,legend="")

Arguments

metric

Time series of (time, value) returned by metric functions.

legend

Legend of the line

Value

plot

Author(s)

Kostin Andrey <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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) 
positionSPY=position_add(portfolio,'SPY',500,priceData=spy.data) 
plot(log_return(positionGOOG),title="Positions returns",legend="GOOG")+
util_line2d(compute(log_return(positionAAPL))[[1]],legend="AAPL")+
util_line2d(compute(log_return(positionSPY))[[1]],legend="SPY")

## End(Not run)

PortfolioEffectHFT documentation built on May 30, 2017, 3:08 a.m.