Machine Learning: Multiple Logistic Regression
Mar 3, 2024

The Machine Learning: Multiple Logistic Regression indicator utilizes a systematic approach to trend forecasting by applying a logistic regression model to multiple normalized technical inputs to generate probability-based buy and sell signals.
Usage
The Usage section focuses on interpreting the machine learning outputs for practical trading decisions. The script processes six distinct technical variables and outputs a probability value between 0 and 1.
- Signal Interpretation: Values closer to 1 indicate a bullish probability, while values closer to 0 indicate a bearish probability. Buy signals are marked by upward arrows (▲) when the probability crosses above 0.5, and sell signals are marked by downward arrows (▼) when it crosses below 0.5.
- Visual Cues: The indicator plots an SMA that changes color based on the regression output (gradient from red to green). Additionally, numeric probability labels are displayed above or below bars to provide granular sentiment data.
- Real-time Monitoring: An on-chart dashboard displays the current state of categorical variables (normalized to 1 or -1) and the weights (coefficients) assigned to them by the model.
Details
The script implements a logistic regression algorithm optimized via Gradient Descent directly within the charting environment.
- Explanatory Variables: The model uses RSI, CCI, DMI, Aroon, EMA, and SuperTrend. These inputs are normalized into categorical variables (typically 1 for bullish alignment and -1 for bearish) to ensure a consistent scale.
- Logistic Function: The core calculation uses a sigmoid function to map the linear combination of inputs and weights into a probability range.
- Optimization: It utilizes a Cross-Entropy Loss function to measure the discrepancy between the model's prediction and the actual price movement (defined by a Z-score of the close).
- Gradient Descent: On every bar, the model updates its internal weights ($b1$ through $b6$) by moving in the opposite direction of the gradient of the loss function, scaled by the user-defined Learning Rate.
Settings
Explanatory Variable Inputs
- Z score Length: Sets the lookback period for the dependent variable calculation (Categorical Y), determining the baseline for "bullish" or "bearish" outcomes.
- RSI/CCI/DMI/AROON/EMA Lengths: These define the lookback periods for each respective technical indicator used as an input variable.
- SuperTrend Factor/ATR Period: Controls the sensitivity and lookback of the SuperTrend component of the model.
Regression Coefficients (Weights)
- $\beta1$ - $\beta6$: Initial weight values assigned to RSI, CCI, DMI, Aroon, EMA, and SuperTrend. These serve as the starting point before the gradient descent optimization begins adjusting them based on historical performance.
Learning Step
- Step of learning (lr): Controls the size of the weight adjustments during optimization. A higher rate allows for faster adaptation to market changes but may cause instability, while a lower rate is more stable but reacts slower.
FAQ
How do I interpret the probability labels? The labels represent the logistic regression output. A value of 0.8 means the model calculates an 80% probability of a bullish state based on the current configuration of technical inputs and learned weights.
What does the table in the corner show? The table provides transparency into the "black box." It shows whether each indicator is currently in a bullish (1) or bearish (-1) state and the specific weight ($\beta$) the model is currently applying to that indicator.
How can I access this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

