
이 전략은 매우 간단한 단선 거래 전략으로, 주식 지수의 일일 거래에 주로 적용된다. 이 전략은 다단계 거래만을 하며, 주식 지수가 장기간 상향 경로에 있을 때, 단기간에 반전 신호가 있을 때 더 많은 포지션을 만든다.
이 전략은 주로 평균선과 RSI 지표 판단 트렌드 및 오버 바이 오버 판매 현상을 기반으로 한다. 구체적인 거래 신호는: 주식 지수 종결 가격에 장기 200 일 평균선에 도달하고 그 이상의 장기 트렌드 판단으로; 종결 가격 10 일 평균선 아래로 떨어지는 단기 조정 신호를 구성한다. RSI 3 단기 지표는 30 미만의 오버 판매 신호로. 위의 세 가지 조건을 충족하면 단기 조정 반전의 가능성이 높다고 생각하여 더 많은 포지션을 만든다.
포지션을 세운 후, 손실, 중단 및 단기 동향 판단에 따라 포지션을 평정한다. 종결 가격이 10 일 평균선에 다시 서면, 단기 조정이 끝났다고 판단하면, 이 때 적극적으로 중지한다. 종결 가격이 새로운 낮은 지점을 나타낸다면, 손실을 중단하고 퇴출한다. 종결 가격이 10% 상승했을 때 중지한다.
이 전략에는 다음과 같은 장점이 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
위와 같은 위험에 대해, 주기 변수를 최적화, 스톱 스톱 비율을 조정, 다른 지표 판단을 추가하는 등의 방법으로 개선할 수 있다.
이 전략은 다음의 몇 가지 측면에서 최적화될 수 있습니다.
이 전략은 전체적으로 매우 간단하고 실용적인 단선 거래 전략이다. 이 전략은 주식 지수가 장기간에 상승 통로와 단기간에 조정 역전하는 조합 전략을 활용하여 위험을 통제하는 전제 조건에서 여분의 수익을 얻는다. 지속적으로 최적화하고 매개 변수를 제어함으로써 더 나은 효과를 얻을 수 있다.
/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
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/
// © tsujimoto0403
//@version=5
strategy("simple pull back", overlay=true,default_qty_type=strategy.percent_of_equity,
default_qty_value=100)
//input value
malongperiod=input.int(200,"長期移動平均BASE200/period of long term sma",group = "パラメータ")
mashortperiod=input.int(10,"長期移動平均BASE10/period of short term sma",group = "パラメータ")
stoprate=input.int(5,title = "損切の割合%/stoploss percentages",group = "パラメータ")
profit=input.int(20,title = "利食いの割合%/take profit percentages",group = "パラメータ")
startday=input(title="バックテストを始める日/start trade day", defval=timestamp("01 Jan 2000 13:30 +0000"), group="期間")
endday=input(title="バックテスを終わる日/finish date day", defval=timestamp("1 Jan 2099 19:30 +0000"), group="期間")
//polt indicators that we use
malong=ta.sma(close,malongperiod)
mashort=ta.sma(close,mashortperiod)
plot(malong,color=color.aqua,linewidth = 2)
plot(mashort,color=color.yellow,linewidth = 2)
//date range
datefilter = true
//open conditions
if close>malong and close<mashort and strategy.position_size == 0 and datefilter and ta.rsi(close,3)<30
strategy.entry(id="long", direction=strategy.long)
//sell conditions
strategy.exit(id="cut",from_entry="long",stop=(1-0.01*stoprate)*strategy.position_avg_price,limit=(1+0.01*profit)*strategy.position_avg_price)
if close>mashort and close<low[1] and strategy.position_size>0
strategy.close(id ="long")