Guide
How does the Trend Following based on Trend Confidence strategy work ?
The strategy employs the Trend Confidence indicator to establish the presence of a linear trend, determining the optimal timing for market entries and exits. By assessing past closing prices over a specified length—by default, the last 30—this strategy calculates a confidence ratio based on the steepness of the price movement and the deviation from a perfect linear fit.
- The linear regression calculates the slope (steepness) of the trend, while the standard deviation measures how much prices deviate from the regression line.
- The Trend Confidence is then derived as a ratio of the slope to standard deviation, indicating the 'confidence' in a continuing trend.
- A signal to go long is generated when the Trend Confidence exceeds the 'Long entry' threshold and a long exit is signaled when it falls below the 'Long exit' threshold.
- Conversely, a short position is taken when the Trend Confidence falls under the 'Short entry' threshold, exiting when it rises above the 'Short exit' threshold.
It is optimized for the BTC-USD market on a 4-hour timeframe, incorporating a 10% stop loss to mitigate risk and accounting for trading costs with predefined commission and slippage parameters.