diff --git a/extra/math/finance/finance.factor b/extra/math/finance/finance.factor index db300a3b70..f006e6aee7 100644 --- a/extra/math/finance/finance.factor +++ b/extra/math/finance/finance.factor @@ -1,18 +1,16 @@ -! Copyright (C) 2008 John Benediktsson -! See http://factorcode.org/license.txt for BSD license - +! Copyright (C) 2008 John Benediktsson. +! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs kernel grouping sequences shuffle math math.functions math.statistics math.vectors ; - IN: math.finance @@ -26,6 +24,5 @@ PRIVATE> rot dup ema [ swap ema ] dip v- ; : momentum ( seq n -- newseq ) - 2dup tail-slice -rot swap [ length ] keep - [ - neg ] dip swap head-slice v- ; + [ tail-slice ] 2keep [ dup length ] dip - head-slice v- ;