Multiple Crossovers Turtle and Weighted Moving Average and MACD and TSI Combination Strategy

Author: ChaoZhang, Date: 2024-01-08 14:19:02
Tags:

img

Overview

This is a strategy that utilizes multiple technical indicators for trading signal judgment. It integrates the dual moving average crossover system of the Turtle Trading Rules, the Weighted Moving Average, MACD and TSI, four mainstream technical indicators, to form a multi-confirmed trading strategy. This combination can effectively filter false signals and improve stability.

Principles

The core principle of this strategy is the combination of multiple technical indicators. It includes the following aspects:

  1. Use the dual moving average crossover of the Turtle Trading Rules to generate trading signals. Calculate the 7-day and 14-day dual Hull moving averages. When the short term moving average crosses above the long term moving average, it is bullish, and when it crosses below, it is bearish.

  2. Calculate the 1-day weighted moving average as an important long-term trend indicator.

  3. Calculate the MACD indicator and judge its golden cross and dead cross with the signal line. When MACD is greater than the signal line, it is bullish. When less than, it is bearish.

  4. Calculate the TSI indicator and determine if it is above the overbought line or below the oversold line. When the TSI is above the overbought line, it is bearish. When below the oversold line, it is bullish.

When entering the market, the following multiple conditions must be met simultaneously:

  • 7-day line crosses above 14-day line
  • If the 1-day weighted moving average is below, go long only; if above, go short only
  • MACD crosses above signal line
  • TSI is higher than oversold line (go long) or lower than overbought line (go short)

This can effectively avoid false signals generated by a single technical indicator and improve stability.

Advantages

This multi-indicator crossover combination strategy has the following advantages:

  1. Multiple confirmations effectively filter false signals and avoid erroneous trades.

  2. The technical indicators cover short, medium and long terms, which can capture trading opportunities at different levels.

  3. The Turtle Trading Rules have been battle tested and can easily achieve stable profits.

  4. The MACD indicator is sensitive to short-term market changes, which can improve the real-time performance of the strategy.

  5. The TSI indicator is relatively smooth and can effectively identify overbought and oversold situations.

  6. Moving averages as an important long-term trend indicator prevent trading against the trend.

In summary, this strategy combines the advantages of multiple indicators and is both stable and flexible with large profit potential. It is an excellent quantitative strategy.

Risks

This strategy also has some risks, mainly in the following areas:

  1. Multiple indicators increase the complexity of the strategy and make parameter settings and optimization more difficult.

  2. Divergence may occur between indicators, affecting strategy stability.

  3. The probability of false signals from technical indicators cannot be completely eliminated.

  4. Missing opportunities for short-term market reversals fails to capture arbitrage space from rapid reversals.

Correspondingly, further optimizations can be made in the following areas:

  1. Find the optimal combination of indicator parameters to improve coordination between indicators.

  2. Increase stop loss mechanisms to control single loss.

  3. Incorporate more different types and cycles of indicators to further improve stability.

  4. Reserve some funds appropriately using reversal techniques for arbitrage.

Optimization Directions

This strategy can be further optimized in the following aspects:

  1. Parameter optimization. Optimize parameters such as cycle length, number of lines, overbought and oversold intervals, etc. to find the best parameter combination.

  2. Increase stop loss mechanisms. Set appropriate moving stop loss or CLASSES and other stop loss methods to control losses.

  3. Increase more indicators. Adding indicators like KD, OBV, volatility etc. to form cross-validation in more dimensions.

  4. Combine machine learning. Take various technical indicators as input and use neural networks for signal judgment and parameter optimization.

  5. Reserve some funds for hedging. Hold certain reverse positions to profit from reversals.

Summary

This strategy combines the Turtle Trading Rules, moving average, MACD and TSI technical indicators to build a high stability, high flexibility and battle tested quantitative strategy. It captures both short, medium and long term market moves. Multiple indicator cross validation effectively reduces the probability of false signals. Further optimizations on parameters, stop loss mechanisms and models can achieve better strategy performance. This strategy is worth live trading verification and application.


/*backtest
start: 2023-12-08 00:00:00
end: 2024-01-07 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
//                                                    Quad-HullMA-cross & VWMA & MacD & TSI combination  <<<<< by SeaSide420 >>>>>>
strategy("MultiCross", overlay=true)
keh=input(title="Double HullMA 1",defval=7, minval=1)
teh=input(title="Double HullMA 2",defval=14, minval=1)
meh=input(title="VWMA",defval=1, minval=1)
meh1=vwma(close,round(meh))
n2ma=2*wma(close,round(keh/2))
nma=wma(close,keh)
diff=n2ma-nma,sqn=round(sqrt(keh))
n2ma1=2*wma(close[2],round(keh/2))
nma1=wma(close[2],keh)
diff1=n2ma1-nma1,sqn1=round(sqrt(keh))
n1=wma(diff,sqn)
n2=wma(diff1,sqn)
b=n1>n2?lime:red
c=n1>n2?green:red
n2ma3=2*wma(close,round(teh/2))
nma2=wma(close,teh)
diff2=n2ma3-nma2,sqn2=round(sqrt(teh))
n2ma4=2*wma(close[2],round(teh/2))
nma3=wma(close[2],teh)
diff3=n2ma4-nma3,sqn3=round(sqrt(teh))
n3=wma(diff2,sqn2)
n4=wma(diff3,sqn3)
fastLength = input(title="MacD fastLength", defval=7)
slowlength = input(title="MacD slowlength", defval=14)
MACDLength = input(title="MacD Length", defval=3)
MACD = ema(close, fastLength) - ema(close, slowlength)
aMACD = ema(MACD, MACDLength)
delta = MACD - aMACD
a1=plot(n1,color=c),a2=plot(n2,color=c)
plot(cross(n1, n2) ? n1 : na, style = cross, color=b, linewidth = 3)
a3=plot(n3,color=c),a4=plot(n4,color=c)
plot(cross(n3, n4) ? n1 : na, style = cross, color=b, linewidth = 3)
//a5=plot(meh1,color=c)
long = input(title="TSI Long Length",  defval=5)
short = input(title="TSI Short Length",  defval=3)
signal = input(title="TSI Signal Length",  defval=2)
linebuy = input(title="TSI Upper Line",  defval=4)
linesell = input(title="TSI Lower Line",  defval=-4)
price = close
double_smooth(src, long, short) =>
    fist_smooth = ema(src, long)
    ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)
closelong = n1<n2 and n3<n4 and n1>meh1
if (closelong)
    strategy.close("Long")
closeshort = n1>n2 and n3>n4 and n1<meh1
if (closeshort)
    strategy.close("Short") 
longCondition = strategy.opentrades<1 and n1>n2 and MACD>aMACD and n1<meh1 and n3>n4 and ema(tsi_value, signal)>linesell
if (longCondition)
    strategy.entry("Long",strategy.long)
shortCondition = strategy.opentrades<1  and n1<n2 and MACD<aMACD and n1>meh1 and n3<n4 and ema(tsi_value, signal)<linebuy
if (shortCondition)
    strategy.entry("Short",strategy.short)

More