Add series, SMA, and WMA indicators
Introduce new indicators for Simple Moving Average (SMA) and Weighted Moving Average (WMA), along with their Hull Moving Average (HMA) derivative. Also refactors series implementation to use `RefCell` for interior mutability and adds `SeriesMember` trait for better dynamic series access. Updates `soa_series.myc` example to reflect new series creation and push syntax.
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
;; Benchmark: 1.0us
|
||||
;; Benchmark-Repeat: 1944
|
||||
(do
|
||||
(def template {:price 10.0 :volume 100 :msg "hi"})
|
||||
(def my_ticks (create-series template))
|
||||
(def my_ticks (series {:price :float :volume :int :msg :string}))
|
||||
|
||||
(push-series my_ticks {:price 10.5 :volume 100 :msg "A"})
|
||||
(push-series my_ticks {:price 11.2 :volume 200 :msg "B"})
|
||||
(push-series my_ticks {:price 15.5 :volume 300 :msg "C"})
|
||||
(push my_ticks {:price 10.5 :volume 100 :msg "A"})
|
||||
(push my_ticks {:price 11.2 :volume 200 :msg "B"})
|
||||
(push my_ticks {:price 15.5 :volume 300 :msg "C"})
|
||||
|
||||
(def prices (.price my_ticks))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user