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:
Michael Schimmel
2026-03-05 14:07:42 +01:00
parent d1b8d03604
commit 831525b402
10 changed files with 385 additions and 137 deletions
+11
View File
@@ -188,6 +188,17 @@ pub trait Object: fmt::Debug {
pub trait Series {
/// Gets the value at the specified lookback index (0 = newest).
fn get_item(&self, index: usize) -> Option<Value>;
/// Returns the current number of elements in the buffer.
fn len(&self) -> usize;
/// Returns the total number of elements that have passed through this series.
fn total_count(&self) -> u64;
/// Returns true if the series is empty.
fn is_empty(&self) -> bool {
self.len() == 0
}
}
/// A shared sequence of values, used by both Tuples and Records.