-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from JuliaQuant/rewrite_tests
Rewrite tests
- Loading branch information
Showing
11 changed files
with
92 additions
and
92 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ before_install: | |
- git config --global user.email "[email protected]" | ||
script: | ||
- julia -e 'versioninfo(); Pkg.init();' | ||
- julia -e 'Pkg.clone("git://github.com/JuliaQuant/MarketTechnicals.jl.git"); Pkg.add("TimeSeries"); Pkg.add("FactCheck"); Pkg.clone("git://github.com/JuliaQuant/MarketData.jl.git")' | ||
- julia -e 'Pkg.clone("git://github.com/JuliaQuant/MarketTechnicals.jl.git"); Pkg.add("TimeSeries"); Pkg.add("FactCheck"); Pkg.add("MarketData")' | ||
- mkdir -p ~/.julia/MarketTechnicals | ||
- cp -R ./* ~/.julia/MarketTechnicals/ | ||
- julia ./test/tests.jl | ||
- julia ./test/runtests.jl |
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
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
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
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
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
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,22 +1,21 @@ | ||
using MarketTechnicals, MarketData, FactCheck | ||
|
||
|
||
facts("Momentum") do | ||
|
||
context("rsi") do | ||
@fact rsi(cl, 14).values[end] => roughly(45.452) # TTR value is 45.45173 | ||
@fact rsi(cl, 14, wilder=true).values[end] => roughly(47.050) # TTR value is 47.05027 | ||
@fact rsi(cl, 14).timestamp[end] => lastday | ||
@fact rsi(cl, 14).values[end] => roughly(55.84921708898833) # TTR value is 55.84922 | ||
@fact rsi(cl, 14, wilder=true).values[end] => roughly(55.95931797240996) # TTR value is 55.95932 | ||
@fact rsi(cl, 14).timestamp[end] => date(2001,12,31) | ||
end | ||
|
||
context("macd") do | ||
@fact macd(cl).values[end, 1] => roughly(-0.27215228) # TTR value with percent=FALSE is -0.272152282 | ||
@fact macd(cl).values[end, 2] => roughly(-0.02004125) # TTR value with percent=FALSE is -0.0200412507 | ||
@fact macd(cl).timestamp[end] => lastday | ||
@fact macd(cl).values[end, 1] => roughly(0.42117515229271874) # TTR value with percent=FALSE is 0.421175152 | ||
@fact macd(cl).values[end, 2] => roughly(0.44142752613313185) # TTR value with percent=FALSE is 0.4414275 | ||
@fact macd(cl).timestamp[end] => date(2001,12,31) | ||
end | ||
|
||
context("cci") do | ||
# @fact cci(cl)[end].value => -146.17060449635804 # TTR::CCI value is -175.8644 | ||
# @fact index(cci(cl))[end] => lastday | ||
# @fact cci(cl)[end].value => roughly(19.6784257) # TTR::CCI value is 19.6784257 | ||
# @fact index(cci(cl))[end] => date(2001,12,31) | ||
end | ||
end |
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
File renamed without changes.
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
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,16 +1,17 @@ | ||
using MarketData | ||
|
||
facts("Volume") do | ||
|
||
# commented tests that require a volume object not currently available in MarketData | ||
context("obv") do | ||
@fact obv(ohlc).values[1] => 50480000.00 # TTR value is 50480000 | ||
@fact obv(ohlc).values[end] => 1145460000.00 # TTR value is 1145460000 | ||
@fact obv(ohlc).timestamp[end] => lastday | ||
# @fact obv(ohlc).values[1] => 50480000.00 # TTR value is 50480000 | ||
# @fact obv(ohlc).values[end] => 1145460000.00 # TTR value is 1145460000 | ||
# @fact obv(ohlc).timestamp[end] => date(2001,12,31) | ||
end | ||
|
||
# commented tests that require a volume object not currently available in MarketData | ||
context("vwap") do | ||
@fact vwap(ohlc).values[1] => roughly(109.0703) # TTR value 109.0703 | ||
@fact vwap(ohlc).values[end] => roughly(122.7716) # TTR value 122.7716 | ||
@fact vwap(ohlc).timestamp[end] => lastday | ||
# @fact vwap(ohlc).values[1] => roughly(109.0703) # TTR value 109.0703 | ||
# @fact vwap(ohlc).values[end] => roughly(122.7716) # TTR value 122.7716 | ||
# @fact vwap(ohlc).timestamp[end] => date(2001,12,31) | ||
end | ||
end |