superfluous_filter {atmi} | R Documentation |
Successively arranges buy and sell signals of a trading strategy.
superfluous_filter(datavec, buy, sell)
datavec |
a vector of security prices. |
buy |
a vector of indices of a data vector, where the buy signals occurred. |
sell |
a vector of indices of a data vector, where the sell signals occurred. |
It is not allowed, that a buy and a sell signal occur on the same day.
buy |
vector of the buy signals. |
sell |
vector of the sell signals. |
Waldemar Kemler, Peter Schaffner
atmirsi
, atmimacd
, atmimomentum
datavec<-c(20,25,30,27,22,18,18,24,25,27) superfluous_filter(datavec, buy=c(NA,2,NA,6), sell=c(26,1,8,9,15,18,NA))