실제 상대적 이동 이동 평균 전략

저자:차오장, 날짜: 2024-01-30 16:04:19
태그:

img

전반적인 설명

진정한 상대적 이동 이동 평균 (TRMMA) 전략은 상대적 강도 지수 (RSI) 와 진정한 강도 지수 (TSI) 를 결합한 트렌드를 따르는 전략이다. 전략 최적화를 위해 이동 평균과 함께 구매 및 판매 신호를 생성하기 위해 RSI 및 TSI의 지표를 사용합니다.

원칙

이 전략은 다음과 같은 주요 부분으로 구성됩니다.

  1. TSI 계산 이중 지수 평형을 통해 가격 변화율의 기하급수 평형 값을 계산하고, 그것을 절대 가격 변화율의 기하급수 평형 값으로 나눈 다음 TSI 지표를 얻습니다. 장기 기간은 25 일, 단기 기간은 5 일, 신호 선은 14 일입니다.

  2. RSI 계산 RSI 인디케이터는 5 일 동안의 입력값과 연장값으로 닫습니다.

  3. 신호판결 구매 신호는 TSI가 신호선을 넘어서고 RSI가 50을 넘어서면 생성됩니다. 판매 신호는 TSI가 신호선을 넘어서고 RSI가 50을 넘어서면 생성됩니다.

  4. 촛불색 신호에 따라 촛불을 색칠해 판단을 돕습니다.

  5. 전략 매개 변수 위치 비율과 자본과 같은 매개 변수를 설정합니다.

이점 분석

이 전략은 TSI와 RSI 지표를 결합하여 시장 추세와 과잉 구매/ 과잉 판매 상황을 효과적으로 판단하여 거래 신호를 생성합니다. TSI 또는 RSI만을 사용하는 것과 비교하면 더 많은 잘못된 신호를 필터링할 수 있습니다. 또한 기본 매개 변수와 비교하면 이 전략은 더 일찍과 더 높은 품질의 거래 신호를 얻기 위해 TSI와 RSI 매개 변수를 더 적극적으로 설정합니다.

위험 분석

이 전략의 주요 위험은 다음과 같습니다.

  1. 매개 변수 최적화 위험. TSI와 RSI의 최적 매개 변수는 시장, 제품 및 시간 틀에 따라 다를 수 있습니다. 매개 변수는 특정 상황에 최적화되어야합니다.

  2. 트렌드 역전 위험. 전략 자체는 트렌드에 초점을 맞추고 있습니다. 단기 조정 또는 중장기 트렌드 역전으로 인한 갑작스러운 사건은 전략에 더 큰 손실을 초래합니다.

  3. 빈번한 신호 위험. 기본 매개 변수와 비교하면 이 전략은 더 공격적인 매개 변수 설정을 사용하며, 이는 더 빈번한 거래 신호를 생성하여 더 높은 거래 비용과 구현 어려움을 초래할 수 있습니다.

최적화 방향

이 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.

  1. 더 많은 신호를 필터하여 이동 평균 및 다른 지표와 결합하여 빈번한 거래를 줄이십시오.

  2. 가장 좋은 매개 변수 설정을 찾기 위해 다른 시장과 제품에서 TSI와 RSI 매개 변수의 최적의 조합을 테스트합니다.

  3. 한 번의 손실 위험을 통제하기 위해 스톱 로스 전략을 늘려라.

  4. 포지션 관리를 최적화하고, 트렌드가 강할 때 포지션을 늘리고, 트렌드가 약해질 때 포지션을 줄입니다.

결론

TRMMA 전략은 입출시기를 결정하기 위해 TSI와 RSI 지표를 결합하여 강력한 트렌드 포착 능력을 갖는다. TSI 또는 RSI만을 사용하는 것과 비교하면 잘못된 신호를 효과적으로 필터링할 수 있다. 전략의 안정성은 매개 변수 최적화, 스톱 로스 전략, 포지션 관리 등을 통해 더욱 향상될 수 있다. 전략은 높은 수익을 추구하는 어느 정도의 양적 기반을 가진 투자자에게 적합하다.


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

// "True relative Movement" or "TRM" for short is a system that combines my two favorite indicators: RSI and TSI. I strived to put together an indicator that combined the best of both 
// in order to help discretionary traders predict market direction, weakness and strength. As with most technical indicators there are "Buy and sell" signals. Similiar to Elder Impulse system, 
///TRM paints bars 3 different colors to display 3 different conditions: Blue for "Buy", Pink for "Sell", and gray for "Take profit/Hold". When the bars turn blue, that means all conditions
/// have been met. When they turn pink, no conditions have been met. When they are gray, only one condition has been met. The system is simple, yet effective. A buy signal is prodcued when 
/// TSI is above the signal line, and RSI is above 50, and vice versa for sell signals. I have modified the default parameters for TSI and RSI for more "aggressive" entries and exits. I may later on
/// name this condition "Fast-TRM" and "Slow-TRM" for when default settings for TSI and RSI are applies, as this is a very robust system as well. 

///******ES 1HR, 15MIN/5MIN SYSTEM***** Go long, when all time frame on a buy signal and vice versa. Take profit when the 5 min chart flips to buy or sell depending on what side of the trade you are on. Close or flip
//// long/short when time all time frames flip to Buy/Hold if short and Sell/Hold if long. Use 20EMA for additional confirmation. 

//@version=4
strategy("TKP-TRM Strategy", overlay=true)
Note = input( 0, title = "TSI standard values are 25, 13, 13, and RSI is 14. Can change the default values to these for 'Slow TRM'")
long = input(title="TSI-Long Length", type=input.integer, defval=25)
short = input(title="TSI-Short Length", type=input.integer, defval=5)
signal = input(title="TSI-Signal Length", type=input.integer, defval=14)
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)
TSI_Signal_Line = (ema(tsi_value, signal))


/////////////////////////////RSI////////////////////////////////////////////////

src = close, len = input(5, minval=1, title="RSILength")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsiBuyfilterlevel = input(50, minval = 1, title = "RSI cross above Buy Level")
rsiSellfilterlevel = input(50, minval = 1, title = "RSI cross below Sell Level")

////////////////////////////Bar Coloring//////////////////////////////////////////////////////////

TRM_Buy = ((tsi_value > TSI_Signal_Line) and (rsi > rsiBuyfilterlevel))
TRM_Sell = ( (tsi_value < TSI_Signal_Line) and (rsi <rsiSellfilterlevel))
TRM_Color = TRM_Buy? #3BB3E4 : TRM_Sell? #FF006E : #b2b5be
barcolor(TRM_Color)


///////////////////////////Strategy Paramters////////////////////////////////////////

if (TRM_Buy)
    strategy.entry("Long", strategy.long, comment="Long")

if (TRM_Sell)
    strategy.close("Long", comment="Sell")





더 많은