Created
March 24, 2014 02:07
-
-
Save milktrader/9733018 to your computer and use it in GitHub Desktop.
How many golden crosses in SPX since 1950?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> @> Cl sma(50) x->merge(x,sma(Cl,200)) x->x["sma50"] .> x["sma200"] discretesignal | |
65x1 TimeArray{Int64,1} 1950-10-18 to 2012-01-31 | |
signals | |
1950-10-18 | 1.0 | |
1953-05-11 | 0.0 | |
1953-12-21 | 1.0 | |
1956-10-26 | 0.0 | |
⋮ | |
2010-07-02 | 0.0 | |
2010-10-22 | 1.0 | |
2011-08-12 | 0.0 | |
2012-01-31 | 1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually faster code and much simpler (omitting merge)