You could think of your problem as one of combining a signal
that tells when the state of the system should change to (or
remain at) on and a signal that tells when it should change to
off to come up with a series giving the state at each time point.
E.g.,
OnOrOff - function(toOn, toOff, wasOn){
I have loaded price data for GE and then calculated a 50 day simple moving
average. Then I have a created a ifelse statement that produce a 1 when
GE's closing price is above the simple moving average and a 0 when GE
Closing price is below the 50 day simple moving average.
However, what I
2 matches
Mail list logo