
この戦略は,トレンド追跡と区間取引を組み合わせた自己適応システムであり,波動指数 ((CI)) によって市場の状態を判断し,異なる市場環境に応じて対応する取引ロジックを採用する.トレンド市場で,戦略はEMA交差とRSI超買い超売りシグナルを利用して取引する.区間市場で,主にRSI指標の極値に基づいて取引する.戦略には,リスクを制御し,利益をロックするためのストップ・ストップメカニズムも含まれている.
戦略の核心は,波動指数 ((CI)) を使って市場をトレンド市場 ((CI<38.2) と区間市場 ((CI>61.8) との2つの状態に分割することです.トレンド市場では,急速EMA ((9サイクル) においてゆっくりとEMA ((21サイクル) を通過し,RSIが70を下回ったときに多頭開きます.ゆっくりとEMAにわたって急速EMAを通過し,RSIが30を超えると空頭開きます.区間市場では,RSIが30を下回ると多頭開きます,70を超えると空頭開きます.同時に,戦略は,平仓と2%のストップ損失と4%のストップレベルを設定します.
この戦略は,複数の技術指標を組み合わせて,自己適応的な取引システムを構築し,異なる市場環境で安定したパフォーマンスを保ちます.戦略の核心的な優位性は,市場の適応性と完善したリスク管理機構にありますが,パラメータ最適化や市場条件依存性などの問題にも注意する必要があります.継続的な最適化と改善により,この戦略は,さまざまな市場環境でより良い取引効果を達成すると見込まれています.
/*backtest
start: 2024-12-19 00:00:00
end: 2024-12-26 00:00:00
period: 45m
basePeriod: 45m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © nopology
//@version=6
strategy("CI, EMA, RSI", overlay=false)
// Input parameters
lengthCI = input(14, title="CI Length")
lengthRSI = input(14, title="RSI Length")
fastLength = input(9, title="Fast EMA Length")
slowLength = input(21, title="Slow EMA Length")
// Calculate CI
atr = ta.atr(lengthCI)
highLowRange = math.log10(math.max(high[lengthCI], high) - math.min(low[lengthCI], low))
sumATR = math.sum(atr, lengthCI)
ci = 100 * (math.log10(sumATR / highLowRange) / math.log10(lengthCI))
// Calculate RSI
rsi = ta.rsi(close, lengthRSI)
// Calculate EMAs
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
// Define conditions
trendingMarket = ci < 38.2
rangingMarket = ci > 61.8
bullishSignal = ta.crossover(fastEMA, slowEMA) and rsi < 70
bearishSignal = ta.crossover(slowEMA, fastEMA) and rsi > 30
// Plot indicators for visualization
plot(ci, title="Choppiness Index", color=color.purple, linewidth=2)
plot(fastEMA, title="Fast EMA", color=color.blue)
plot(slowEMA, title="Slow EMA", color=color.red)
// Strategy Execution
if (trendingMarket)
if (bullishSignal)
strategy.entry("Long", strategy.long)
if (bearishSignal)
strategy.entry("Short", strategy.short)
else if (rangingMarket)
if (rsi < 30)
strategy.entry("Long", strategy.long)
if (rsi > 70)
strategy.entry("Short", strategy.short)
// Close positions when conditions no longer met or reverse
if (trendingMarket and not bullishSignal)
strategy.close("Long")
if (trendingMarket and not bearishSignal)
strategy.close("Short")
if (rangingMarket and rsi > 40)
strategy.close("Long")
if (rangingMarket and rsi < 60)
strategy.close("Short")
// Optional: Add stop loss and take profit
stopLossPerc = input.float(2, title="Stop Loss (%)", minval=0.1, step=0.1) / 100
takeProfitPerc = input.float(4, title="Take Profit (%)", minval=0.1, step=0.1) / 100
strategy.exit("Exit Long", "Long", stop=close*(1-stopLossPerc), limit=close*(1+takeProfitPerc))
strategy.exit("Exit Short", "Short", stop=close*(1+stopLossPerc), limit=close*(1-takeProfitPerc))