Fix CI workflow: use correct rust-toolchain action (#1)
* Fix CI workflow: use correct rust-toolchain action * Fix CI: resolve Rust compilation and formatting issues - Fix rust-toolchain action name in CI workflow - Add missing Direction import in test modules - Add missing entry_fees argument to open_position test calls - Comment out nightly-only rustfmt options - Auto-format code with cargo fmt
This commit is contained in:
+3
-11
@@ -131,19 +131,14 @@ pub fn supertrend(
|
||||
return Err(RaptorError::length_mismatch(n, high.len()));
|
||||
}
|
||||
if period == 0 {
|
||||
return Err(RaptorError::invalid_parameter(
|
||||
"Supertrend period must be > 0",
|
||||
));
|
||||
return Err(RaptorError::invalid_parameter("Supertrend period must be > 0"));
|
||||
}
|
||||
|
||||
let mut supertrend = vec![f64::NAN; n];
|
||||
let mut direction = vec![0i8; n];
|
||||
|
||||
if period >= n {
|
||||
return Ok(SupertrendResult {
|
||||
supertrend,
|
||||
direction,
|
||||
});
|
||||
return Ok(SupertrendResult { supertrend, direction });
|
||||
}
|
||||
|
||||
// Calculate ATR
|
||||
@@ -238,10 +233,7 @@ pub fn supertrend(
|
||||
}
|
||||
}
|
||||
|
||||
Ok(SupertrendResult {
|
||||
supertrend,
|
||||
direction,
|
||||
})
|
||||
Ok(SupertrendResult { supertrend, direction })
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user