trend_switch — Strategy by palitoj_endthen
By palitoj_endthen
Performance Metrics
- Author: palitoj_endthen
- Symbol: BINANCE:SOLUSDT
- Timeframe: 1 day
- Net P&L: +55,834.22 USDT (+526.94%)
- Win Rate: 47.3%
- Profit Factor: 1.796
- Max Drawdown: 12,984.75 USDT (28.95%)
- Total Trades: 129
- Sharpe Ratio: 0.549
Description
█ DescriptionAsset price data was time series data, commonly consisting of trends, seasonality, and noise. Many applicable indicators help traders to determine between trend or momentum to make a better trading decision based on their preferences. In some cases, there is little to no clear market direction, and price range. It feels much more appropriate to use a shorter trend identifier, until clearly defined market trend. The indicator/strategy developed with the notion aims to automatically switch between shorter and longer trend following indicator. There were many methods that can be applied and switched between, however in this indicator/strategy will be limited to the use of predictive moving average and MESA adaptive moving average (Ehlers), by first determining if there is a strong trend identified by calculating the slope, if slope value is between upper and lower threshold assumed there is not much price direction.█ FormulaPine Script®// predictive moving averagepredict = (2*wma1-wma2)trigger = (4*predict+3*predict[1]+2*predict[2]*predict)// MESA adaptive moving averagemama = alpha*src+(1-alpha)*mama[1]fama = .5*alpha*mama+(1-.5-alpha)*fama[1]Expand 2 lines█ FeatureThe indicator will have a specified default parameter of:source = ohlc4lookback period = 10threshold = 10fast limit = 0.5slow limit = 0.05 Strategy type can be switched between Long/Short only and Long-Short strategyStrategy backtest period█ How it worksIf slope between the upper (red) and lower (green) threshold line, assume there is little to no clear market direction, thus signal predictive moving average indicatorIf slope is above the upper (red) or below the lower (green) threshold line, assume there is a clear trend forming, the signal generated from the MESA adaptive moving average indicator█ Example 1 - Slope fall between the Threshold - activate shorter trend https://www.tradingview.com/x/bMZjRtMu/█ Example 2 - Slope fall above/below Threshold - activate longer trend https://www.tradingview.com/x/rUb7AJyI/