Skip to content

Roofing Filter — Ehlers Roofing Filter

Band-pass filters price by first applying a high-pass filter to remove trend and then a super-smoother to remove high-frequency noise; the result isolates the dominant cycle band.

Inputs: [real]  |  Options: [ss_period, hp_period]  |  Outputs: [roofing]  |  Optional: [highpass]

Basic

use tulip_rs::indicators::roofingfilter::{RoofingFilter, Indicator, TIndicatorState};

let close = vec![
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20_f64,
];

// Options: [ss_period, hp_period]
let (outputs, _state) = RoofingFilter::indicator(&[close.as_slice()], &[10.0, 40.0], None).unwrap();
println!("Roofing Filter: {:?}", outputs[0]);

// State continuation
let n = close.len() - 5;
let partial = close[..n].to_vec();
let (outputs2, mut state) = RoofingFilter::indicator(&[partial.as_slice()], &[10.0, 40.0], None).unwrap();
println!("Partial Roofing Filter: {:?}", outputs2[0]);

let rest = close[n..].to_vec();
let continued = state.batch_indicator(&[rest.as_slice()], None).unwrap();
println!("Continued Roofing Filter: {:?}", continued[0]);
#include "tulip_rs_ffi.h"

double close[] = {
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20
};
double options[ROOFINGFILTER_OPTIONS] = {10.0, 40.0}; // ss_period, hp_period
const double *inputs[ROOFINGFILTER_INPUTS] = {close};

/* Full computation (check r.error == C_INDICATOR_ERROR_OK in real code) */
CIndicatorResult r = roofingfilter_indicator(inputs, 40, options, NULL, 0);
/* r.outputs[0] -> the roofing filter series, length r.output_lens[0];
   r.outputs[1] -> highpass (optional — not requested here) */
tulip_ffi_result_free(r);
roofingfilter_state_free(r.state);

/* Partial computation + state continuation */
CIndicatorResult p = roofingfilter_indicator(inputs, 35, options, NULL, 0);
double new_close[] = {92.80, 93.10, 92.50, 93.20};
const double *new_inputs[ROOFINGFILTER_INPUTS] = {new_close};
CBatchResult b = roofingfilter_batch(p.state, new_inputs, 4, NULL, 0);
/* b.outputs[0] -> roofing filter values for just the four new bars */
tulip_ffi_batch_result_free(b);
tulip_ffi_result_free(p);
roofingfilter_state_free(p.state);
import (
    "fmt"
    "github.com/me60732/tulip_rs_go/indicators"
    "github.com/me60732/tulip_rs_go/tulip"
)

close := []float64{81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
                   85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
                   88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
                   90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20}

options := []float64{10.0, 40.0} // ss_period, hp_period

res, st, _ := indicators.Roofingfilter.Indicator(close, options, nil)
fmt.Printf("Roofing Filter: %v\n", tulip.AsFloat64(res.Rows[0]))
res.Close()
st.Close()

partial := close[:35]
res2, state2, _ := indicators.Roofingfilter.Indicator(partial, options, nil)
fmt.Printf("Partial Roofing Filter: %v\n", tulip.AsFloat64(res2.Rows[0]))

continued, _ := state2.Batch(close[35:], nil)
fmt.Printf("Continued Roofing Filter: %v\n", tulip.AsFloat64(continued.Rows[0]))
continued.Close()
state2.Close()
import org.tuliprs.*;
import org.tuliprs.indicators.Roofingfilter;

double[] close = {81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
                  85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
                  88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
                  90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20};
double[] options = {10.0, 40.0}; // ss_period, hp_period

// Full computation — output rows are zero-copy views, valid until close().
Outcome oc = Roofingfilter.indicator(new double[][] {close}, options);
try (Result res = oc.result(); State st = oc.state()) {
    System.out.println(java.util.Arrays.toString(res.toDoubleArray(0))); // Roofing Filter values
}

// Partial computation + state continuation.
Outcome p = Roofingfilter.indicator(
    new double[][] {java.util.Arrays.copyOfRange(close, 0, 35)}, options);
try (Result pr = p.result(); State st = p.state()) {
    Result br = st.batch(
        new double[][] {java.util.Arrays.copyOfRange(close, 35, 40)});
    try (br) {
        System.out.println(java.util.Arrays.toString(br.toDoubleArray(0))); // continued Roofing Filter values
    }
}
import numpy as np
import tulip_rs

close = np.array([
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
], dtype=np.float64)

# Options: [ss_period, hp_period]
outputs, state = tulip_rs.indicators.roofingfilter.indicator([close], [10.0, 40.0])
print("Roofing Filter:", outputs[0])

# State continuation
partial = close[:-5]
outputs2, state = tulip_rs.indicators.roofingfilter.indicator([partial], [10.0, 40.0])
rest = close[-5:]
continued = state.batch_indicator([rest])
print("Continued Roofing Filter:", continued[0])
import * as ti from 'tulip-rs-node';

const close = Float64Array.from([
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
]);

const [outputs, state] = ti.roofingfilter.indicator([close], [10, 40]);
console.log('Roofing Filter:', outputs[0]);

// State continuation
const [, state2] = ti.roofingfilter.indicator([close.slice(0, -5)], [10, 40]);
const continued = state2.batchIndicator([close.slice(-5)]);
console.log('Continued Roofing Filter:', continued[0]);
import { init } from 'tulip-rs-wasm';
import * as ti from 'tulip-rs-wasm';

await init(); // bundler resolves the WASM asset automatically

const close = [
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
];

const [outputs, state] = ti.roofingfilter.indicator([close], [10, 40]);
console.log('Roofing Filter:', outputs[0]);

// State continuation
const [, state2] = ti.roofingfilter.indicator([close.slice(0, -5)], [10, 40]);
const continued = state2.batchIndicator([close.slice(-5)]);
console.log('Continued Roofing Filter:', continued[0]);

Optional Outputs

roofingfilter exposes 1 optional output: highpass. Pass a boolean mask as the third argument — one bool per optional output, in order.

use tulip_rs::indicators::roofingfilter::{RoofingFilter, Indicator, TIndicatorState};

let close = vec![
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20_f64,
];

let mask = [true]; // one per optional output
let (outputs, _state) = RoofingFilter::indicator(&[close.as_slice()], &[10.0, 40.0], Some(&mask)).unwrap();

let roofing  = &outputs[0]; // roofing (primary)
let highpass = &outputs[1]; // highpass (optional — requested)

roofingfilter exposes 1 optional output: highpass. Pass a boolean mask as the third argument.

#include "tulip_rs_ffi.h"

double close[] = {
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20
};
double options[ROOFINGFILTER_OPTIONS] = {10.0, 40.0}; // ss_period, hp_period
const double *inputs[ROOFINGFILTER_INPUTS] = {close};
bool optional_outputs[1] = {true}; // highpass=true

CIndicatorResult r = roofingfilter_indicator(inputs, 40, options, optional_outputs, 1);
/* r.outputs[0] -> roofing (primary)
   r.outputs[1] -> highpass (optional — requested) */
tulip_ffi_result_free(r);
roofingfilter_state_free(r.state);
import (
    "fmt"
    "github.com/me60732/tulip_rs_go/indicators"
    "github.com/me60732/tulip_rs_go/tulip"
)

close := []float64{81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
                   85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
                   88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
                   90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20}

options := []float64{10.0, 40.0} // ss_period, hp_period

mask := []bool{true} // highpass=true

res, st, _ := indicators.Roofingfilter.Indicator(close, options, mask)
fmt.Printf("Roofing: %v\n", tulip.AsFloat64(res.Rows[0]))
fmt.Printf("Highpass: %v\n", tulip.AsFloat64(res.Rows[1]))
res.Close()
st.Close()

roofingfilter exposes 1 optional output: highpass. Pass a boolean mask as the third argument — one boolean per optional output, in order.

import org.tuliprs.*;
import org.tuliprs.indicators.Roofingfilter;

// (close series as in the Basic tab)
boolean[] mask = {true}; // highpass=true
Outcome oc = Roofingfilter.indicator(new double[][] {close}, new double[] {10.0, 40.0}, mask);
try (Result res = oc.result()) {
    // row 0 = roofing (primary), row 1 = highpass; tr was not requested
    System.out.println(java.util.Arrays.toString(res.toDoubleArray(1))); // highpass
}
oc.state().close();
import numpy as np
import tulip_rs

close = np.array([
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
], dtype=np.float64)

outputs, state = tulip_rs.indicators.roofingfilter.indicator(
    [close], [10.0, 40.0],
    optional_outputs=[True],
)

roofing  = outputs[0]  # roofing (primary)
highpass = outputs[1]  # highpass (optional — requested)

roofingfilter exposes 1 optional output: highpass.

const [allOut] = ti.roofingfilter.indicator([close], [10, 40], [true]);
const roofing  = allOut[0]; // primary
const highpass = allOut[1]; // optional 0: highpass

The WASM API is identical to Node.js — pass the boolean mask as the third argument.

const [allOut] = ti.roofingfilter.indicator([close], [10, 40], [true]);
const roofing  = allOut[0]; // primary
const highpass = allOut[1]; // optional 0: highpass

SIMD

By assets — same options applied to 4 assets in parallel:

use tulip_rs::indicators::roofingfilter::{RoofingFilter, Indicator, TIndicatorState};

let a1 = vec![81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36_f64];
let a2 = vec![86.59, 86.06, 87.87, 88.00, 88.61, 88.15, 87.84, 88.99, 89.55, 89.36_f64];
let a3 = vec![78.59, 78.06, 79.87, 80.00, 80.61, 80.15, 79.84, 80.99, 81.55, 81.36_f64];
let a4 = vec![83.22, 82.68, 84.53, 84.66, 85.28, 84.81, 84.50, 85.67, 86.24, 86.05_f64];

let inputs: [&[&[f64]; 1]; 4] = [
    &[a1.as_slice()],
    &[a2.as_slice()],
    &[a3.as_slice()],
    &[a4.as_slice()],
];

let results = RoofingFilter::indicator_by_assets::<4>(&inputs, &[10.0, 40.0], None).unwrap();
for (i, asset_outputs) in results.iter().enumerate() {
    println!("Asset {}: {:?}", i + 1, asset_outputs[0]);
}

By options — same asset, 4 different option sets in parallel:

use tulip_rs::indicators::roofingfilter::{RoofingFilter, IndicatorByOptions};

let close = vec![81.59, 81.06, 82.87, 83.00, 83.61,
                 83.15, 82.84, 83.99, 84.55, 84.36_f64];

let opts: [&[f64; 2]; 4] = [
    &[5.0,  20.0],
    &[10.0, 40.0],
    &[14.0, 50.0],
    &[20.0, 60.0],
];

let results = RoofingFilter::indicator_by_options::<4>(&[close.as_slice()], &opts, None).unwrap();
for (i, opt_outputs) in results.iter().enumerate() {
    println!("Option set {}: {:?}", i + 1, opt_outputs[0]);
}

By assets — same options applied to N assets in parallel (N must be 2/4/8/16):

#include "tulip_rs_ffi.h"

double a1[] = {81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36};
double a2[] = {86.59, 86.06, 87.87, 88.00, 88.61, 88.15, 87.84, 88.99, 89.55, 89.36};
double a3[] = {78.59, 78.06, 79.87, 80.00, 80.61, 80.15, 79.84, 80.99, 81.55, 81.36};
double a4[] = {83.22, 82.68, 84.53, 84.66, 85.28, 84.81, 84.50, 85.67, 86.24, 86.05};

const double *asset1[ROOFINGFILTER_INPUTS] = {a1};
const double *asset2[ROOFINGFILTER_INPUTS] = {a2};
const double *asset3[ROOFINGFILTER_INPUTS] = {a3};
const double *asset4[ROOFINGFILTER_INPUTS] = {a4};
const double *const *const simd_inputs[4] = {asset1, asset2, asset3, asset4};
double options[ROOFINGFILTER_OPTIONS] = {10.0, 40.0};

CSimdResult r = roofingfilter_simd_by_assets(simd_inputs, 4, 10, options, NULL, 0);
for (uintptr_t i = 0; i < r.num_results; i++) {
    /* r.outputs[i][0] -> asset i's series, length r.output_lens[i][0] */
    roofingfilter_state_free(r.states[i]);
}
tulip_ffi_simd_result_free(r);

By options — same asset, N different option sets in parallel:

#include "tulip_rs_ffi.h"

double close[] = {81.59, 81.06, 82.87, 83.00, 83.61,
                  83.15, 82.84, 83.99, 84.55, 84.36};
const double *inputs[ROOFINGFILTER_INPUTS] = {close};

double o5_20[] = {5.0, 20.0}, o10_40[] = {10.0, 40.0}, o14_50[] = {14.0, 50.0}, o20_60[] = {20.0, 60.0};
const double *const simd_opts[4] = {o5_20, o10_40, o14_50, o20_60};

CSimdResult r = roofingfilter_simd_by_options(inputs, 10, simd_opts, 4, NULL, 0);
for (uintptr_t i = 0; i < r.num_results; i++) roofingfilter_state_free(r.states[i]);
tulip_ffi_simd_result_free(r);

By assets — same options applied to 4 assets in parallel (lane counts 2/4/8/16):

import "github.com/me60732/tulip_rs_go/indicators"

close := []float64{81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
                   85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
                   88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
                   90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20}
options := []float64{10.0, 40.0} // ss_period, hp_period

// Reuse the same data for assets 2–4 in this example
a2, a3, a4 := close, close, close

assets := [][indicators.RoofingfilterInputs][]float64{{close}, {a2}, {a3}, {a4}}
sim, _ := indicators.Roofingfilter.SimdByAssets(assets, options, nil)
for i, lanes := range sim.Results {
    fmt.Printf("Asset %d: %v\n", i+1, lanes[0])
}
sim.Close()

By options — same asset, 4 different option sets in parallel:

import "github.com/me60732/tulip_rs_go/indicators"

close := []float64{81.59, 81.06, 82.87, 83.00, 83.61}
options := [][]float64{{5, 20}, {10, 40}, {14, 50}, {20, 60}}

sim, _ := indicators.Roofingfilter.SimdByOptions(close, options, nil)
for i, lanes := range sim.Results {
    fmt.Printf("Option set %d: %v\n", i+1, lanes[0])
}
sim.Close()

By assets — same options applied to 4 assets in parallel (N must be 2, 4, 8, or 16):

import org.tuliprs.*;
import org.tuliprs.indicators.Roofingfilter;

double[] a1 = {81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
               85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
               88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
               90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20};
double[] a2 = {86.59, 86.06, 87.87, 88.00, 88.61, 88.15, 87.84, 88.99, 89.55, 89.36,
               90.53, 91.54, 91.89, 92.77, 92.29, 92.50, 93.10, 93.50, 92.90, 93.20,
               93.80, 94.10, 93.70, 94.30, 94.70, 95.10, 94.50, 95.20, 95.80, 96.10,
               95.50, 96.20, 96.80, 97.10, 96.50, 97.20, 97.80, 98.10, 97.50, 98.20};
double[] a3 = {78.59, 78.06, 79.87, 80.00, 80.61, 80.15, 79.84, 80.99, 81.55, 81.36,
               82.53, 83.54, 83.89, 84.77, 84.29, 84.50, 85.10, 85.50, 84.90, 85.20,
               85.80, 86.10, 85.70, 86.30, 86.70, 87.10, 86.50, 87.20, 87.80, 88.10,
               87.50, 88.20, 88.80, 89.10, 88.50, 89.20, 89.80, 90.10, 89.50, 90.20};
double[] a4 = {83.22, 82.68, 84.53, 84.66, 85.28, 84.81, 84.50, 85.67, 86.24, 86.05,
               87.23, 88.34, 88.69, 89.77, 89.29, 89.50, 90.10, 90.50, 89.90, 90.20,
               90.80, 91.10, 90.70, 91.30, 91.70, 92.10, 91.50, 92.20, 92.80, 93.10,
               92.50, 93.20, 93.80, 94.10, 93.50, 94.20, 94.80, 95.10, 94.50, 95.20};

// One entry per asset; each asset lists its INPUTS series.
double[][][] assets = {{a1}, {a2}, {a3}, {a4}};
try (SimdResult sim = Roofingfilter.simdByAssets(assets, new double[] {10.0, 40.0}, null)) {
    for (int i = 0; i < sim.numResults(); i++) {
        System.out.printf("Asset %d: %s%n", i + 1,
            java.util.Arrays.toString(sim.toDoubleArray(i, 0)));
    }
}   // frees every lane state, then the SIMD buffers (contractual order)

By options — same asset, 4 different option sets in parallel:

import org.tuliprs.*;
import org.tuliprs.indicators.Roofingfilter;

double[] close = {81.59, 81.06, 82.87, 83.00, 83.61,
                  83.15, 82.84, 83.99, 84.55, 84.36};

try (SimdResult sim = Roofingfilter.simdByOptions(new double[][] {close},
        new double[][] {{5, 20}, {10, 40}, {14, 50}, {20, 60}}, null)) {
    for (int i = 0; i < sim.numResults(); i++) {
        System.out.printf("Option set %d: %s%n", i + 1,
            java.util.Arrays.toString(sim.toDoubleArray(i, 0)));
    }
}

By assets — same options applied to N assets in parallel (must be 2, 4, 8, or 16):

import numpy as np
import tulip_rs

close = np.array([
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
], dtype=np.float64)

simd_inputs = [[close], [close + 5.0], [close - 3.0], [close * 1.02]]
outputs_list, states = tulip_rs.indicators.roofingfilter.simd_by_assets(simd_inputs, [10.0, 40.0])
for i, out in enumerate(outputs_list):
    print(f"Asset {i + 1}: {out[0]}")

By options — same asset, N different option sets in parallel:

import numpy as np
import tulip_rs

close = np.array([
    81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36,
    85.53, 86.54, 86.89, 87.77, 87.29, 87.50, 88.10, 88.50, 87.90, 88.20,
    88.80, 89.10, 88.70, 89.30, 89.70, 90.10, 89.50, 90.20, 90.80, 91.10,
    90.50, 91.20, 91.80, 92.10, 91.50, 92.20, 92.80, 93.10, 92.50, 93.20,
], dtype=np.float64)

simd_options = [
    [5.0,  20.0],
    [10.0, 40.0],
    [14.0, 50.0],
    [20.0, 60.0],
]
outputs_list, states = tulip_rs.indicators.roofingfilter.simd_by_options([close], simd_options)
for i, out in enumerate(outputs_list):
    print(f"Option set {i + 1}: {out[0]}")

By assets — same options applied to 4 assets in parallel:

const simdInputs = [
    [close.slice()],
    [close.map(v => v + 5.0)],
    [close.map(v => v - 3.0)],
    [close.map(v => v * 1.02)],
];
const [results] = ti.roofingfilter.simdByAssets(simdInputs, [10, 40]);
results.forEach((out, i) => console.log(`Asset ${i + 1}:`, out[0]));

By options — same asset, 4 different option sets in parallel:

const simdOptions = [[5, 20], [10, 40], [14, 50], [20, 60]];
const [results] = ti.roofingfilter.simdByOptions([close], simdOptions);
results.forEach((out, i) => console.log(`Option set ${i + 1}:`, out[0]));