T3 이동 평균 채널 파업 전략

저자:차오장, 날짜: 2023-09-14 15:51:25
태그:

전략 논리

이 전략은 T3 이동 평균과 그 채널을 사용하여 트렌드 방향을 파악하고, 가격이 채널 라인을 깨면 신호를 생성합니다.

거래의 논리는 다음과 같습니다.

  1. 중간선으로 T3 MA를 그려라

  2. MA 주변 채널 범위를 상단 및 하단 대역으로 계산합니다.

  3. 가격이 상위 범위를 넘을 때 길게 가십시오.

  4. 가격이 하위 범위를 넘어갈 때 짧은 이동

  5. 배경 색상의 변화는 트렌드 전환을 나타냅니다

T3 MA는 지연이 적고 파격에 더 빠르게 반응합니다. 전략은 또한 강력한 신호를위한 요소를 결합하여 장기 트렌드 판단을 돕기 위해 배경 색상을 사용합니다.

장점

  • T3 MA는 지연이 적고 반응이 빨라집니다.

  • 채널 브레이크에서 명확한 거래 신호

  • 배경 색상은 트렌드에 반대되는 나쁜 거래를 피합니다.

위험성

  • 최적의 매개 변수를 찾기 위해 반복 테스트가 필요합니다.

  • 함정에 빠질 수 있는 브레이크업 거래는 주의가 필요하다

  • 빈번한 신호, 더 넓은 브레이크를 고려

요약

이 전략은 트레이딩 채널 브레이크오웃을 통해 T3 MA의 민감성을 활용하며, 배경 색상은 장기적인 트렌드를 나타냅니다. 매개 변수 최적화는 효율성과 안정성 사이의 균형을 달성 할 수 있습니다. 그러나 과도한 거래 위험은 신중성을 필요로합니다.


/*backtest
start: 2022-09-07 00:00:00
end: 2023-04-15 00:00:00
period: 4d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Trader_7ye

//@version=4

strategy(title="T3MA_KC_7ye  Strategy", shorttitle="T3MA_KC_7ye  Strategy",max_bars_back=500,overlay=true,default_qty_type=strategy.percent_of_equity,default_qty_value=100,initial_capital=5000,currency=currency.USD)

t3(src,len)=>
    xe1 = ema(src, len)
    xe2 = ema(xe1, len)
    xe3 = ema(xe2, len)
    xe4 = ema(xe3, len)
    xe5 = ema(xe4, len)
    xe6 = ema(xe5, len)
    b = 0.7
    c1 = -b*b*b
    c2 = 3*b*b+3*b*b*b
    c3 = -6*b*b-3*b-3*b*b*b
    c4 = 1+3*b+b*b*b+3*b*b
    c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3
    
 
Length = input(title="DTMA Lenth", type=input.integer, defval=24, minval=1)
xPrice = input(title="DTMA Source", type=input.source, defval=close)
T3ma=t3(xPrice,Length)

upCol = T3ma > T3ma[1] 
downCol = T3ma < T3ma[1]


range= high - low
rangema=t3(range,Length)

upper = T3ma + rangema
lower = T3ma - rangema

myColor = upCol ? color.lime : downCol ? color.red : na
plot(T3ma, color=myColor, title="T3 Slow")

c = color.blue
u = plot(upper, color=#0094FF, title="Upper")
l = plot(lower, color=#0094FF, title="Lower")
fill(u, l, color=#0094FF, transp=95, title="Background")
buySignal = upCol and ohlc4>upper
sellSignal= downCol and ohlc4<lower

//=======输出======= 
//多空颜色判断
direction=0
direction:=buySignal?1:sellSignal?-1:direction[1]
macolor=direction==1?color.green:color.red

//多信号处理为一个信号
alertlong = direction!=direction[1] and direction== 1
alertshort= direction!=direction[1] and direction==-1
bgcolor(alertshort ? color.red : alertlong?color.lime:na, transp=20)

if (alertlong)
    strategy.entry("Long", strategy.long)
if (alertshort)
    strategy.entry("Short",strategy.short)

더 많은