Description Usage Arguments Value Examples
This function will return a vector of buy/sell signals based on whether
or not the current value of x
is above or below the price of
x
. If the current price is above, the return entry is 1 otherwise
the return entry will be zero. The return vector will be of length
x
- lookback
. This function aids in building a smooth
momentum signal by calling simpSignal() with many values of lookback
and averaging the results.
1 | simpSignal(x, lookback = 12)
|
x |
an xts object of prices. |
lookback |
the length of the look back period over which to evalute the momentum signal. |
an xts object of discrete momentum signals drawn from the set c(-1,1), where -1 indicates "short" or "sell" and 1 indicates "long" or "buy".
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.