B7: give Python ROC and TRIX constructor defaults
Every other Python momentum indicator (RSI, CCI, ...) carries a #[pyo3(signature)] default, but ROC and TRIX required an explicit period. Both now default to the TA-Lib convention (ROC period=10, TRIX period=30), and the .pyi stubs reflect the defaults. Node and WASM constructors deliberately stay explicit-only -- napi-rs and wasm-bindgen do not support default arguments, and every constructor in those bindings is uniformly explicit.
This commit is contained in:
@@ -836,6 +836,7 @@ struct PyRoc {
|
||||
#[pymethods]
|
||||
impl PyRoc {
|
||||
#[new]
|
||||
#[pyo3(signature = (period=10))]
|
||||
fn new(period: usize) -> PyResult<Self> {
|
||||
Ok(Self {
|
||||
inner: wc::Roc::new(period).map_err(map_err)?,
|
||||
@@ -1054,6 +1055,7 @@ struct PyTrix {
|
||||
#[pymethods]
|
||||
impl PyTrix {
|
||||
#[new]
|
||||
#[pyo3(signature = (period=30))]
|
||||
fn new(period: usize) -> PyResult<Self> {
|
||||
Ok(Self {
|
||||
inner: wc::Trix::new(period).map_err(map_err)?,
|
||||
|
||||
Reference in New Issue
Block a user