Stratégie d'optimisation du suivi des tendances avec double indicateur T3

T3 TOTT EMA OTT RSI
Date de création: 2025-01-17 14:29:51 Dernière modification: 2025-01-17 14:29:51
Copier: 2 Nombre de clics: 368
1
Suivre
1617
Abonnés

Stratégie d’optimisation du suivi des tendances avec double indicateur T3

Aperçu

La stratégie est un système de suivi de tendance basé sur l’indicateur Tillson T3 et le Twin Optimized Trend Follower (TOTT). Il optimise la génération de signaux de trading en le combinant avec l’oscillateur de momentum Williams %R. Cette stratégie utilise des paramètres d’achat et de vente distincts, qui peuvent ajuster de manière flexible la sensibilité en fonction des différentes conditions du marché et améliorer l’adaptabilité de la stratégie.

Principe de stratégie

La stratégie comprend trois éléments principaux :

  1. Indicateur Tillson T3 - Il s’agit d’une variante optimisée de moyenne mobile exponentielle (EMA) qui produit une ligne de tendance plus douce en pondérant plusieurs EMA.
  2. Double Optimized Trend Tracker (TOTT) - Un outil de suivi des tendances qui ajuste de manière adaptative l’action des prix et les coefficients de volatilité pour calculer les bandes supérieures et inférieures pour les conditions d’achat et de vente respectivement.
  3. Indicateur Williams %R - un oscillateur de momentum utilisé pour identifier les conditions de surachat et de survente.

Logique de génération de signaux de trading :

  • Conditions d’achat : Lorsque la ligne T3 franchit la piste supérieure du TOTT et que Williams %R est supérieur à -20 (survente)
  • Conditions de vente : Lorsque la ligne T3 tombe en dessous de la piste inférieure du TOTT et que Williams %R est supérieur à -70

Avantages stratégiques

  1. Forte stabilité du signal - grâce au traitement de lissage multiple des indicateurs T3, le risque de fausses percées est efficacement réduit
  2. Bonne adaptabilité - la séparation des paramètres d’achat et de vente permet une optimisation indépendante pour différentes conditions de marché
  3. Contrôle des risques amélioré - Intégrez Williams %R comme confirmation secondaire pour améliorer la fiabilité des transactions
  4. Visualisation claire - La stratégie offre un support de visualisation graphique complet pour faciliter l’analyse et le jugement

Risque stratégique

  1. Retards d’inversion de tendance - le lissage multiple de l’indicateur T3 peut provoquer des signaux retardés
  2. Ne convient pas aux marchés instables - trop de signaux de trading peuvent être générés pendant les transactions latérales
  3. Haute sensibilité des paramètres - les paramètres doivent être ajustés fréquemment pour différents environnements de marché

Suggestions de contrôle des risques :

  • Présentation d’un mécanisme de stop loss
  • Définir des limites de volume de transaction
  • Filtre de confirmation de tendance ajouté

Orientation de l’optimisation de la stratégie

  1. Optimisation dynamique des paramètres - développement de mécanismes d’ajustement adaptatif des paramètres
  2. Améliorer la reconnaissance du contexte du marché - introduire un indicateur de force de tendance
  3. Améliorer la gestion des risques - ajouter un stop loss dynamique et un take profit
  4. Filtrage du signal amélioré - Intégrer davantage d’indicateurs techniques pour confirmation

Résumer

Il s’agit d’une stratégie de suivi de tendance avec une structure complète et une logique claire. En combinant l’indicateur T3 et TOTT, et en filtrant avec Williams %R, il fonctionne bien sur les marchés tendance. Bien qu’il y ait un certain décalage, cette stratégie présente une bonne valeur pratique et une marge d’expansion grâce à l’optimisation des paramètres et aux améliorations de la gestion des risques.

Code source de la stratégie
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-15 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/

//@version=6
strategy("FON60DK by leventsah", overlay=true)

// Girdi AL
t3_length = input.int(5, title="Tillson Per AL", minval=1)
t3_opt = input.float(0.1, title="Tillson Opt AL", step=0.1, minval=0)
tott_length = input.int(5, title="TOTT Per AL", minval=1)
tott_opt = input.float(0.1, title="TOTT Opt AL", step=0.1, minval=0)
tott_coeff = input.float(0.006, title="TOTT Coeff AL", step=0.001, minval=0)

//GİRDİ SAT
t3_lengthSAT = input.int(5, title="Tillson Per SAT", minval=1)
t3_optSAT = input.float(0.1, title="Tillson Opt SAT", step=0.1, minval=0)
tott_lengthSAT = input.int(5, title="TOTT Per SAT", minval=1)
tott_opt_SAT = input.float(0.1, title="TOTT Opt SAT", step=0.1, minval=0)
tott_coeff_SAT = input.float(0.006, title="TOTT Coeff SAT", step=0.001, minval=0)

william_length = input.int(3, title="William %R Periyodu", minval=1)

// Tillson T3 AL
t3(src, length, opt) =>
    k = 2 / (length + 1)
    ema1 = ta.ema(src, length)
    ema2 = ta.ema(ema1, length)
    ema3 = ta.ema(ema2, length)
    ema4 = ta.ema(ema3, length)
    c1 = -opt * opt * opt
    c2 = 3 * opt * opt + 3 * opt * opt * opt
    c3 = -6 * opt * opt - 3 * opt - 3 * opt * opt * opt
    c4 = 1 + 3 * opt + opt * opt * opt + 3 * opt * opt
    t3_val = c1 * ema4 + c2 * ema3 + c3 * ema2 + c4 * ema1
    t3_val

t3_value = t3(close, t3_length, t3_opt)
t3_valueSAT = t3(close, t3_lengthSAT, t3_optSAT)


// TOTT hesaplaması (Twin Optimized Trend Tracker)
Var_Func(src, length) =>
    valpha = 2 / (length + 1)
    vud1 = math.max(src - src[1], 0)
    vdd1 = math.max(src[1] - src, 0)
    vUD = math.sum(vud1, 9)
    vDD = math.sum(vdd1, 9)
    vCMO = (vUD - vDD) / (vUD + vDD)
    var float VAR = na
    VAR := valpha * math.abs(vCMO) * src + (1 - valpha * math.abs(vCMO)) * nz(VAR[1], src)
    VAR

VAR = Var_Func(close, tott_length)
VAR_SAT = Var_Func(close, tott_lengthSAT)

//LONG 
MAvg = VAR
fark = MAvg * tott_opt * 0.01
longStop = MAvg - fark
longStopPrev = nz(longStop[1], longStop)
longStop := MAvg > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = MAvg + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := MAvg < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ? -1 : dir
MT = dir == 1 ? longStop : shortStop
OTT = MAvg > MT ? MT * (200 + tott_opt) / 200 : MT * (200 - tott_opt) / 200
OTTup = OTT * (1 + tott_coeff)
OTTdn = OTT * (1 - tott_coeff)

//CLOSE
MAvgS = VAR_SAT
farkS = MAvgS * tott_opt_SAT * 0.01
longStopS = MAvgS - farkS
longStopPrevS = nz(longStopS[1], longStopS)
longStopS := MAvgS > longStopPrevS ? math.max(longStopS, longStopPrevS) : longStopS
shortStopS = MAvgS + farkS
shortStopPrevS = nz(shortStopS[1], shortStopS)
shortStopS := MAvgS < shortStopPrevS ? math.min(shortStopS, shortStopPrevS) : shortStopS
dirS = 1
dirS := nz(dirS[1], dirS)
dirS := dirS == -1 and MAvgS > shortStopPrevS ? 1 : dirS == 1 and MAvgS < longStopPrevS ? -1 : dirS
MTS = dirS == 1 ? longStopS : shortStopS
OTTS = MAvgS > MTS ? MTS * (200 + tott_opt_SAT) / 200 : MTS * (200 - tott_opt_SAT) / 200
OTTupS = OTTS * (1 + tott_coeff_SAT)
OTTdnS = OTTS * (1 - tott_coeff_SAT)

// Calculation of Williams %R
williamsR = -100 * (ta.highest(high, william_length) - close) / (ta.highest(high, william_length) - ta.lowest(low, william_length))

// Alım koşulu
longCondition = (t3_value > OTTup) and (williamsR > -20)

// Short koşulu (long pozisyonunu kapatmak için)
shortCondition = (t3_valueSAT < OTTdnS) and (williamsR > -70)

// Alım pozisyonu açma
if (longCondition)
    strategy.entry("Long", strategy.long)

// Short koşulu sağlandığında long pozisyonunu kapama
if (shortCondition)
    strategy.close("Long")


// Alım pozisyonu boyunca barları yeşil yapma
barcolor(strategy.position_size > 0 ? color.green : na)

// Grafikte göstergeleri çizme
plot(t3_value, color=color.blue, linewidth=1, title="Tillson AL")
plot(OTTup, color=color.green, linewidth=1, title="TOTT Up AL")
plot(OTTdn, color=color.red, linewidth=1, title="TOTT Down AL")

// Grafikte göstergeleri çizme
plot(t3_valueSAT, color=color.blue, linewidth=1, title="Tillson SAT")
plot(OTTupS, color=color.green, linewidth=1, title="TOTT Up SAT")
plot(OTTdnS, color=color.red, linewidth=1, title="TOTT Down SAT")