Clean up of math.finance
parent
2fafae5013
commit
380cd2d3b0
|
@ -1,9 +1,7 @@
|
||||||
! Copyright (C) 2008 John Benediktsson
|
! Copyright (C) 2008 John Benediktsson.
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: arrays assocs kernel grouping sequences shuffle
|
USING: arrays assocs kernel grouping sequences shuffle
|
||||||
math math.functions math.statistics math.vectors ;
|
math math.functions math.statistics math.vectors ;
|
||||||
|
|
||||||
IN: math.finance
|
IN: math.finance
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -26,6 +24,5 @@ PRIVATE>
|
||||||
rot dup ema [ swap ema ] dip v- ;
|
rot dup ema [ swap ema ] dip v- ;
|
||||||
|
|
||||||
: momentum ( seq n -- newseq )
|
: momentum ( seq n -- newseq )
|
||||||
2dup tail-slice -rot swap [ length ] keep
|
[ tail-slice ] 2keep [ dup length ] dip - head-slice v- ;
|
||||||
[ - neg ] dip swap head-slice v- ;
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue