]> gitweb.factorcode.org Git - factor.git/blob - extra/math/finance/finance-tests.factor
44e18b0829348c4acc29739c7805a2f75352acd8
[factor.git] / extra / math / finance / finance-tests.factor
1 USING: kernel math math.functions math.finance sequences
2 tools.test ;
3
4 IN: math.finance.tests
5
6 { { 1 2 3 4 5 } } [ { 1 2 3 4 5 } 1 ema ] unit-test
7 { { 1+1/2 2+1/2 3+1/2 4+1/2 } } [ { 1 2 3 4 5 } 2 ema ] unit-test
8 { { 2 3 4 } } [ { 1 2 3 4 5 } 3 ema ] unit-test
9
10 { { 2 4 } } [ { 1 3 5 } 2 sma ] unit-test
11
12 { { 2 3 4 5 } } [ 6 iota 2 dema ] unit-test
13
14 { t } [ 6 iota 2 [ dema ] [ 1 gdema ] 2bi = ] unit-test
15
16 { { 3 4 5 } } [ 6 iota 2 tema ] unit-test
17 { { 6 7 8 9 } } [ 10 iota 3 tema ] unit-test
18
19 { { 1 3 1 } } [ { 1 3 2 6 3 } 2 momentum ] unit-test
20
21 { { 0.0 50.0 25.0 75.0 100.0 125.0 -50.0 -75.0 -90.0 } } [
22     { 1 1.5 1.25 1.75 2.0 2.25 0.5 0.25 0.1 } performance
23 ] unit-test
24
25 { 4+1/6 } [ 100 semimonthly ] unit-test