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
+14 -2
View File
@@ -31,6 +31,10 @@ struct Cli {
#[arg(short, long)]
trace: bool,
/// Library directories to load before execution
#[arg(short, long)]
lib: Vec<PathBuf>,
/// Disable optimization
#[arg(long)]
no_opt: bool,
@@ -38,8 +42,16 @@ struct Cli {
fn main() {
let cli = Cli::parse();
let mut env = Environment::new();
env.optimization = !cli.no_opt;
let env = Environment::new();
// Use env.optimization setting if needed, though it's currently on by default
// Load libraries
for lib_path in &cli.lib {
if let Err(e) = env.load_library(lib_path) {
eprintln!("❌ Error loading library {:?}: {}", lib_path, e);
std::process::exit(1);
}
}
if cli.bench || cli.update_bench {
if cfg!(debug_assertions) {