]> gitweb.factorcode.org Git - factor.git/blob - extra/math/finance/finance-docs.factor
factor: clean up whitespace in -docs files
[factor.git] / extra / math / finance / finance-docs.factor
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 sequences ;
4 IN: math.finance
5
6 HELP: sma
7 { $values { "seq" sequence } { "n" "number of periods" } { "newseq" sequence } }
8 { $description "Returns the Simple Moving Average with the specified periodicity." } ;
9
10 HELP: ema
11 { $values { "seq" sequence } { "n" "number of periods" } { "newseq" sequence } }
12 { $description
13     "Returns the Exponential Moving Average with the specified periodicity, calculated by:\n"
14     { $list
15         "A = 2.0 / (N + 1)"
16         "EMA[t] = (A * SEQ[t]) + ((1-A) * EMA[t-1])" }
17 } ;
18
19 HELP: macd
20 { $values { "seq" sequence } { "n1" "short number of periods" } { "n2" "long number of periods" } { "newseq" sequence } }
21 { $description
22     "Returns the Moving Average Converge of the sequence, calculated by:\n"
23     { $list "MACD[t] = EMA2[t] - EMA1[t]" }
24 } ;
25
26 HELP: momentum
27 { $values { "seq" sequence } { "n" "number of periods" } { "newseq" sequence } }
28 { $description
29     "Returns the Momentum of the sequence, calculated by:\n"
30     { $list "MOM[t] = SEQ[t] - SEQ[t-n]" }
31 } ;
32
33 HELP: biweekly
34 { $values
35      { "x" number }
36      { "y" number }
37 }
38 { $description "Divides a number by the number of two week periods in a year." } ;
39
40 HELP: daily-360
41 { $values
42      { "x" number }
43      { "y" number }
44 }
45 { $description "Divides a number by the number of days in a 360-day year." } ;
46
47 HELP: daily-365
48 { $values
49      { "x" number }
50      { "y" number }
51 }
52 { $description "Divides a number by the number of days in a 365-day year." } ;
53
54 HELP: monthly
55 { $values
56      { "x" number }
57      { "y" number }
58 }
59 { $description "Divides a number by the number of months in a year." } ;
60
61 HELP: semimonthly
62 { $values
63      { "x" number }
64      { "y" number }
65 }
66 { $description "Divides a number by the number of half-months in a year. Note that biweekly has two more periods than semimonthly." } ;
67
68 HELP: weekly
69 { $values
70      { "x" number }
71      { "y" number }
72 }
73 { $description "Divides a number by the number of weeks in a year." } ;
74
75 ARTICLE: "time-period-calculations" "Calculations over periods of time"
76 { $subsections
77     monthly
78     semimonthly
79     biweekly
80     weekly
81     daily-360
82     daily-365
83 } ;
84
85 ARTICLE: "math.finance" "Financial math"
86 "The " { $vocab-link "math.finance" } " vocabulary contains financial calculation words." $nl
87 "Calculating payroll over periods of time:"
88 { $subsections "time-period-calculations" } ;
89
90 ABOUT: "math.finance"