Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dysonance committed Oct 4, 2018
1 parent 2dbada4 commit 737d80d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ end
@testset "Indicator" begin
global f(x; args...) = Indicators.mama(x; args...)
global indicator = Indicator(f, paramset)
@test indicator.fun == f
@test indicator.paramset == paramset
end

# define signals that will trigger trading decisions
@testset "Signal" begin
@testset "Construct" begin
global siglong = @signal MAMA FAMA
global sigshort = @signal MAMA FAMA
global sigexit = @signal MAMA .== FAMA
global sigexit = @signal MAMA == FAMA
@test siglong.fun.a == sigshort.fun.a == sigexit.fun.a == :MAMA
@test siglong.fun.b == sigshort.fun.b == sigexit.fun.b == :FAMA
end
end

Expand All @@ -59,6 +63,9 @@ end
global shortrule = @rule sigshort short 100
global exitrule = @rule sigexit liquidate 1.0
global rules = (longrule, shortrule, exitrule)
@test longrule.action == long
@test shortrule.action == short
@test exitrule.action == liquidate
end
end

Expand Down

0 comments on commit 737d80d

Please sign in to comment.