이 전략은 빠른 EMA에서 평균선을 구매하고 느린 SMA에서 평균선을 판매하는 교차로 구매 신호를 생성하고 ATR의 동적 추적 스톱로스를 사용하여 위험을 제어하여 소수의 거래를 통해 구매 보유 전략을 초과하는 것을 목표로합니다.
빠른 EMA 구매 평균선과 느린 SMA 구매 평균선을 계산하여, 빠른 라인에서 느린 라인을 통과하고 특정 구매 강도를 달성하면 구매 신호가 발생한다.
빠른 EMA가 평균선을 팔고 느린 SMA가 평균선을 팔고 빠른 선이 느린 선을 통과하면 팔기 신호가 발생한다.
ATR 지표의 N 일간 평균값을 동적으로 추적하는 스톱로즈의 배수로 곱하여 위험을 제어한다.
재검토 기간 동안 전략을 실행하고 구매 및 판매를 실행하십시오.
각 주식은 다른 변수 조합을 최적화하여 최적의 변수를 찾습니다.
이 전략은 트렌드를 판단하는 이동 평균 지표와 교차 신호 및 ATR 동적 추적 스톱의 장점을 결합하여, 매개 변수를 최적화하여 각 품종의 특성에 적응하여, 소수의 정밀 거래를 통해 구매 및 보유 이상의 과잉 수익을 얻는 것을 목표로합니다.
빠른 EMA와 느린 SMA의 교차는 트렌드를 식별할 수 있는 거래 신호를 생성한다.
ATR 스톱은 시장의 변동에 따라 스톱 포지션을 조정하여 위험을 효과적으로 제어합니다.
각 주식의 변수를 최적화하면 수익률을 높일 수 있다.
간단한 거래 논리와 규칙, 실행 및 검증하기 쉽습니다.
이 전략의 효과에 대한 검증을 위한 복사 기능이 완성되었습니다.
“구성”을 추구하는 것은 구매와 소유의 초과 수익을 넘어서는 것입니다.
최적화 된 매개 변수는 반드시 미래에 적용되지 않을 수 있으며, 주기적으로 다시 최적화 될 수 있습니다.
EMA와 SMA가 교차하면 잘못된 신호 또는 신호 지연이 발생할 수 있다.
ATR 정지는 너무 급진적일 수 있으며, 정지는 적절히 느려질 수 있다.
거래 빈도가 너무 낮아서 더 좋은 거래 기회를 놓칠 수 있습니다.
거래 비용의 영향을 고려해야 합니다.
다른 변수 조합을 계속 테스트하여 최적의 변수를 찾으십시오.
신호 필터링을 위해 다른 지표를 도입하십시오.
ATR의 주기적 변수를 최적화하고, 스톱 로즈의 감수성을 균형을 잡는다.
적절한 완화한 손해배상 범위의 효과를 평가하십시오.
기계학습과 같은 방법을 고려하여 자동적으로 우수변수를 찾습니다.
포지션 개설 횟수를 늘리는 효과에 대한 연구
이 이동 평균은 손실을 추적하는 스톱 전략으로, 일률적 교차 생성 신호와 ATR 스톱 제어의 장점을 결합하여, 매개 변수를 최적화하여 각 주식의 특성에 맞게 조정하는 간단한 실용적인 초매 보유 전략 아이디어입니다. 최적화된 변수는 미래의 효과를 보장하지 않지만, 이 전략은 전체 거래 논리가 명확하고, 실제적으로 작동성이 강하며, 추가 개선 및 검증 가치가 있으며, 좋은 시발점이 있습니다.
/*backtest
start: 2023-01-01 00:00:00
end: 2023-09-18 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
//created by XPloRR 04-03-2018
strategy("XPloRR MA-Trailing-Stop Strategy",overlay=true, initial_capital=1000,default_qty_type=strategy.percent_of_equity,default_qty_value=100)
testStartYear = input(2005, "Start Year")
testStartMonth = input(1, "Start Month")
testStartDay = input(1, "Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)
testStopYear = input(2050, "Stop Year")
testStopMonth = input(12, "Stop Month")
testStopDay = input(31, "Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)
testPeriodBackground = input(title="Background", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)
ema1Period = input(12, "Fast EMA Buy")
sma1Period = input(54, "Slow SMA Buy")
strength1 = input(52, "Minimum Buy Strength")
ema2Period = input(18, "Fast EMA Sell")
sma2Period = input(55, "Slow SMA Sell")
strength2 = input(100, "Minimum Sell Strength")
delta = input(8, "Trailing Stop (#ATR)")
testPeriod() => true
ema1val=ema(close,ema1Period)
sma1val=sma(close,sma1Period)
ema1strength=10000*(ema1val-ema1val[1])/ema1val[1]
ema2val=ema(close,ema2Period)
sma2val=sma(close,sma2Period)
ema2strength=10000*(ema2val-ema2val[1])/ema2val[1]
plot(ema1val,color=blue,linewidth=1)
plot(sma1val,color=orange,linewidth=1)
plot(ema2val,color=navy,linewidth=1)
plot(sma2val,color=red,linewidth=1)
long=crossover(ema1val,sma1val) and (ema1strength > strength1)
short=crossunder(ema2val,sma2val) and (ema2strength < -strength2)
stopval=ema(close,6)
atr=sma((high-low),15)
inlong=0
buy=0
stop=0
if testPeriod()
if (inlong[1])
inlong:=inlong[1]
buy:=close
stop:=iff((stopval>(stop[1]+delta*atr)),stopval-delta*atr,stop[1])
if (long) and (not inlong[1])
strategy.entry("buy",strategy.long)
inlong:=close
buy:=close
stop:=stopval-delta*atr
plot(buy,color=iff(close<inlong,red,lime),style=columns,transp=90,linewidth=1)
plot(stop,color=iff((short or (stopval<stop)) and (close<inlong),red,lime),style=columns,transp=60,linewidth=1)
if testPeriod()
if (short or (stopval<stop)) and (inlong[1])
strategy.close("buy")
inlong:=0
stop:=0
buy:=0