Skip to content

Instantly share code, notes, and snippets.

@milktrader
Created December 28, 2012 14:37
Show Gist options
  • Save milktrader/4398365 to your computer and use it in GitHub Desktop.
Save milktrader/4398365 to your computer and use it in GitHub Desktop.
getting market data into Julia
julia> require("Calendar")
julia> using Calendar
julia> require("DataFrames")
julia> using DataFrames
julia> require("Thyme")
julia> using Thyme
julia> spx = read_stock("spx.csv");
julia> check = falses(nrow(spx));
julia> for i in 1:nrow(spx)
check[i] = dayofweek(spx[i,1]) == 6
end
julia> within!(spx, quote
friday = DataVec($(check))
end)
julia> load("~/.julia/Mirepoix/dailyReturn.jl")
julia> dailyRET = daily_return(spx["Close"])
julia> within!(spx, quote
RET = $(dailyRET)
end)
julia> fridays = spx[spx["friday"] .== true]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment