Remove SMA macro
The `sma.myc` file, which defined the Simple Moving Average macro, has been removed. This functionality is no longer needed.
This commit is contained in:
-20
@@ -1,20 +0,0 @@
|
|||||||
(do
|
|
||||||
(def SMA
|
|
||||||
(fn [length]
|
|
||||||
(do
|
|
||||||
(def history (series length))
|
|
||||||
(def sum 0.0)
|
|
||||||
|
|
||||||
(fn [val]
|
|
||||||
(do
|
|
||||||
(def hist_len (len history))
|
|
||||||
(if (>= hist_len length)
|
|
||||||
(assign sum (- sum (history (- length 1)))))
|
|
||||||
|
|
||||||
(push history val)
|
|
||||||
(assign sum (+ sum val))
|
|
||||||
|
|
||||||
(if (>= hist_len length)
|
|
||||||
(/ sum length))
|
|
||||||
)))))
|
|
||||||
)
|
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
;; Standard macros and core utilities.
|
;; Standard macros and core utilities.
|
||||||
|
|
||||||
(do
|
(do
|
||||||
|
(def func1 (print "Hello World"))
|
||||||
|
|
||||||
(macro while [cond body]
|
(macro while [cond body]
|
||||||
`((fn [] (if ~cond
|
`((fn [] (if ~cond
|
||||||
(do ~body (again))
|
(do ~body (again))
|
||||||
|
|||||||
Reference in New Issue
Block a user