[R-SIG-Finance] Threshold/Crossover

Brian G. Peterson brian at braverock.com
Sun Aug 19 13:38:31 CEST 2012

On 08/18/2012 10:12 PM, William Rechtin wrote:
> I'm building a SMI stratrgy using quantstrat and I'm wondering if
> anyone could explain situations when I would want to use the
> threshold function, versus the crossover function.


This begins to sound more and more like homework...

sigCrossover (and sigComparison) compare two columns of your data.  The 
classic example is a moving average cross.

sigThreshold compares the indicator to some threshold value of the 
indicator itself.  The classic example is any indicator that moves 
between bounded values such as -1 and +1 or 0 and 1.  If cross=TRUE, you 
are looking to generate a signal on the timestamp that the indicator 
crosses your threshold.

Stochastic Oscillators can be used to generate *both* threshold and 
crossover 'signals' in classic usage, as discussed in the documentation 
for the TTR function 'SMI'.

I'll leave it to you to sort out which columns of the SMI output you 
plan to use to generate your signals, and whether you're using a 
threshold value for overbought/oversold, or a crossover signal on %K/%D 


    - Brian

Brian G. Peterson
Ph: 773-459-4973
IM: bgpbraverock

More information about the R-SIG-Finance mailing list