!["[Stellar Strategies] Linear Regression Candles 1.1" logo](https://market-prod-23f4d22-e289.s3.amazonaws.com/19ef277f-e0b6-48ef-8941-88bfbba145f3_cT_cs_4141285_EURUSD_2025-03-30_19-53-31.png)
[Stellar Strategies] Linear Regression Candles Indicator for cTrader
The "[Stellar Strategies] Linear Regression Candles" indicator for cTrader offers a unique approach to price analysis by visualizing candlestick data through the lens of linear regression slopes. Instead of displaying raw price movements, this indicator constructs candles that reflect the rate of change in open, high, low, and close prices, providing a distinct perspective on market momentum.
Purpose:
This indicator is designed to help traders identify and interpret trend dynamics with greater clarity. By focusing on the linear regression slope, it highlights the acceleration or deceleration of price movements, which can be crucial for spotting potential trend reversals and momentum shifts that might be obscured in standard candlestick charts. The inclusion of a moving average signal line further aids in trend confirmation and analysis.
How to Use:
- Add the Indicator:
- Open cTrader and load the desired chart.
- Access the "Indicators" menu, typically found in the top toolbar or via a right-click on the chart.
- Navigate to "Custom" indicators and select "[Stellar Strategies] Linear Regression Candles."
- Configure Parameters:
- Signal Length: Set the period for the moving average signal line. Default is 11.
- Simple MA Signal: Choose between a Simple Moving Average (SMA) (
true
) or a Weighted Moving Average (WMA) (false
) for the signal line. - Linear Regression: Enable (
true
) or disable (false
) the linear regression slope calculation for candle construction. - Linear Regression Length: Define the period for the linear regression calculation. Default is 11.
- For intraday trading: Length 9-15
- For swing trading: Length 20-30
- For position trading: Length 50-100
- Optional: Optimize Visual Clarity:
- For optimal visualization, consider making the standard chart candlestick colors "transparent." This allows the indicator's linear regression slope candles to stand out prominently.
- Adjust chart colors via the chart's right-click menu, selecting "Colors."
- Interpret the Output:
- Strong Trend: Consistent sequence of same-colored candles with minimal wicks
- Trend Reversal: Color change in candles accompanied by increasing wick size
- Weak Trend/Consolidation: Alternating colors with large wicks relative to bodies
- Signal Line Cross: When price crosses the signal line, consider it confirmation of the trend direction
- When "Linear Regression" is enabled, the indicator generates candles based on the linear regression slope, emphasizing the rate of price change.
- The "Signal" line provides a moving average of close prices, offering trend context.
- Analyze the slope candles and signal line for trend strength, reversals, and momentum insights.
- Important Note: The live price range displayed by these candles may vary significantly depending on the indicator's settings, particularly the "Linear Regression Length." Adjusting this parameter will alter the slope calculation and, consequently, the candle formation and price range.
Key Code Features:
- Linear Regression Slope Calculation: Utilizes the
LinearRegressionSlope
indicator to calculate the rate of change in price data. - Candle Construction: Builds candles from the calculated slope values, highlighting momentum.
- Uses simple moving averages in conjunction with the linear regression slope, to calculate the open, high, low, and close prices of the displayed candles.
- Moving Average Signal: Offers SMA or WMA options for trend analysis.
- Visual Representation: Uses trend lines to draw candles, allowing for customizable color coding.
- Clear Charting: Code includes instructions to remove old candle drawings, to ensure a clean chart.
- Bars usage: Uses the current cBot best practices, by using the Bars.OpenPrices, Bars.HighPrices, and etc.
Tips
- Combine with volume analysis for better confirmation
- Use longer lengths for higher timeframe analysis
- Shorter lengths work better for scalping strategies
- The wick size indicates volatility - larger wicks suggest stronger rejection at those price levels
Note:
- This indicator provides a novel perspective on price action by focusing on the dynamics of price change.
- Experiment with parameter settings to align with your trading strategy and market analysis.
- Transparent chart candles are recommended for enhanced visibility of the indicator's output.
- Be aware that the price range of the generated candles is directly influenced by the indicator's settings.