math.finance: Removing an instance of "spin".

db4
John Benediktsson 2010-09-04 17:20:15 -07:00
parent dcc5ea89c7
commit 61d0a7ab94
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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 ;