この戦略は,MFI,RSI,Stoch RSIの3つの動態指標を統合して,暗号通貨の超買超売形状を判断し,取引信号を生成する.
MFI指数は,資金流動指数である.取引量と価格情報を総合的に考慮して,市場での買買力の強さを判断する.MFIは20を下回ると超売り,80以上は超買いを表す.
RSI指数は,相対的な強弱指数である.これは,価格の超買超売のレベルを描写する.RSIが30を下回ると超売が表示され,70を超えると超買が表示される.
ストックRSIはRSIの変数である。それはRSI指数自体が超買い超売りかどうかを判断する。パラメータは20-80に設定され,超買い超売り領域を表す。
この戦略の取引論理は
MFI,RSI,Stoch RSIの3つの指標が同時に超売り領域を下回った場合,多重超売り信号とみなされ,多額の取引を行う.
3つの指標が同時にオーバーバイ領域より高いときは,多重オーバーバイ信号とみなされ,空白する.
この戦略の優点は,複数の指標を承認することで,偽信号をフィルターして入場率の精度を向上させることができるという点にある。しかし,パラメータの設定は十分に最適化され,ストップと連携してリスクを制御する必要がある。
概して,動態指標は暗号通貨価格の脈動に敏感であり,複数の指標の融合は戦略の安定性を向上させることができる.しかし,トレーダーは市場の構造の変化に注意を払い,戦略の柔軟な調整を維持する必要がある.単一の戦略では,市場の多様性に完全に対応することは困難である.
/*backtest
start: 2023-08-13 00:00:00
end: 2023-09-12 00:00:00
period: 1h
basePeriod: 15m
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/
// Crypto Crew strategy entry signal long/short with stop loss. Exit signal not provided.
//
// Indicators: MFI + RSI + STOCH RSI
// Entry criteria: long when the three are oversold, short when the three indicators are overbought.
// Exit criteria: Take profit at Fib levels (not demonstrated here) measured from prevous highs/low.
// Feel free to contribute
//@version=4
strategy("Crypto Crew")
//inputs
source = hlc3
rsi_length = input(14, minval=1)
mfi_lenght = input(14, minval=1)
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
okay = "Okay"
good = "Good"
veryGood = "Very good"
tradingOpportunity = input(title="Opportunity Type", defval=veryGood, options=[okay, good, veryGood])
longThreshhold = tradingOpportunity==okay? 40 : tradingOpportunity==good ? 30 : tradingOpportunity==veryGood? 20 : 0
shortThreshhold = tradingOpportunity==okay? 60 : tradingOpportunity==good ? 70 : tradingOpportunity==veryGood? 80 : 0
//lines
mfi = mfi(source, mfi_lenght)
rsi = rsi(source, rsi_length)
rsi1 = rsi(close, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
longSignal = mfi<longThreshhold and rsi<longThreshhold and k<longThreshhold and d<longThreshhold? 1:-1
shortSignal = mfi>shortThreshhold and rsi>shortThreshhold and k>shortThreshhold and d>shortThreshhold? 1:-1
if longSignal > 0
strategy.entry("Long", strategy.long)
strategy.exit(id="Long Stop Loss", stop=close*0.8) //20% stop loss
if shortSignal > 0
strategy.entry("Short", strategy.short, stop=close*1.2)
strategy.exit(id="Short Stop Loss", stop=close*1.2) //20% stop loss
plot(k, color=color.blue)
plot(d, color=color.red)
plot(rsi, color=color.yellow)
plot(mfi, color=color.blue)
hline(longThreshhold, color=color.gray, linestyle=hline.style_dashed)
hline(shortThreshhold, color=color.gray, linestyle=hline.style_dashed)