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:
vatsal
2026-01-28 15:38:31 +05:30
committed by GitHub
parent e6476b771f
commit 0f032dd39e
32 changed files with 193 additions and 660 deletions
+3 -17
View File
@@ -115,12 +115,7 @@ pub struct PyStopConfig {
impl PyStopConfig {
#[new]
fn new() -> Self {
Self {
stop_type: "none".to_string(),
percent: None,
multiplier: None,
period: None,
}
Self { stop_type: "none".to_string(), percent: None, multiplier: None, period: None }
}
#[staticmethod]
@@ -689,13 +684,7 @@ pub fn run_multi_backtest<'py>(
low: PyReadonlyArray1<f64>,
close: PyReadonlyArray1<f64>,
volume: PyReadonlyArray1<f64>,
strategies: Vec<(
PyReadonlyArray1<bool>,
PyReadonlyArray1<bool>,
i32,
f64,
String,
)>,
strategies: Vec<(PyReadonlyArray1<bool>, PyReadonlyArray1<bool>, i32, f64, String)>,
config: Option<&PyBacktestConfig>,
combine_mode: &str,
) -> PyResult<PyBacktestResult> {
@@ -819,10 +808,7 @@ pub fn stochastic<'py>(
let c = numpy_to_vec_f64(close);
let result = indicators::momentum::stochastic(&h, &l, &c, k_period, d_period)
.map_err(|e| pyo3::exceptions::PyValueError::new_err(e.to_string()))?;
Ok((
vec_to_numpy_f64(py, result.k),
vec_to_numpy_f64(py, result.d),
))
Ok((vec_to_numpy_f64(py, result.k), vec_to_numpy_f64(py, result.d)))
}
/// Average True Range.