NET MyRSI (Noise-Eliminated MyRSI)

Parameters: period = 14

Overview

NET MyRSI enhances John Ehlers' MyRSI oscillator with a Noise Elimination Technique that filters market noise by ranking pairwise comparisons of recent momentum values, producing an exceptionally smooth signal bounded between -1 and 1. The indicator first calculates MyRSI values that measure the balance between upward and downward price changes, then applies the NET filter which examines whether newer MyRSI readings consistently exceed older ones within the lookback window. This dual processing creates a momentum indicator that responds to genuine trend changes while ignoring minor fluctuations that plague traditional RSI variants. Values approaching 1 indicate strong upward momentum with consistent improvement in readings, while values near -1 signal deteriorating momentum across the evaluation period. Traders appreciate NET MyRSI for its ability to maintain smooth signals even in choppy markets, making it particularly effective for identifying trend continuations and avoiding premature exits during minor retracements.

Implementation Examples

Compute NET MyRSI from a price slice or candles:

use vectorta::indicators::net_myrsi::{net_myrsi, NetMyrsiInput, NetMyrsiParams};
use vectorta::utilities::data_loader::{Candles, read_candles_from_csv};

// Using with price data slice
let prices = vec![100.0, 101.0, 100.5, 102.0, 103.2, 102.8];
let params = NetMyrsiParams { period: Some(14) }; // default 14
let input = NetMyrsiInput::from_slice(&prices, params);
let out = net_myrsi(&input)?;

// Using with Candles (defaults: source="close", period=14)
let candles: Candles = read_candles_from_csv("data/sample.csv")?;
let input = NetMyrsiInput::with_default_candles(&candles);
let out = net_myrsi(&input)?;

// Access values
for v in out.values { println!("NET MyRSI: {}", v); }

API Reference

Input Methods
// From price slice
NetMyrsiInput::from_slice(&[f64], NetMyrsiParams) -> NetMyrsiInput

// From candles with custom source (e.g., "close")
NetMyrsiInput::from_candles(&Candles, &str, NetMyrsiParams) -> NetMyrsiInput

// From candles with default params (close, period=14)
NetMyrsiInput::with_default_candles(&Candles) -> NetMyrsiInput
Parameters Structure
pub struct NetMyrsiParams {
    pub period: Option<usize>, // Default: 14
}
Output Structure
pub struct NetMyrsiOutput {
    pub values: Vec<f64>, // NET MyRSI values in [-1, 1]
}
Validation, Warmup & NaNs
  • period > 0 and period ≤ len(data); otherwise NetMyrsiError::InvalidPeriod.
  • Requires at least period + 1 valid points after the first finite value; otherwise NetMyrsiError::NotEnoughValidData.
  • Indices before the first finite input are NaN. Warmup index warm = first + period − 1 is 0.0 when period > 1 (otherwise NaN).
  • Streaming returns None until enough samples are buffered (prices: period + 1, MyRSI: period).
Error Handling
use vectorta::indicators::net_myrsi::{net_myrsi, NetMyrsiError};

match net_myrsi(&input) {
    Ok(output) => process(output.values),
    Err(NetMyrsiError::EmptyInputData) => eprintln!("Input is empty"),
    Err(NetMyrsiError::AllValuesNaN) => eprintln!("All values are NaN"),
    Err(NetMyrsiError::InvalidPeriod { period, data_len }) => {
        eprintln!("Invalid period: {} (len={})", period, data_len)
    }
    Err(NetMyrsiError::NotEnoughValidData { needed, valid }) => {
        eprintln!("Need {} data points after first valid, only {}", needed, valid)
    }
}

Python Bindings

Basic Usage

Calculate NET MyRSI using NumPy arrays (default period=14):

import numpy as np
from vectorta import net_myrsi

prices = np.array([100.0, 101.0, 100.5, 102.0, 103.2, 102.8], dtype=np.float64)

# Defaults
vals = net_myrsi(prices)

# Custom period and kernel selection
vals = net_myrsi(prices, period=14, kernel="auto")  # or "avx2", "scalar"

print(vals)
Streaming Real-time Updates

Use the streaming helper to process ticks efficiently:

from vectorta import NetMyrsiStream

stream = NetMyrsiStream(14)
for price in price_feed:
    v = stream.update(price)
    if v is not None:
        print(f"NET MyRSI: {v}")
Batch Parameter Optimization

Evaluate multiple period values:

import numpy as np
from vectorta import net_myrsi_batch

prices = np.array([...], dtype=np.float64)

res = net_myrsi_batch(prices, period_range=(10, 20, 5), kernel="auto")

print(res['values'].shape)  # (num_periods, len(prices))
print(res['periods'])       # [10, 15, 20]

# Select a specific row
row_idx = list(res['periods']).index(15)
row = res['values'][row_idx]
CUDA Acceleration

CUDA support for NET MyRSI is currently under development. APIs will follow existing CUDA-enabled patterns.

# Coming soon: CUDA-accelerated NET MyRSI calculations

JavaScript/WASM Bindings

Basic Usage

Calculate NET MyRSI in JavaScript/TypeScript:

import { net_myrsi_js } from 'vectorta-wasm';

const prices = new Float64Array([100.0, 101.0, 100.5, 102.0]);
const result = net_myrsi_js(prices, 14);
console.log('NET MyRSI:', result);
Memory-Efficient Operations

Use zero-copy operations for large datasets:

import { net_myrsi_alloc, net_myrsi_free, net_myrsi_into, memory } from 'vectorta-wasm';

const prices = new Float64Array([/* your data */]);
const n = prices.length;

const inPtr = net_myrsi_alloc(n);
const outPtr = net_myrsi_alloc(n);

new Float64Array(memory.buffer, inPtr, n).set(prices);

// Args: in_ptr, out_ptr, len, period
net_myrsi_into(inPtr, outPtr, n, 14);

const values = new Float64Array(memory.buffer, outPtr, n).slice();

net_myrsi_free(inPtr, n);
net_myrsi_free(outPtr, n);
Batch Processing

Parameter sweep via unified batch API:

import { net_myrsi_batch } from 'vectorta-wasm';

const prices = new Float64Array([/* historical prices */]);
const config = { period_range: [10, 20, 5] };

// Returns { values: Float64Array, combos: { period }[], rows, cols }
const out = net_myrsi_batch(prices, config);

// Reshape flat values into rows x cols
const rows = out.rows, cols = out.cols;
const matrix: number[][] = [];
for (let r = 0; r < rows; r++) {
  const start = r * cols;
  matrix.push(Array.from(out.values.slice(start, start + cols)));
}

// Access parameter metadata
const periods = out.combos.map(c => c.period);
console.log(periods); // [10, 15, 20]

Performance Analysis

Comparison:
View:
Loading chart...

AMD Ryzen 9 9950X (CPU) | NVIDIA RTX 4090 (GPU) | Benchmarks: 2026-01-05

Related Indicators