math.finance: Removing an instance of "spin".
parent
dcc5ea89c7
commit
61d0a7ab94
|
@ -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
|
||||
|
|
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue