Description Usage Arguments Details Author(s) Examples
Create trading signal
1 | Simple(spread, spread.entry)
|
spread |
the spread of stock pair. an |
spread.entry |
Entry level of spread. single scalar. |
This function generates trading singal by spread and it's threshold.
Shinichi Takayanagi, Kohta Ishikawa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #load library
library(PairTrading)
#load sample stock price data
data(stock.price)
#select 2 stocks
price.pair <- stock.price[,1:2]["2008-12-31::"]
#estimate parameters for back test
params <- EstimateParametersHistorically(price.pair, period = 180)
#create & plot trading signals
signal <- Simple(params$spread, 0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.