Linear Regression and MACD Signals for Long and Short Trades
Summary
This strategy uses a volume-based linear regression estimate of price and a MACD calculation on that estimate to generate directional trades. The source enters long when the estimated price crosses above its weighted moving average, with MACD confirmation, and enters short when MACD is falling below its signal line alongside falling lows. Thus, despite the prose describing a predicted-price crossover with a long entry and exit, the code also defines short entries and does not simply close a long on the bearish signal.
The document presents linear regression as a way to capture price trends and suggests combining signals with other indicators and risk controls. It warns that non-linear or ranging markets can produce false signals, that results may depend on parameter choices, and that optimizing too much can overfit. Settings for a short BTC/USDT futures backtest are supplied, but no performance figures are given. The code’s regression uses volume as its independent variable, a detail that differs from the prose’s general description of fitting price over time.
Key ideas
- The code fits price against volume and uses the resulting estimate in signal calculations.
- A long entry requires the estimated price to cross above its moving average with MACD confirmation.
- A short entry is based on falling MACD and signal-line conditions together with falling lows.
- The prose and implementation differ on how bearish signals affect an existing long position.
- The published backtest settings include no measured performance results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.