Skip to Content

Simple {PairTrading}

Create trading Signal
Package: 
PairTrading
Version: 
1.1

Description

Create trading signal by the spread of stock pair. This function provide you the simplest method to create signal in the meaning that it just create signals according to whether spread is over a threshold or not.

Usage

Simple(spread, spread.entry)

Arguments

spread
the spread of stock pair. an xts object
spread.entry
Entry level of spread. single scalar.

Details

This function generates trading singal by spread and it's threshold.

Examples

#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)

Author(s)

Shinichi Takayanagi, Kohta Ishikawa

Documentation reproduced from package PairTrading, version 1.1. License: BSD