Description Usage Arguments Value Author(s) References See Also Examples
This function transforms a set of numeric values into a set of trading signals according to two thresholds: one that establishes the limit above which any value will be transformed into a buy signal ('b'), and the other that sets the value below which we have a sell signal ('s'). Between the two thresholds we will have a hold signal ('h').
1 | trading.signals(vs, b.t, s.t)
|
vs |
A vector with numeric values |
b.t |
A number representing the buy threshold |
s.t |
A number representing the sell threshold |
A factor with three possible values 'b' (buy), 's' (sell) or 'h' (hold)
Luis Torgo ltorgo@dcc.fc.up.pt
Torgo, L. (2010) Data Mining using R: learning with case studies, CRC Press (ISBN: 9781439810187).
http://www.dcc.fc.up.pt/~ltorgo/DataMiningWithR
trading.signals
, tradingEvaluation
, trading.simulator
1 | trading.signals(rnorm(sd=0.5,100),b.t=0.1,s.t=-0.12)
|
Loading required package: lattice
Loading required package: grid
[1] s h s s b h s h s h s h h s s s s s s h s b s h s b h b b b b b s b s h b
[38] s h b b b h s s b b b b b s s b s h b b s s s b b h s s b b b s b s s b s
[75] s b b b s b s b s h s b h b h h b h s h h s b b s s
Levels: s h b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.