이 전략은 아론 지표의 양방향 트렌드 식별 및 추적에 기반한다. 아론 지표는 시장 트렌드의 방향을 효과적으로 판단할 수 있으며, RSI 지표와 결합하여 과매도 과매도 영역에 대한 판단을 수행하여 비교적 완전한 추적 전략을 형성한다.
Aroon 지표는 가격 트렌드 방향을 판단하기 위해 사용한다. 지표는 0선을 초과하면 상승 트렌드이며, 0선을 초과하면 하락 트렌드이다.
아론 지표가 아래에서 0선을 돌파할 때, 구매 동작을 한다.
만약 상장이 세워져 있고, 매입 가격보다 상장 가격이 낮고, RSI가 30보다 낮다면, 과매매로 간주하고, 상장한다.
아론 지표가 0선 아래로 떨어질 때, 전체 판매를 진행한다.
5%의 스톱로스 포인트를 설정하고, 손실이 그 포인트를 초과하면 스톱로스 판매한다.
아론 지표는 트렌드 방향을 판단하는 데에 사용되며, 시장의 회전 지점을 효과적으로 포착할 수 있다.
RSI 지표는 시장의 전환점에서 오버 바이 또는 오버 셀 영역을 판단하는 데 도움이 됩니다.
양방향 거래는 상승과 하락의 두 가지 시장 환경에서 이익을 얻을 수 있습니다.
스톱포인트를 설정하면 위험을 조절할 수 있습니다.
Aroon 지표는 지연되어 있으며, 단기적이고 급격한 반전을 놓칠 수 있습니다.
시장의 정리를 효율적으로 처리하지 못하면 불필요한 거래가 더 많이 발생한다.
양방향 거래는 거래 빈도와 수수료 비용을 증가시킵니다.
다른 주기 및 품종에 적응하기 위해 적절한 조정이 필요합니다.
다른 지표의 필터링 신호와 결합하여 지연으로 인해 잘못된 거래가 발생할 확률을 줄입니다.
양적 연구를 늘리고, 다양한 품종을 맞추기 위해 변수 조합을 최적화한다.
이 프로젝트의 핵심은,
트렌드가 명확할 때만 거래하는 것을 고려하고, 유효하지 않은 거래를 줄여라.
이 전략은 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