Linear Regression Slope Trend Strategy: Measure Trend Speed

Is a trend moving fast enough to be worth trading? Most trend rules can’t answer that. They only say up or down. A linear regression slope trend strategy measures the speed as well as the direction.
That difference matters in weak markets. A coin can drift slightly higher for weeks and still lose money after fees. A speed threshold filters out those slow, choppy climbs.
This guide builds a long-only example around the Linear Regression Slope, or LinRegSlope. For the indicator’s background, read our LinRegSlope guide.
The settings below are research starting points. They are not backtested recommendations or claimed results.
What Is a Linear Regression Slope Trend Strategy?
A linear regression slope trend strategy enters when the best-fit line through recent prices rises steeply enough. It exits when that line flattens or turns down. It never looks at a single candle in isolation.
The best-fit line comes from linear regression. It draws the straight line that sits closest to every closing price in the window. Tulip Indicators documents the slope calculation with a single period setting.
The slope is that line’s steepness. A positive slope means prices are rising on average. A negative slope means they are falling.
Why Slope Beats a Simple Up-or-Down Check
A moving average tells you price is above or below its average. It says nothing about how fast the trend is moving. A flat, drifting market can stay above its average for a long time.
The slope puts a number on the trend’s pace. You can then set a minimum speed. Only trends that clear it are worth an entry.
Turn the Slope Into a Percentage
The raw slope has one big problem. It is measured in price units per candle. A slope of 150 means $150 per candle.
That number means very different things on different coins. $150 per candle is a gentle climb for Bitcoin at $60,000. It would be an explosion on a $70 coin.
The fix is to divide the slope by the closing price, then multiply by 100. The result is the trend’s speed as a percentage per candle.
| Coin | Close | Raw slope | Slope as % per candle |
|---|---|---|---|
| Bitcoin | $60,000 | 150 | 0.25% |
| Solana | $70 | 0.175 | 0.25% |
Both trends are moving at the same pace. Now one threshold works for both. Investopedia’s linear regression overview explains the underlying method.
Set the Strategy Rules
Use one liquid spot pair on one exchange feed. Start with completed four-hour candles. Keep these fixed for the first comparison.
| Component | Illustrative rule |
|---|---|
| Trend direction | 50-period slope above zero |
| Trend speed | 20-period slope above 0.15% per candle |
| Entry trigger | Both conditions true on a completed candle |
| Speed exit | 20-period slope closes below zero |
| Trend exit | 50-period slope closes below zero |
| Position limit | One open long position; no additions |
The two windows do different jobs. The 50-period slope sets the background trend. The 20-period slope measures whether price is moving with enough pace right now.
The exit uses zero, not the entry threshold. That gap gives the trade room to breathe. A trend can slow without ending.
A Worked Signal Example
Suppose Bitcoin closes at $60,000. The 50-period slope reads $40 per candle. That is positive, so the background trend is up.
The 20-period slope reads $105 per candle. Divide by $60,000 and multiply by 100. That gives 0.175% per candle, above the 0.15% threshold. The entry condition holds.
Over 20 candles, 0.175% per candle adds up to about 3.5%. That is the pace the rule is asking for.
Later, the 20-period slope falls to minus $20. The speed exit fires, even though the 50-period slope is still positive.
Build the Strategy With Visual Blocks
Start with Data Watchers for your exchange, pair and four-hour timeframe. Supply closing prices.
The indicator-block documentation lists the Linear Regression Slope block. It takes one period setting. Add two of them to the canvas:
- Fast slope: connect closing prices to a 20-period LinRegSlope block.
- Slow slope: connect closing prices to a 50-period LinRegSlope block.
Convert and Compare
Use Maths Blocks to divide the fast slope by the closing price. Multiply the result by 100. Compare it with a fixed number set to 0.15.
Compare the slow slope with zero. Join both comparisons with an AND condition block. Both must be true for an entry.
For exits, compare each slope with zero. Join the two exit conditions with an OR condition block. Either one closes the position.
Action Blocks express the buy and sell signals and their amounts. Confirm the amount units before testing.
Arrow Algo provides the no-code visual builder for these user-defined rules. If you choose deployment, your rules signal your own exchange account. The exchange decides whether to accept and execute.
How Should You Test the Speed Threshold?
The key benchmark is the same strategy with a threshold of zero. That version trades any rising slope, however slow. The difference shows what the speed filter adds.
Compare these numbers for both versions:
- Net return after fees and slippage
- Maximum drawdown
- Number of completed trades
- Average profit per trade
- Share of trades that lost money
Expect the threshold version to trade less often. Its average trade should be larger. If it is not, the filter is not doing its job.
Try Neighbouring Settings
Test thresholds of 0.10% and 0.20% per candle as well. Also try fast windows of 15 and 25. A useful setting should have useful neighbours.
Remember the threshold depends on the timeframe. A daily candle covers six four-hour candles. Scale the threshold up if you switch to daily data.
Know Where It Struggles
The slope reacts with a delay. It needs several candles to turn after a sharp reversal. Fast crashes like this weekend’s drop can hit before the speed exit fires.
Add a protective stop if that risk matters to you. Then test whether the stop improves drawdown without cutting too many good trades.
What Should You Take Into Your Next Backtest?
- Convert the raw slope into a percentage per candle so thresholds work across coins.
- Use a slow slope for direction and a fast slope for speed.
- Exit at zero, not at the entry threshold, to give trends room.
- Benchmark against a zero-threshold version to measure the speed filter.
- Scale thresholds when you change timeframe.
A speed filter that removes few losing trades is still a useful finding. It tells you your losses come from somewhere else.
Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.
Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who've made the switch to systematic trading.