Skip to content

Commit

Permalink
adx: docs and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
iblislin committed May 23, 2017
1 parent 650f4c2 commit 059e14b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/src/momentum.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Momentum

## ADX

```@docs
adx
```

```@repl
using MarketData
using MarketTechnicals
adx(ohlc)
```

## RSI

```@docs
Expand Down
10 changes: 10 additions & 0 deletions test/momentum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ facts("Momentum") do
@fact ta.values[2] --> roughly(-0.02926829268292683, atol=.01)
@fact ta.values[3] --> roughly(-0.06009615384615385, atol=.01)
end

context("adx") do
ta = adx(ohlc)
@fact ta.colnames --> ["adx", "dx", "+di", "-di"]
@fact ta.values[1, 1] --> roughly(10.5998, atol=.01)
@fact ta.values[1, 2] --> roughly(0.3916, atol=.01)
@fact ta.values[1, 3] --> roughly(23.6226, atol=.01)
@fact ta.values[1, 4] --> roughly(23.4383, atol=.01)
@fact ta.timestamp[1] --> Date(2000, 2, 10)
end
end

0 comments on commit 059e14b

Please sign in to comment.