factor/extra/math/finance/finance-tests.factor

26 lines
719 B
Factor
Raw Normal View History

2012-05-04 13:06:24 -04:00
USING: kernel math math.functions math.finance sequences
tools.test ;
2008-09-23 13:33:36 -04:00
IN: math.finance.tests
{ { 1 2 3 4 5 } } [ { 1 2 3 4 5 } 1 ema ] unit-test
{ { 1+1/2 2+1/2 3+1/2 4+1/2 } } [ { 1 2 3 4 5 } 2 ema ] unit-test
{ { 2 3 4 } } [ { 1 2 3 4 5 } 3 ema ] unit-test
{ { 2 4 } } [ { 1 3 5 } 2 sma ] unit-test
2008-09-23 13:33:36 -04:00
{ { 2 3 4 5 } } [ 6 iota 2 dema ] unit-test
2012-05-04 13:06:24 -04:00
{ t } [ 6 iota 2 [ dema ] [ 1 gdema ] 2bi = ] unit-test
2012-05-04 13:06:24 -04:00
{ { 3 4 5 } } [ 6 iota 2 tema ] unit-test
{ { 6 7 8 9 } } [ 10 iota 3 tema ] unit-test
2012-05-04 13:06:24 -04:00
{ { 1 3 1 } } [ { 1 3 2 6 3 } 2 momentum ] unit-test
2008-09-23 13:33:36 -04:00
2013-05-02 00:24:09 -04:00
{ { 0.0 50.0 25.0 75.0 100.0 125.0 -50.0 -75.0 -90.0 } } [
{ 1 1.5 1.25 1.75 2.0 2.25 0.5 0.25 0.1 } performance
] unit-test
{ 4+1/6 } [ 100 semimonthly ] unit-test