indicators: Trading indicators

Description Usage Arguments Details Value Author(s) Examples

Description

Various binary indicators for fts objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
above.ma(x,n)
below.ma(x,n)
wday(x)
mday(x)
## S3 method for class 'fts'
diff(x,k,...)
up(x)
down(x)
ema(x,periods)
gap.continue(x)
gap.direction(x)
gap.down(x)
gap.down.continue(x)
gap.down.reverse(x)
gap.reverse(x)
gap.up(x)
gap.up.continue(x)
gap.up.reverse(x)
higher.high(x)
higher.low(x)
hl.oc.ratio(x)
inside.day(x)
inside.day.direction(x)
inside.day.down(x)
inside.day.up(x)
lower.high(x)
lower.low(x)
ma.crossover(x,n)
ma.crossover.down(x,n)
ma.crossover.up(x,n)
ma.d(x,n)
ma.distance(x,periods)
month(x)
year(x)
monthly.sum(x)
new.high(x,n)
new.low(x,n)
outside.day(x)
outside.day.direction(x)
outside.day.down(x)
outside.day.up(x)
pct.chg(x)
repeated(x,times)
rsi(x,periods)
rsi.crossover(x,periods,thresh)
rsi.crossover.down(x,periods,thresh)
rsi.crossover.up(x,periods,thresh)
template.fts(index, cnames)
trend.day(x,thresh)
trend.day.down(x,thresh)
trend.day.up(x,thresh)

Arguments

x

An Fts object

periods

number of periods

n

number of periods

k

number of lags

times

how many times

thresh

threshold level

index

index to use to construct fts object

cnames

colnames to use to construct fts object

...

further arguments to function

Details

removed elements are replaced with NA

Value

an fts object

Author(s)

Whit Armstrong

Examples

1
2
3
4
x <- fts(index=seq(from=Sys.Date(),by="months",length.out=5),rnorm(5))
print(x)
lag(x,1)
lead(x,1)

Example output

Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

                 [,1]
2021-03-11 -0.5185889
2021-04-11  0.5183564
2021-05-11  0.9494782
2021-06-11  0.2947474
2021-07-11 -2.1467780
                 [,1]
2021-04-11 -0.5185889
2021-05-11  0.5183564
2021-06-11  0.9494782
2021-07-11  0.2947474
                 [,1]
2021-03-11  0.5183564
2021-04-11  0.9494782
2021-05-11  0.2947474
2021-06-11 -2.1467780

fts documentation built on May 2, 2019, 9:17 a.m.

Related to indicators in fts...