真の相対的移動移動平均戦略

作者: リン・ハーンチャオチャン開催日:2024年1月30日16時04分19秒
タグ:

img

概要

TRMMA (True Relative Movement Moving Average) 戦略は,相対強度指数 (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")





もっと