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

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明