Skip to content

Instantly share code, notes, and snippets.

@milktrader
Created January 7, 2014 02:44
Show Gist options
  • Save milktrader/8293900 to your computer and use it in GitHub Desktop.
Save milktrader/8293900 to your computer and use it in GitHub Desktop.
Nascent backtest framework in Julia
julia> using Series, MarketTechnicals, Jig.Quant
julia> fast = sma(cl, 10);
julia> slow = sma(cl, 30);
julia> sig = fast .> slow;
julia> dailyreturn = percentchange(cl, method="log");
julia> when(dailyreturn, index(istrue(sig))) |> x -> sum(value(x)) |> expm1
0.058731485780330786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment