-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
552 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
FactCheck | ||
MarketData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
using MarketData, TimeSeries | ||
using Base.Test | ||
|
||
facts("Candlesticks") do | ||
using MarketData | ||
using TimeSeries | ||
|
||
context("doji") do | ||
@fact ohlc[find(doji(ohlc))].timestamp[1] --> Date(2000, 5, 30) | ||
@fact ohlc[find(doji(ohlc))].timestamp[2] --> Date(2000, 12, 11) | ||
@fact length(ohlc[find(doji(ohlc))]) --> 5 | ||
end | ||
using MarketTechnicals | ||
|
||
|
||
@testset "Candlesticks" begin | ||
|
||
|
||
@testset "doji" begin | ||
@test ohlc[find(doji(ohlc))].timestamp[1] == Date(2000, 5, 30) | ||
@test ohlc[find(doji(ohlc))].timestamp[2] == Date(2000, 12, 11) | ||
@test length(ohlc[find(doji(ohlc))]) == 5 | ||
end | ||
|
||
|
||
end # @testset "Candlesticks" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,39 @@ | ||
facts("Levels") do | ||
|
||
context("floor pivots") do | ||
@fact floorpivots(ohlc)["r3"].values[1] --> roughly(123.310, atol=.01) # values verified by various website calculators | ||
@fact floorpivots(ohlc)["r2"].values[1] --> roughly(119.52, atol=.01) | ||
@fact floorpivots(ohlc)["r1"].values[1] --> roughly(115.73, atol=.01) | ||
@fact floorpivots(ohlc)["pivot"].values[1] --> roughly(108.71, atol=.01) | ||
@fact floorpivots(ohlc)["s1"].values[1] --> roughly(104.92, atol=.01) | ||
@fact floorpivots(ohlc)["s2"].values[1] --> roughly(97.900, atol=.01) | ||
@fact floorpivots(ohlc)["s3"].values[1] --> roughly(94.110, atol=.01) | ||
@fact floorpivots(ohlc).timestamp[end] --> Date(2001,12,31) | ||
end | ||
|
||
context("woodiespivots") do | ||
# # @fact_approx_eq 97.37500000000001 value(wr4)[2] # values NEED to be verified with online calculators | ||
# # @fact_approx_eq 88.62500000000001 value(ws4)[2] | ||
@fact woodiespivots(ohlc)["r3"].values[1] --> roughly(124.465, atol=.01) | ||
@fact woodiespivots(ohlc)["r2"].values[1] --> roughly(118.480, atol=.01) | ||
@fact woodiespivots(ohlc)["r1"].values[1] --> roughly(113.655, atol=.01) | ||
@fact woodiespivots(ohlc)["pivot"].values[1] --> roughly(107.670, atol=.01) | ||
@fact woodiespivots(ohlc)["s1"].values[1] --> roughly(102.845, atol=.01) | ||
@fact woodiespivots(ohlc)["s2"].values[1] --> roughly(96.8625, atol=.01) | ||
@fact woodiespivots(ohlc)["s3"].values[1] --> roughly(92.035, atol=.01) | ||
@fact woodiespivots(ohlc).timestamp[end] --> Date(2001,12,31) | ||
end | ||
using Base.Test | ||
|
||
using MarketData | ||
using TimeSeries | ||
|
||
using MarketTechnicals | ||
|
||
|
||
@testset "Levels" begin | ||
|
||
|
||
@testset "floor pivots" begin | ||
# values verified by various website calculators | ||
@test isapprox(floorpivots(ohlc)["r3"].values[1] , 123.310, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["r2"].values[1] , 119.52, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["r1"].values[1] , 115.73, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["pivot"].values[1], 108.71, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["s1"].values[1] , 104.92, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["s2"].values[1] , 97.900, atol=.01) | ||
@test isapprox(floorpivots(ohlc)["s3"].values[1] , 94.110, atol=.01) | ||
@test floorpivots(ohlc).timestamp[end] == Date(2001,12,31) | ||
end | ||
|
||
|
||
@testset "woodiespivots" begin | ||
# @test_approx_eq 97.37500000000001 value(wr4)[2] # values NEED to be verified with online calculators | ||
# @test_approx_eq 88.62500000000001 value(ws4)[2] | ||
@test isapprox(woodiespivots(ohlc)["r3"].values[1] , 124.465, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["r2"].values[1] , 118.480, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["r1"].values[1] , 113.655, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["pivot"].values[1], 107.670, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["s1"].values[1] , 102.845, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["s2"].values[1] , 96.8625, atol=.01) | ||
@test isapprox(woodiespivots(ohlc)["s3"].values[1] , 92.035, atol=.01) | ||
@test woodiespivots(ohlc).timestamp[end] == Date(2001,12,31) | ||
end | ||
|
||
|
||
end # @testset "Levels" |
Oops, something went wrong.