RobotFX curates the best open-source MetaTrader code to inspire your trading automation.
Component 3: Linear Regression with R²
The regression component fits a straight line to the recent closing prices and returns two things:
- Slope:
- R² (Coefficient of Determination):
RegScore translates this into a directional confidence score:
- +100:A bearish reversal is about to happen
- –100:
- 0:
For SMC/ICT traders, this is critical:
- A +100 RegScore on a lower timeframe, when mapped against a higher-timeframe premium array, suggests theengineered move is complete. The algorithmic/institutional buying that created the accumulation has reached statistical saturation. Time to look for distribution footprints.
- A –100 RegScore in a discount array suggests the sell-off has reached statistical exhaustion. Time to look for accumulation footprints — a bullish order block or a sweep of a key low

Reduce lag and improve accuracy with the NonLagMA Expert Advisor for MT4/MT5. Discover it.
Level up your trading with professional RobotFX expert advisors and indicators. Visit www.robotfx.org for proven MT4/MT5 tools.
73414