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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user