powered by
Converts MK (or other) slopes to integers 1-2-3 (negative, none, positive). These indices can be used to indicate trend direction.
ch_tr_sign(x, offset = 2)
Returns an array of indices (1, 2, 3)
an array of slopes
the amount of shift to make values positive integers, default is 2.
Paul Whitfield
mkin <- c( -0.23, 0.34, 0.0, .033, -0.55) mkout <- ch_tr_sign(mkin) # 1 3 2 3 1
Run the code above in your browser using DataLab