Skip to content

Instantly share code, notes, and snippets.

@milktrader
Created September 10, 2016 18:30
Show Gist options
  • Save milktrader/f2caa53a77f1bd9a738cb7edca5dee9f to your computer and use it in GitHub Desktop.
Save milktrader/f2caa53a77f1bd9a738cb7edca5dee9f to your computer and use it in GitHub Desktop.
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
in ohlc
where open > close
when day = friday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment