1 ! Copyright (C) 2008 John Benediktsson, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license
3 USING: help.markup help.syntax math ;
7 { $values { "seq" "a sequence" } { "n" "number of periods" } { "newseq" "a sequence" } }
8 { $description "Returns the Simple Moving Average with the specified periodicity." } ;
11 { $values { "seq" "a sequence" } { "n" "number of periods" } { "newseq" "a sequence" } }
13 "Returns the Exponential Moving Average with the specified periodicity, calculated by:\n"
16 "EMA[t] = (A * SEQ[t]) + ((1-A) * EMA[t-1])" }
20 { $values { "seq" "a sequence" } { "n1" "short number of periods" } { "n2" "long number of periods" } { "newseq" "a sequence" } }
22 "Returns the Moving Average Converge of the sequence, calculated by:\n"
23 { $list "MACD[t] = EMA2[t] - EMA1[t]" }
27 { $values { "seq" "a sequence" } { "n" "number of periods" } { "newseq" "a sequence" } }
29 "Returns the Momentum of the sequence, calculated by:\n"
30 { $list "MOM[t] = SEQ[t] - SEQ[t-n]" }
38 { $description "Divides a number by the number of two week periods in a year." } ;
45 { $description "Divides a number by the number of days in a 360-day year." } ;
52 { $description "Divides a number by the number of days in a 365-day year." } ;
59 { $description "Divides a number by the number of months in a year." } ;
66 { $description "Divides a number by the number of half-months in a year. Note that biweekly has two more periods than semimonthly." } ;
73 { $description "Divides a number by the number of weeks in a year." } ;
75 ARTICLE: "time-period-calculations" "Calculations over periods of time"
76 { $subsection monthly }
77 { $subsection semimonthly }
78 { $subsection biweekly }
79 { $subsection weekly }
80 { $subsection daily-360 }
81 { $subsection daily-365 } ;
83 ARTICLE: "math.finance" "Financial math"
84 "The " { $vocab-link "math.finance" } " vocabulary contains financial calculation words." $nl
85 "Calculating payroll over periods of time:"
86 { $subsection "time-period-calculations" } ;