From 61d0a7ab94d69a43eb8974cb8014e5af643aef2f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 4 Sep 2010 17:20:15 -0700 Subject: [PATCH] math.finance: Removing an instance of "spin". --- extra/math/finance/finance-tests.factor | 2 ++ extra/math/finance/finance.factor | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/math/finance/finance-tests.factor b/extra/math/finance/finance-tests.factor index fc4ad0d07e..eb4b238f61 100644 --- a/extra/math/finance/finance-tests.factor +++ b/extra/math/finance/finance-tests.factor @@ -2,6 +2,8 @@ USING: kernel math math.functions math.finance tools.test ; IN: math.finance.tests +[ { 1 2 3 4 } ] [ { 1 2 3 4 5 } 1 ema ] unit-test + [ { 2 4 } ] [ { 1 3 5 } 2 sma ] unit-test [ { 1 3 1 } ] [ { 1 3 2 6 3 } 2 momentum ] unit-test diff --git a/extra/math/finance/finance.factor b/extra/math/finance/finance.factor index f1c608bad9..12f58c891b 100644 --- a/extra/math/finance/finance.factor +++ b/extra/math/finance/finance.factor @@ -15,7 +15,7 @@ IN: math.finance PRIVATE> : ema ( seq n -- newseq ) - a swap unclip [ [ dup ] 2dip spin weighted ] accumulate 2nip ; + a swap unclip [ swap pick weighted ] accumulate 2nip ; : sma ( seq n -- newseq ) clump [ mean ] map ;