이중 트렌드 추적 전략

저자:차오장, 날짜: 2023-09-17 18:20:27
태그:

전반적인 설명

이 전략은 두 방향의 트렌드를 식별하고 추적하기 위해 아론 지표에 기반합니다. 아론 지표는 시장 트렌드의 방향을 효과적으로 결정할 수 있습니다. RSI 지표와 결합하면 비교적 완전한 추적 전략을 형성합니다.

전략 원칙

  1. Aroon 지표를 사용하여 가격 트렌드의 방향을 결정합니다. 0 라인 위의 것은 상승 추세를 나타냅니다. 0 라인 아래는 하락 추세를 나타냅니다.

  2. 아론 지표가 아래에서 0선을 넘으면 구매 신호가 발사됩니다.

  3. 이미 포지션이 있고, 클로즈가 구매 가격보다 낮고, RSI가 30 이하인 경우, 과판된 것으로 간주되며, 추가 구매 오더가 배치됩니다.

  4. 아론 지표가 위에서 0선을 넘으면 완전한 출구 신호가 발사됩니다.

  5. 5%의 스톱 로스가 설정되어 있습니다. 만약 손실이 이 지점을 초과한다면, 스톱 로스 출구는 트리거됩니다.

이점 분석

  1. 트렌드 방향을 결정하기 위해 아론 지표를 사용하면 시장 회전 지점을 효과적으로 파악 할 수 있습니다.

  2. RSI 지표는 시장 전환시 새로운 최고치를 추구하고 판매 하락을 피하는 과도한 구매 및 과도한 판매 영역을 식별하는 데 도움이됩니다.

  3. 양방향 거래는 상승과 하락 시장에서 이익을 얻을 수 있습니다.

  4. 스톱 로스를 설정하면 위험을 조절할 수 있습니다.

위험 분석

  1. 아룬 지표는 단기적이고 갑작스러운 반전을 놓칠 수 있는 지연 효과를 가지고 있습니다.

  2. 그것은 범위에 묶인 시장을 효과적으로 처리 할 수 없으며 불필요한 거래로 이어집니다.

  3. 양방향 거래는 거래 빈도와 수수료 비용을 증가시킵니다.

  4. 매개 변수들은 서로 다른 시간 프레임과 제품에 적응하기 위해 적절한 조정이 필요합니다.

최적화 방향

  1. 다른 표시기와 결합하여 신호를 필터화하고 지연으로 인한 오류를 줄이십시오.

  2. 다양한 제품에 대한 매개 변수를 최적화하기 위해 정량적 연구를 증가시킵니다.

  3. 이윤 인수를 높이기 위해 이윤을 취하는 전략을 추가하십시오.

  4. 비효율적인 거래를 줄이기 위한 트렌드가 분명할 때만 거래를 고려하세요.

요약

이 전략은 Aroon 및 RSI 지표를 통합하여 비교적 완전한 이중 방향 트렌드 거래 시스템을 형성합니다. 그러나 오류를 줄이기 위해 매개 변수의 추가 최적화 및 다른 필터링 지표와 결합이 여전히 필요합니다. 적절한 매개 변수 조정 및 위험 통제로,이 전략은 비교적 안정적인 초과 수익을 얻을 수 있습니다.


/*backtest
start: 2023-09-09 00:00:00
end: 2023-09-12 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/
// © mohanee

//@version=4
// strategy(title="Aroon Oscillator Strategy", overlay=false, pyramiding=2,    initial_capital=10000, currency=currency.USD)  //default_qty_value=10, default_qty_type=strategy.fixed, 

//variables BEGIN
aroonLength=input(169,title="Aroon Length")   //square root of 13
rsiLength=input(13, title="RSI Length")
stopLoss = input(title="Stop Loss%", defval=5, minval=1)
//variables  END

//RSI 
rsi13=rsi(close,rsiLength)




// Drawings

//Aroon oscillator

arronUpper = 100 * (highestbars(high, aroonLength+1) + aroonLength)/aroonLength
aroonLower = 100 * (lowestbars(low, aroonLength+1) + aroonLength)/aroonLength

aroonOsc  = arronUpper - aroonLower

aroonMidpoint = 0
oscPlot = plot(aroonOsc, color=color.green)
midLine= plot(aroonMidpoint, color=color.green)
topLine = plot(90,style=plot.style_circles, color=color.green)
bottomLine = plot(-90,style=plot.style_circles, color=color.red)

fill(oscPlot, midLine, color=aroonOsc>0?color.green:color.red, transp=50)
fill(topLine,bottomLine, color=color.blue)


// RSI 
//plot(rsi13, title="RSI", linewidth=2, color=color.purple)
//hline(50, title="Middle Line", linestyle=hline.style_dotted)
//obLevel = hline(80, title="Overbought", linestyle=hline.style_dotted)
//osLevel = hline(30, title="Oversold", linestyle=hline.style_dotted)
//fill(obLevel, osLevel, title="Background", color=rsi13 >=30 ? color.green:color.purple, transp=65)  // longTermRSI >=50


//Entry--

strategy.entry(id="Long Entry", comment="LE",  long=true,  when= crossover(aroonOsc,0)   )     //crossover(close,ema34)  //and close>ema34  //crossover(rsi5Val,rsiBuyLine)

//Add
if(strategy.position_size>=1 and close < strategy.position_avg_price and crossover(rsi13,30))
    strategy.order(id="Long Entry", comment="Add", long=true )     //crossover(close,ema34)  //and close>ema34  //crossover(rsi5Val,rsiBuyLine)  --


stopLossVal= abs(strategy.position_size)>1 ? strategy.position_avg_price*(1-0.5) : 0.00 


//close partial
strategy.close(id="Long Entry", comment="Partial X",  qty=strategy.position_size/3, when=abs(strategy.position_size)>=1 and crossunder(aroonOsc, 90) )   //close<ema55 and rsi5Val<20 //ema34<ema55 


//close All
strategy.close(id="Long Entry", comment="Exit All",  when=abs(strategy.position_size)>=1 and crossunder(aroonOsc, 0) )   //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89

//close All on stop loss
strategy.close(id="Long Entry", comment="Stoploss X",  when=abs(strategy.position_size)>=1 and close < stopLossVal )   //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89


더 많은