골든 섹션과 상대 강도 RSI 전략


생성 날짜: 2024-01-03 16:54:32 마지막으로 수정됨: 2024-01-03 16:54:32
복사: 0 클릭수: 852
avatar of ChaoZhang ChaoZhang
1
집중하다
1621
수행원

골든 섹션과 상대 강도 RSI 전략

개요

금분열과 상대적으로 약한 지표 (RSI) 전략은 인트라데이 (Intraday) 거래 전략이다. 그것은 피보나치 금분열 법칙과 RSI 지표를 결합하여, 가격이 금분열의 중요한 지점에 접근할 때, RSI가 과도하게 구매하거나 판매하고 있는지 판단하여 구매 또는 판매 신호를 발송한다.

전략 원칙

  1. 일정 길이의 K 선에 따라 가격을 계산하는 중축선.

  2. 중축과 표준차에 따라 금분열의 핵심점을 계산하여, 0.618 레벨과 1 레벨을 포함한다.

  3. 가격이 금분열의 중요한 지점에 가까워지면 RSI 지표가 과매도 또는 과매도 영역에 진입했는지 확인하십시오.

  4. 금분법과 RSI 조건이 동시에 충족되면 구매 또는 판매 신호를 발송한다.

  5. 스톱로스 및 스톱을 설정하여 위험을 제어하십시오.

우위 분석

  1. 여러 지표와 결합하여 신호 품질을 높이고 가짜 신호를 줄일 수 있다.

  2. 금분법의 지지/저항 특성을 활용하여 입시 품질을 높여라.

  3. RSI 지표는 시장의 심리적 측면을 판단하여 극단적 인 상황의 반전을 방지합니다.

  4. 높은 빈도 인트라데이 거래에 적합한 이윤은 여러 개의 작은 거래로 축적될 수 있다.

위험 분석

  1. 금분리법은 금의 가격의 100%를 보장하지 않습니다.

  2. RSI 지표는 잘못된 신호를 발산할 수 있으며, 가격 움직임과 함께 판단해야 합니다.

  3. 가격 변동으로 인해 스톱포인트가 너무 작게 설정되면 스톱포인트가 사라질 수 있습니다.

  4. 높은 주파수 거래는 더 많은 거래 비용과 더 엄격한 위험 통제를 필요로 한다.

해결책:

  1. 단편적 손실을 통제하기 위한 엄격한 손해 방지 규칙을 준수하십시오.

  2. RSI 파라미터를 적절히 풀어서 오해의 소지가 없도록 한다.

  3. 스톱포인트를 최적화하고, 스톱포인을 보장하면서 스톱포인트를 최소화한다.

최적화 방향

  1. 다양한 길이의 주기에서 변수 최적화 결과를 테스트한다.

  2. MACD, 브린 띠 등과 함께 신호 품질을 향상시키려고 노력한다.

  3. 다른 전략들을 연구하여 최적의 배열을 찾아보세요.

  4. 이윤과 비용을 균형 잡기 위해 최적의 지분 기간을 결정하는 평가

요약하다

금분열은 RSI 전략과 듀얼 확인을 통해 일부 잡음 거래를 필터링 할 수 있습니다. 단일 지표를 사용하는 것과 비교하여 더 높은 품질의 거래 신호를 생성 할 수 있습니다. 매개 변수를 최적화하고 규칙을 엄격하게 준수함으로써 전략은 효과적인 인트라데이 거래 도구가 될 수 있습니다.

전략 소스 코드
/*backtest
start: 2023-12-26 00:00:00
end: 2024-01-02 00:00:00
period: 1m
basePeriod: 1m
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/
// © MohamedYAbdelaziz

// Intraday Trading
// Best used for Short Timeframes [1-30 Minutes]
// If you have any modifications please tell me to update it

//@version=4
strategy(title="Fibonacci + RSI - Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=10000, currency=currency.USD)

// Inputs
timeFilter = year >= 2000
    // Stop Loss %
loss_percent = input(title="Stop Loss (%)", minval=0.0, step=0.1, defval=2) * 0.001
    // RSI Inputs
len = input(title="[RSI] Length", minval=0, step=1, defval=14)
overSold = input(title="[RSI] Over Sold %", defval=30)
overBought = input(title="[RSI] Over Bought %", defval=70)
    // Fibonacci Levels
length = input(title="[Fibonacci] Length", defval=200, minval=1)
src = input(hlc3, title="[Fibonacci] Source")
mult = input(title="[Fibonacci] Multiplier", defval=3.0, minval=0.001, maxval=50)
level = input(title="[Fibonacci] Level", defval=764)


// Calculate Fibonacci
basis = vwma(src, length)
dev = mult * stdev(src, length)
fu764= basis + (0.001*level*dev)
fu1= basis + (1*dev)
fd764= basis - (0.001*level*dev)
fd1= basis - (1*dev)

// Calculate RSI
vrsi = rsi(close, len)

// Calculate the Targets
targetUp = fd764
targetDown = fu764
    // Actual Targets
bought = strategy.position_size[0] > strategy.position_size[1]
exit_long = valuewhen(bought, targetUp, 0)
sold = strategy.position_size[0] < strategy.position_size[1]
exit_short = valuewhen(sold, targetDown, 0)

// Calculate Stop Losses
stop_long = strategy.position_avg_price * (1 - loss_percent)
stop_short = strategy.position_avg_price * (1 + loss_percent)

// Conditions to Open Trades
openLong = low < fd1 and crossover(vrsi[1], overSold)
openShort = high > fu1 and crossunder(vrsi[1], overBought)

// Conditions to Close Trades
closeLong = high > exit_long
closeShort = low < exit_short 


// Plots
plot(basis, color=color.blue, linewidth=2, title="[Fibonacci Level] Basis")
plot(fu764, color=color.white, linewidth=1, title="[Fibonacci Level] Short Target")
plot(fu1, color=color.red, linewidth=2, title="1", title="[Fibonacci Level] Top")
plot(fd764, color=color.white, linewidth=1, title="[Fibonacci Level] Long Target")
plot(fd1, color=color.green, linewidth=2, title="1", title="[Fibonacci Level] Bottom")


// Strategy Orders
if timeFilter
    // Entry Orders
    strategy.entry(id="Long", long=true, when=openLong and high < targetUp, limit=close)
    strategy.entry(id="Short", long=false, when=openShort and low > targetDown, limit=close)

    // Exit Orders
    strategy.exit(id="Long", when=closeLong and strategy.position_size > 0, limit=exit_long, stop=stop_long)
    strategy.exit(id="Short", when=closeShort and strategy.position_size < 0, limit=exit_short, stop=stop_short)