OPEN-SOURCE SCRIPT

Normalized Linear Regression (LSMA) Oscillator

Normalized Linear Regression (LSMA) Oscillator
By Nathan Farmer

The Normalized LSMA Oscillator is a trend-following indicator that enhances the classic Linear Regression (LSMA) by applying a range of normalization techniques. This indicator allows traders to smooth out and normalize LSMA signals for better trend detection and dynamic market adaptation.

Key Features:

Configurable Normalization Methods:
This indicator offers several normalization techniques, such as Z-Score, Min-Max, Mean Normalization, Robust Scaler, Logistic Function, and Quantile Transformation. Each method helps in refining LSMA outputs to improve clarity in both trending and ranging market conditions.

Smoothing Options:
Smoothing can be applied after normalization, helping to reduce noise in the signals, thus making trend-following strategies that use this indicator more effective.

Recommended Settings:
  1. Logistic Function Normalization: Recommended length of around 12, based on my preferred signal frequency.
  2. Z-Score Normalization: Medium period (close to the default of 50), based on my preferred signal frequency.
  3. Min-Max Normalization: Medium period, based on my preferred signal frequency.
  4. Mean Normalization: Medium period, based on my preferred signal frequency.
  5. Robust Scaler: Medium period, based on my preferred signal frequency.
  6. Quantile Transformation: Medium period, based on my preferred signal frequency.


Usage:
Designed primarily for trend-following strategies, this indicator adapts well to varying market conditions. Traders can experiment with the various normalization and smoothing settings to match the indicator to their specific needs and market preferences.

Recommendation before usage:
Always backtest the indicator for yourself with respect to how you intend to use it. Modify the parameters to suit your needs, over your preferred time frame, on your preferred asset. My preferences are for the assets I happened to be looking at when I made this indicator. Odds are, you're looking at something else, over a different time frame, in a different market environment than what my settings are tailored for.
Linear RegressionlinearregressioncurveLeast Squares Moving Average (LSMA)normalizationnormalizedlsmaOscillatorssmoothingTrend Analysistrendfollowingtrendtrading

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian