
メジャー・トレンド・インジケーター・ロング (MTIL) は,様々な金融機関 (暗号通貨であるビットコイン,イーサリアム,そしてAppleなどの伝統的な株式を含む) に適用される取引戦略である.これは,潜在的多頭トレンドを特定して,ロングラインを設定するために設計されている.
MTIL策略は,最適化されたパラメータを使用して,特定の回顧周期内の最高価格と最低価格を計算します. 線形回帰法を使用して,価格データをスムーズに処理し,潜在的なブルマーケットのトレンドを識別し,複数の信号を発信します.
具体的には,この戦略は,まず特定の周期内の最高値と最低値を計算する. そして,異なるパラメータの線形回帰を使用して最高値と最低値を平滑化する. これは,上位と下位を生成する. 平滑後の最高価格ラインが上位と下位を突破し,収束価格の短期線形回帰が長期線形回帰よりも高いとき,多頭信号が生成される.
MTIL戦略は以下の利点があります.
MTIL戦略には以下のリスクもあります.
パラメータの調整,ストップロスの設定,取引コストの制御などの方法によって,部分的なリスクを回避できます.
MTILの戦略は以下の点で最適化できます.
MTILは,線形回帰技術を利用して大トレンドを識別する多頭戦略である.これは,パラメータを調整することで,異なる市場環境に適用できる.空頭戦略の組み合わせで使用すると,より包括的な分析を提供することができる.最適化調整を経て,その正確性と収益性の両方が向上することができる.
/*backtest
start: 2023-02-12 00:00:00
end: 2024-02-18 00:00:00
period: 1d
basePeriod: 1h
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/
// © jensenvilhelm
//@version=5
strategy("Major Trend Indicator Long", shorttitle='MTIL', overlay = true)
startDate = timestamp("2001 06 18")
// Sets the start date for the strategy.
// Optimized parameters
length_high = 5
length_low = 5
linReg_st = 3
linReg_st1 = 23
linReg_lt = 75
// Defines key parameters for the strategy.
X_i = ta.highest(high, length_high)
Y_i = ta.lowest(low, length_low)
// Calculates the highest and lowest price values within the defined lookback periods.
x_y = ta.linreg(X_i + high, linReg_st1, 1)
y_x = ta.linreg(Y_i + low, linReg_lt, 1)
// Applies linear regression to smoothed high and low prices.
upper = ta.linreg(x_y, linReg_st1, 6)
lower = ta.linreg(y_x, linReg_st1, 6)
// Determines upper and lower bounds using linear regression.
upperInside = upper < y_x and upper > x_y
lowerInside = lower > y_x and lower < x_y
y_pos = (upper + lower) / 4
X_i1 = ta.highest(high, length_high)
Y_i1 = ta.lowest(low, length_low)
bull = x_y > upper and y_x > lower and ta.linreg(close, linReg_st, 1) > ta.linreg(close, linReg_lt, 5)
// Defines a bullish condition based on linear regression values and price bounds.
plotshape(series=(bull) ? y_pos : na, style=shape.circle, location=location.absolute, color=color.rgb(41, 3, 255, 40), size=size.tiny)
if (time >= startDate)
if (bull)
strategy.entry("Long", strategy.long)
if not (bull)
strategy.close("Long")
// Controls the strategy's execution based on the bullish condition and the start date.