dysonance / Strategems.jl

Quantitative systematic trading strategy development and backtesting in Julia
Other
163 stars 39 forks source link

Julia 0.7 #19

Closed femtotrader closed 5 years ago

codecov[bot] commented 5 years ago

Codecov Report

Merging #19 into master will increase coverage by 23.24%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #19       +/-   ##
=========================================
+ Coverage   76.75%   100%   +23.24%     
=========================================
  Files          11     10        -1     
  Lines         185    121       -64     
=========================================
- Hits          142    121       -21     
+ Misses         43      0       -43
Impacted Files Coverage Δ
src/results.jl 100% <ø> (ø) :arrow_up:
src/indicator.jl 100% <ø> (+66.66%) :arrow_up:
src/strategy.jl 100% <ø> (+23.17%) :arrow_up:
src/Strategems.jl 100% <ø> (ø) :arrow_up:
src/rule.jl 100% <100%> (+16.66%) :arrow_up:
src/paramset.jl 100% <100%> (+31.57%) :arrow_up:
src/universe.jl 100% <100%> (ø) :arrow_up:
src/portfolio.jl 100% <0%> (ø) :arrow_up:
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 133b58f...a5f2da2. Read the comment docs.

femtotrader commented 5 years ago

Some more work is still required for Julia 1.0 see depreciations with Julia 0.7

09:52 $ julia07 --version
julia version 0.7.0
✔ ~/.julia/dev/Strategems [julia07|✔]
09:52 $ julia07 test/runtests.jl
WARNING: importing deprecated binding Base.Void into Strategems.
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:7
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:7
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:7
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:7
Sourcing data for asset Corn...┌ Warning: `Pkg.dir(pkgname, paths...)` is deprecated; instead, do `import Temporal; joinpath(dirname(pathof(Temporal)), "..", paths...)`.
└ @ Pkg.API /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:454
Done.
Test Summary: | Pass  Total
Universe      |    2      2
Test Summary: | Pass  Total
Parameter Set |    1      1
Test Summary: |
Indicator     | No tests
Test Summary: |
Signal        | No tests
Test Summary: |
Rule          | No tests
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:65
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:65
Generating trades for asset Corn...┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::Regex` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│   caller = ip:0x0
└ @ Core :-1
┌ Warning: .== is no longer a function object, use `broadcast(==, ...)` instead.
│   caller = ip:0x0
└ @ Core :-1
Done.
Running backtest for asset Corn...Done.
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:65
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:65
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /Users/femto/.julia/dev/Strategems/test/runtests.jl:65
┌ Warning: `Array{T, 2}(m::Int, n::Int) where T` is deprecated, use `Array{T, 2}(undef, m, n)` instead.
│   caller = #get_param_combos#4(::Int64, ::Function, ::ParameterSet) at paramset.jl:30
└ @ Strategems ~/.julia/dev/Strategems/src/paramset.jl:30
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│   caller = #get_param_combos#4(::Int64, ::Function, ::ParameterSet) at paramset.jl:41
└ @ Strategems ~/.julia/dev/Strategems/src/paramset.jl:41
┌ Warning: The start/next/done iteration protocol is deprecated. Implement `iterate(::Strategems.EachRow{Array{Any,2}})`.
│   caller = ip:0x0
└ @ Core :-1
Run 1/10
Run 2/10
Run 3/10
Run 4/10
Run 5/10
Run 6/10
Run 7/10
Run 8/10
Run 9/10
Run 10/10
Test Summary: | Pass  Total
Strategy      |    2      2

We need to use the new iteration protocol (ie iterate, instead of start, stop, done)

Base.Void is deprecated we should use Nothing instead

...

femtotrader commented 5 years ago

Trying to replace start, stop, done in strategy.jl

function Base.iterate(itr::EachRow, state=(1, 0))
    element, count = state

    if count > size(itr.A,1)
        return nothing
    end

    return (element, (itr.A[count+1,:], count + 1))
end

but it doesn't seem to work

dysonance commented 5 years ago

Closing this one, work done on https://github.com/dysonance/Strategems.jl/pull/20