powered by
Counts the number of days the open price has moved consecutively Negative and positive streaks are represented by their sign; only works with various types of returns or mutated vector created by diff()
streak_var(df, var)
Returns a 1 x # of columns in df dataframe
Dataframe with price data.
String of column name you wish to see streak in
streak_var(tail(SPYdaily,200), "tot_ret")
Run the code above in your browser using DataLab