This file contains hidden or 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
| macro select(ex::Expr, sym1::Symbol, ex1::Expr, sym2::Symbol, ex3::Expr) | |
| ex.args, sym1, ex1.args, sym2, ex3.args | |
| end | |
| julia> @select open, high, close in ohlcv where close > open when day=Friday | |
| (Any[:open,:high,:(close in ohlcv)],:where,Any[:>,:close,:open],:when,Any[:day,:Friday]) | |
| # would be nice to do this instead of a one-liner | |
| @select open, high, close |
This file contains hidden or 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
| type Foo | |
| f::Function | |
| end | |
| bar = Foo(x->2x) | |
| bar.f(2) | |
| 4 | |
This file contains hidden or 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
| # BA.csv | |
| Date,Open,High,Low,Close | |
| 2013-12-31,136.16,137.05,135.74,136.49 | |
| 2013-12-30,137.16,137.37,135.54,135.92 | |
| 2013-12-27,138.69,138.88,136.79,136.9 | |
| 2013-12-26,137.18,138.59,137.17,138.27 | |
| 2013-12-24,136.4,136.98,136.14,136.83 | |
| 2013-12-23,137.69,138.09,136.32,136.4 | |
| 2013-12-20,135.49,137.85,135.49,136.67 |
This file contains hidden or 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> using Grist #brings in Reactive and other experimental packages | |
| julia> res | |
| 10-element Array{Timestamps.Timestamp{T},1}: | |
| 2000-01-03 | 200 Stock 95.0 $ AAPL | |
| 2000-03-15 | -100 Stock 116.25 $ AAPL | |
| 2000-05-25 | 100 Stock 87.27 $ AAPL | |
| 2000-08-07 | -100 Stock 47.94 $ AAPL | |
| 2000-10-17 | 100 Stock 20.12 $ AAPL | |
| 2000-12-28 | -100 Stock 14.81 $ AAPL |
This file contains hidden or 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> res | |
| 10-element Array{Timestamps.Timestamp{T},1}: | |
| 2000-01-03 | 100 Stock 111.94 $ AAPL | |
| 2000-03-15 | -100 Stock 116.25 $ AAPL | |
| 2000-05-25 | 100 Stock 87.27 $ AAPL | |
| 2000-08-07 | -100 Stock 47.94 $ AAPL | |
| 2000-10-17 | 100 Stock 20.12 $ AAPL | |
| 2000-12-28 | -100 Stock 14.81 $ AAPL | |
| 2001-03-13 | 100 Stock 19.56 $ AAPL | |
| 2001-05-23 | -100 Stock 23.23 $ AAPL |
This file contains hidden or 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> LIST = ["foo", "bar"] | |
| 2-element Array{ASCIIString,1}: | |
| "foo" | |
| "bar" | |
| julia> for L in LIST | |
| @eval begin | |
| type ($L) | |
| end | |
| end |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="/Users/Administrator/.julia/v0.4/Bokeh/deps/bokehjs/css/bokeh.min.css" type="text/css" /> | |
| <script type="text/javascript" src="/Users/Administrator/.julia/v0.4/Bokeh/deps/bokehjs/js/bokeh.min.js"></script> | |
| <script type="text/javascript"> | |
| $(function() { | |
| var modelid = "e4aa998b-b915-4d5c-aa38-4d76437c4fbf"; |
This file contains hidden or 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> function L(c) | |
| sum([abs(xs-c)^2 for xs in x])/length(x) | |
| end | |
| L (generic function with 2 methods) | |
| julia> x=[1,2,3,4,5,6,9,12] | |
| 8-element Array{Int64,1}: | |
| 1 | |
| 2 | |
| 3 |
This file contains hidden or 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> using Quandl, TextPlots | |
| julia> bt = quandl("BAVERAGE/USD", rows=1000) | |
| 1000x5 TimeArray{Float64,2} 2011-08-25 to 2014-05-23 | |
| 24h Average Ask Bid Last Total Volume | |
| 2011-08-25 | 10.01 NaN NaN NaN 55547.42 | |
| 2011-08-26 | 8.65 NaN NaN NaN 83026.56 | |
| 2011-08-27 | 8.63 NaN NaN NaN 22010.04 | |
| 2011-08-28 | 8.97 NaN NaN NaN 24159.85 |
This file contains hidden or 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
| 1 #!/bin/bash | |
| 2 | |
| 3 cd ~/git/quantstrat | |
| 4 git svn rebase | |
| 5 git push origin master | |
| 6 | |
| 7 cd ~/git/xts | |
| 8 git svn rebase | |
| 9 git push origin master | |
| 10 |
NewerOlder