TSIのダウンロードと解説|MT4インジケーター

TSIアイキャッチ
  • URLをコピーしました!

TSIというMT4インジケーターがほしいです。

TSIはどんなインジケーターなのですか?

ホシノ

FXの不労所得だけで年収2000万を達成しました。
このお悩みに誠意をもって回答します。

BBF_MQL5-202400601
リアルトレード公開|EA BBF

このページでわかること・できること

〇TSIインジケーターのダウンロード

〇TSIについての詳しい解説

目次

TSIのダウンロード

ここからインジケーターのダウンロードが可能。
ダウンロードするインジケーターは.ex4ファイルのため、MT4のインジケーターフォルダへ移動すれば使用できる。

TSIインジケーターのインストール

ダウンロードしたTSIインジケーターはMT4のデータフォルダからindicatorsフォルダを探しファイルを移動する。

ファイル>データフォルダを開く>MQL4>indicators

indicatorsフォルダにファイルを移動し、MT4を再起動するとインストールが完了する。

TSIとは?|MT4インジケーター

TSIチャート画像
TSIインジケーター

MT4(MetaTrader 4)におけるTSI(True Strength Index)は、トレンドの強さと方向を評価するためのモメンタムベースのオシレーターだ。TSIはダブル指数移動平均(EMA)を使用し、モメンタムの滑らかな値を計算する。以下にTSIの計算方法とその意味について詳しく説明する。

TSIの計算式

TSIの計算式は以下の通り。

[math]{TSI}(\text{終値}, r, s) = 100 \times \frac{\text{EMA}(\text{EMA}(\text{mtm}, r), s)}{\text{EMA}(\text{EMA}(|\text{mtm}|, r), s)}[/math]

ここで、各項目は以下のように定義される:

  • 終値: 株式や通貨ペアなどの取引の終値。
  • mtm (momentum): モメンタム。通常、現在の終値から前の終値を引いたもの。つまり、
    [math]{mtm}(i) = \text{Close}(i) – \text{Close}(i-1)[/math]
  • r: 最初のEMAの期間。
  • s: 二番目のEMAの期間。
  • EMA: 指数移動平均。

計算手順

  1. モメンタムの計算(mtm):
    [math]{mtm}(i) = \text{Close}(i) – \text{Close}(i-1)[/math]
  2. モメンタムの絶対値の計算:
    [math]|\text{mtm}|[/math]
  3. モメンタムのEMAの計算:
    [math]\text{EMA}(\text{mtm}, r)[/math]
  4. モメンタムEMAのEMAの計算:
    [math]\text{EMA}(\text{EMA}(\text{mtm}, r), s)[/math]
    [math]\text{EMA}(\text{EMA}(|\text{mtm}|, r), s)[/math]
  5. TSIの計算:
    [math]\text{TSI} = 100 \times \frac{\text{EMA}(\text{EMA}(\text{mtm}, r), s)}{\text{EMA}(\text{EMA}(|\text{mtm}|, r), s)} [/math]

パラメーターについて

TSIパラメーター画面
TSIのパラメーター

TSI(True Strength Index)のパラメーターは、主に以下の3つ。これらのパラメーターはTSIの計算に使用され、インジケーターの応答性や滑らかさに影響を与える。

  1. r(短期EMA期間)
    • TSI計算の最初のEMA期間。
    • このパラメーターは、モメンタム(mtm)の短期的な変動を滑らかにするために使用される。
    • 例えば、[math]r[/math]が7の場合、直近7期間のモメンタムを滑らかにする。
  2. s(長期EMA期間)
    • TSI計算の2番目のEMA期間。
    • このパラメーターは、短期EMAで滑らかにされたモメンタム(またはその絶対値)をさらに滑らかにするために使用される。
    • 例えば、sが25の場合、短期EMAで滑らかにされたモメンタムをさらに25期間にわたって滑らかにする。
  3. SignalPeriod(シグナル期間)
    • TSIのシグナルラインを計算するためのEMA期間。
    • シグナルラインは、TSIの値のさらに滑らかなバージョンであり、トレンドの確認やエントリー/エグジットのシグナルとして使用される。
    • 例えば、SignalPeriodが7の場合、7期間のTSI値を滑らかにしてシグナルラインを計算する。

パラメーターの効果

  • 短期EMA期間(r)
    • 短期EMA期間が短いほど、TSIは価格変動に対してより敏感になります。つまり、TSIがより速く反応し、ノイズが多くなる。
    • 短期EMA期間が長いほど、TSIは滑らかになり、反応が遅くなるが、ノイズが少なくなる。
  • 長期EMA期間(s)
    • 長期EMA期間が短いほど、短期EMAで滑らかにされたモメンタムに対するTSIの反応が速くなる。
    • 長期EMA期間が長いほど、TSIはさらに滑らかになり、遅行性が増す。
  • シグナル期間(SignalPeriod)
    • シグナル期間が短いほど、シグナルラインはTSIに対してより速く反応し、トレンドの変化を迅速に示すが、誤シグナルが増える可能性がある。
    • シグナル期間が長いほど、シグナルラインは滑らかになり、より確実なシグナルを提供するが、遅行性が増す。

パラメーターの設定例

  • デフォルト設定:一般的なデフォルト設定として、短期EMA期間(r)を25、長期EMA期間(s)を13、シグナル期間(SignalPeriod)を7とすることがよくある。
  • 短期取引(スキャルピングなど):価格変動に敏感に反応するように、短期EMA期間(r)を短くし(例えば、5〜10)、長期EMA期間(s)も短めに設定する(例えば、10〜15)。シグナル期間も短めに設定する(例えば、3〜5)。
  • 長期取引(スイングトレードなど):滑らかな指標を得るために、短期EMA期間(r)を長くし(例えば、30〜50)、長期EMA期間(s)も長めに設定する(例えば、20〜40)。シグナル期間も長めに設定する(例えば、10〜15)。

結論

TSIのパラメーターは、トレーダーの取引スタイルや市場の状況に応じて調整する必要がある。異なるパラメーターをテストし、自分の戦略に最適な設定を見つけることが重要となる。

TSIのプログラム

//+------------------------------------------------------------------+
//|                                                          TSI.mq4 |
//|                                     Copyright 2024, FX-Bonus.net |
//|                                            https://fx-bonus.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, FX-Bonus.net"
#property link      "https://fx-bonus.net/"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 DeepPink
#property indicator_maximum 100
#property indicator_minimum -100
#property indicator_level1 0
#property indicator_level2 50
#property indicator_level3 -50

extern int First_R = 7;
extern int Second_S = 7;
extern int SignalPeriod = 7;

double TSI_Buffer[];
double SignalBuffer[];
double MTM_Buffer[];
double EMA_MTM_Buffer[];
double EMA2_MTM_Buffer[];
double ABSMTM_Buffer[];
double EMA_ABSMTM_Buffer[];
double EMA2_ABSMTM_Buffer[];

int OnInit()
{
    IndicatorBuffers(8);
    SetIndexBuffer(2, MTM_Buffer);
    SetIndexBuffer(3, EMA_MTM_Buffer);
    SetIndexBuffer(4, EMA2_MTM_Buffer);
    SetIndexBuffer(5, ABSMTM_Buffer);
    SetIndexBuffer(6, EMA_ABSMTM_Buffer);
    SetIndexBuffer(7, EMA2_ABSMTM_Buffer);

    SetIndexStyle(0, DRAW_LINE);
    SetIndexBuffer(0, TSI_Buffer);
    SetIndexLabel(0, "TSI");
    SetIndexStyle(1, DRAW_LINE);
    SetIndexBuffer(1, SignalBuffer);
    SetIndexLabel(1, "Signal");

    IndicatorShortName("TSI(" + IntegerToString(First_R) + "," + IntegerToString(Second_S) + "," + IntegerToString(SignalPeriod) + ")");


    return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
    int limit = MathMax(First_R, MathMax(Second_S, SignalPeriod)) + 2;
    if (rates_total <= limit)
        return 0;

    int start_index = rates_total - limit;

    for (int i = start_index; i >= 0; i--)
    {
        MTM_Buffer[i] = (close[i] - close[i + 1]);
        ABSMTM_Buffer[i] = MathAbs(MTM_Buffer[i]);
    }

    for (int i = start_index; i >= 0; i--)
    {
        EMA_MTM_Buffer[i] = iMAOnArray(MTM_Buffer, 0, First_R, 0, MODE_EMA, i);
        EMA_ABSMTM_Buffer[i] = iMAOnArray(ABSMTM_Buffer, 0, First_R, 0, MODE_EMA, i);
    }

    for (int i = start_index; i >= 0; i--)
    {
        EMA2_MTM_Buffer[i] = iMAOnArray(EMA_MTM_Buffer, 0, Second_S, 0, MODE_EMA, i);
        EMA2_ABSMTM_Buffer[i] = iMAOnArray(EMA_ABSMTM_Buffer, 0, Second_S, 0, MODE_EMA, i);
    }

    for (int i = start_index; i >= 0; i--)
    {
        TSI_Buffer[i] = 100.0 * EMA2_MTM_Buffer[i] / EMA2_ABSMTM_Buffer[i];
    }

    for (int i = start_index; i >= 0; i--)
    {
        SignalBuffer[i] = iMAOnArray(TSI_Buffer, 0, SignalPeriod, 0, MODE_EMA, i);
    }

    return rates_total;
}

ソースコードを詳しく解説

メタデータとパラメータの定義

#property strict
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 DeepPink
#property indicator_maximum 100
#property indicator_minimum -100
#property indicator_level1 0
#property indicator_level2 50
#property indicator_level3 -50
  • #property strict:コードの厳格なチェックを有効する。
  • #property indicator_separate_window:インジケーターをメインチャートとは別のウィンドウに表示。
  • #property indicator_buffers 2:インジケーターが2つのバッファを使用することを指定。
  • #property indicator_color1 Gold:最初のインジケーターラインの色を金色に設定。
  • #property indicator_color2 DeepPink:2番目のインジケーターラインの色をディープピンクに設定。
  • #property indicator_maximum 100:インジケーターウィンドウの最大値を100に設定。
  • #property indicator_minimum -100:インジケーターウィンドウの最小値を-100に設定。
  • #property indicator_level1 0:レベルラインを0に設定。
  • #property indicator_level2 50:レベルラインを50に設定。
  • #property indicator_level3 -50:レベルラインを-50に設定。

外部パラメーターとバッファの宣言

extern int First_R = 7;
extern int Second_S = 7;
extern int SignalPeriod = 7;

double TSI_Buffer[];
double SignalBuffer[];
double MTM_Buffer[];
double EMA_MTM_Buffer[];
double EMA2_MTM_Buffer[];
double ABSMTM_Buffer[];
double EMA_ABSMTM_Buffer[];
double EMA2_ABSMTM_Buffer[];
  • extern int First_R = 7;:最初のEMAの期間を設定(デフォルトは7)。
  • extern int Second_S = 7;:2番目のEMAの期間を設定(デフォルトは7)。
  • extern int SignalPeriod = 7;:シグナルラインのEMA期間を設定(デフォルトは7)。

初期化関数

int OnInit()
{
    IndicatorBuffers(8);
    SetIndexBuffer(2, MTM_Buffer);
    SetIndexBuffer(3, EMA_MTM_Buffer);
    SetIndexBuffer(4, EMA2_MTM_Buffer);
    SetIndexBuffer(5, ABSMTM_Buffer);
    SetIndexBuffer(6, EMA_ABSMTM_Buffer);
    SetIndexBuffer(7, EMA2_ABSMTM_Buffer);

    SetIndexStyle(0, DRAW_LINE);
    SetIndexBuffer(0, TSI_Buffer);
    SetIndexLabel(0, "TSI");
    SetIndexStyle(1, DRAW_LINE);
    SetIndexBuffer(1, SignalBuffer);
    SetIndexLabel(1, "Signal");

    IndicatorShortName("TSI(" + IntegerToString(First_R) + "," + IntegerToString(Second_S) + "," + IntegerToString(SignalPeriod) + ")");

    return INIT_SUCCEEDED;
}
  • IndicatorBuffers(8);:使用するバッファの数を8に設定。
  • SetIndexBuffer:各バッファをインデックスに関連付けする。
  • SetIndexStyle:インジケーターのスタイルを設定(ここでは、線を描画)。
  • SetIndexLabel:各バッファのラベルを設定。
  • IndicatorShortName:インジケーターの短い名前を設定。

計算関数

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
    int limit = MathMax(First_R, MathMax(Second_S, SignalPeriod)) + 2;
    if (rates_total <= limit)
        return 0;

    int start_index = rates_total - limit;

    for (int i = start_index; i >= 0; i--)
    {
        MTM_Buffer[i] = (close[i] - close[i + 1]);
        ABSMTM_Buffer[i] = MathAbs(MTM_Buffer[i]);
    }

    for (int i = start_index; i >= 0; i--)
    {
        EMA_MTM_Buffer[i] = iMAOnArray(MTM_Buffer, 0, First_R, 0, MODE_EMA, i);
        EMA_ABSMTM_Buffer[i] = iMAOnArray(ABSMTM_Buffer, 0, First_R, 0, MODE_EMA, i);
    }

    for (int i = start_index; i >= 0; i--)
    {
        EMA2_MTM_Buffer[i] = iMAOnArray(EMA_MTM_Buffer, 0, Second_S, 0, MODE_EMA, i);
        EMA2_ABSMTM_Buffer[i] = iMAOnArray(EMA_ABSMTM_Buffer, 0, Second_S, 0, MODE_EMA, i);
    }

    for (int i = start_index; i >= 0; i--)
    {
        TSI_Buffer[i] = 100.0 * EMA2_MTM_Buffer[i] / EMA2_ABSMTM_Buffer[i];
    }

    for (int i = start_index; i >= 0; i--)
    {
        SignalBuffer[i] = iMAOnArray(TSI_Buffer, 0, SignalPeriod, 0, MODE_EMA, i);
    }

    return rates_total;
}

関数の引数

  • rates_total:現在のバーの数。
  • prev_calculated:以前に計算されたバーの数。
  • time[]open[]high[]low[]close[]tick_volume[]volume[]spread[]:価格データおよびその他のデータ配列。

計算処理

  1. 初期設定
    int limit = MathMax(First_R, MathMax(Second_S, SignalPeriod)) + 2; if (rates_total <= limit) return 0;
    • 必要な最小バー数を計算。バー数が少なすぎる場合、計算を中止。
  2. モメンタムの計算:mql4コードをコピーするint start_index = rates_total - limit; for (int i = start_index; i >= 0; i--) { MTM_Buffer[i] = (close[i] - close[i + 1]); ABSMTM_Buffer[i] = MathAbs(MTM_Buffer[i]); }
    • モメンタム(MTM)とその絶対値を計算してバッファに格納。
  3. 最初のEMAの計算for (int i = start_index; i >= 0; i--) { EMA_MTM_Buffer[i] = iMAOnArray(MTM_Buffer, 0, First_R, 0, MODE_EMA, i); EMA_ABSMTM_Buffer[i] = iMAOnArray(ABSMTM_Buffer, 0, First_R, 0, MODE_EMA, i); }
    • モメンタムとその絶対値の最初のEMAを計算してバッファに格納。
  4. 2番目のEMAの計算for (int i = start_index; i >= 0; i--) { EMA2_MTM_Buffer[i] = iMAOnArray(EMA_MTM_Buffer, 0, Second_S, 0, MODE_EMA, i); EMA2_ABSMTM_Buffer[i] = iMAOnArray(EMA_ABSMTM_Buffer, 0, Second_S, 0, MODE_EMA, i); }
    • 最初のEMAの結果の2番目のEMAを計算してバッファに格納。
  5. TSIの計算for (int i = start_index; i >= 0; i--) { TSI_Buffer[i] = 100.0 * EMA2_MTM_Buffer[i] / EMA2_ABSMTM_Buffer[i]; }
    • TSIの最終値を計算してバッファに格納。
  6. シグナルラインの計算for (int i = start_index; i >= 0; i--) { SignalBuffer[i] = iMAOnArray(TSI_Buffer, 0, SignalPeriod, 0, MODE_EMA, i); }
    • TSIのシグナルラインを計算してバッファに格納。
  7. 結果の返却
    return rates_total;
    • 現在のバー数を返却して計算を終了。

MT4インジケーターまとめ

  • URLをコピーしました!
  • URLをコピーしました!

このEAを使って、将来の見通しが立ちました

収入を増やしたい、将来のための資産が欲しい、支払いに縛られない自由な生活がしたい

このEAを使うと将来が見通せます。

22年以上で無敗の安定取引。リスク0%運用も可能なロジック。年利100%越えの上級者向け取引も可能。

マネーマシンとして育て上げることで大きな不労所得を得られます。

BBF-Girl
ドリームEA_BBF 無料ダウンロード
BBF_MQL5-202400601
リアルトレード公開|EA BBF

ポジション監視の時間

集中力は続いてますか?


オートクローズツールを使ってポジション管理を自動化


自動ポジション管理だから万が一でも大丈夫

あなたは空いた時間を自由に、効率的に使えます

自動決済ルールは独自にカスタム可能

ストップ、リミット変更にも対応。

エントリー後のポジション管理をすべて自動化できるトレーディングサポートツール。

トレード中のちょっとした離席など、念のためセットといった使い方も可能。

MT4用自動決済ツール【AutoCloseTool】は無料で入手できます。

オートクローズツール

取引ごとにキャッシュバックが発生します

もらわないだけ損している
取引ごとに毎回発生する現金のキャッシュバック
海外FXのキャッシュバックはメリットしかないサービスです

取引ごとにキャッシュバック
目次