aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world/finance/market/analysis/accumulation_distribution.lux
blob: 74b502140e1eae2409ff62d3119c1145a775512c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(.require
 [library
  [lux (.except)
   [abstract
    [monad (.only do)]]
   [math
    ["[0]" random (.only Random)]
    [number
     ["f" frac]]]
   [test
    ["_" property (.only Test)]]]]
 [\\library
  ["[0]" / (.only)
   [////
    [money
     ["[0]" currency]]]]]
 [////
  [trade
   ["[0]T" session]]])

(def .public test
  Test
  (<| (_.covering /._)
      (do [! random.monad]
        [session (sessionT.random currency.usd)])
      (all _.and
           (_.coverage [/.oscillation]
             (let [it (/.oscillation session)]
               (and (f.<= +1.0 it)
                    (f.>= -1.0 it))))
           )))