
이 전략은 상대적으로 약한 지수 ((RSI), 평균 방향 지수 ((ADX) 와 일차 균형 도표 ((Ichimoku Cloud) 를 결합하여 세 가지 기술 지표를 결합하여 다중 요소 트렌드 추적 수치화 거래 전략을 구성한다. 전략의 주요 아이디어는 RSI 지표를 사용하여 시장의 과매매 상황을 판단하고, ADX 지표는 트렌드 강도를 판단하고, 일차 균형 도표는 트렌드 방향을 판단하고, 이동 평균 선의 교차 신호와 결합하여 특정 조건을 충족할 때 포지션을 열거나 상쇄한다.
이 전략은 RSI, ADX 및 일회성 도표의 세 가지 기술 지표를 혁신적으로 결합하여 다중 요소 트렌드 추적 수량 거래 전략을 구축한다. 전략은 트렌드 추적 및 위험 제어에 있어서 어느 정도 장점이 있지만, 또한 파라미터 최적화, 시장 위험 및 거래 비용과 같은 위험도 존재한다.
/*backtest
start: 2023-05-11 00:00:00
end: 2024-05-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stratejim RSI, ADX ve Ichimoku ile", overlay=true, margin_long=100, margin_short=100)
// ADX, RSI ve Ichimoku tanımları
[diPlus, diMinus, adx] = ta.dmi(14, 14)
rsiPeriod = 14
rsi = ta.rsi(close, rsiPeriod)
tenkanPeriod = 9
kijunPeriod = 26
senkouSpanBPeriod = 52
displacement = 26
tenkan = ta.sma((high + low) / 2, tenkanPeriod)
kijun = ta.sma((high + low) / 2, kijunPeriod)
senkouSpanA = (tenkan + kijun) / 2
senkouSpanB = ta.sma((high + low) / 2, senkouSpanBPeriod)
// Ichimoku Bulutu koşulları
priceAboveCloud = close > ta.valuewhen(bar_index, math.max(senkouSpanA, senkouSpanB), displacement)
priceBelowCloud = close < ta.valuewhen(bar_index, math.min(senkouSpanA, senkouSpanB), displacement)
// Uzun pozisyon için koşullar
longSmaCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
longAdxCondition = adx > 20
longRsiCondition = rsi < ta.sma(rsi, rsiPeriod)
if (longSmaCondition and longAdxCondition and not longRsiCondition and priceAboveCloud)
strategy.entry("My Long Entry Id", strategy.long)
// Kısa pozisyon için koşullar
shortSmaCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
shortAdxCondition = adx > 20
shortRsiCondition = rsi > ta.sma(rsi, rsiPeriod)
if (shortSmaCondition and shortAdxCondition and not shortRsiCondition and priceBelowCloud)
strategy.entry("My Short Entry Id", strategy.short)