
이 전략은 TSI와 개선된 CCI 지표의 양방향 거래 신호를 결합하여, 더 안정적인 지속적인 수익을 추구하기 위해 중매 방식을 사용하여 포지션을 빈번하게 청산합니다. 중요한 논리는 TSI 지표의 빠른 느린 평균 선 금 포크와 사다리이며, HMACCI 지표의 다공간 신호 선과 결합하여 시장의 매매 방향을 결정합니다. 포지션 개설 조건을 제한하여 위험을 제어하고, 동시에 중지 손실 및 중지 논리를 설정합니다.
이 전략은 주로 TSI와 HMACCI 두 지표의 조합에 기초한다.
TSI 지표는 빠른 평균선과 느린 평균선을 포함하고 있으며, 이는 매매 신호를 판단하기 위해 사용된다. 빠른 선이 아래에서 위로 느린 선을 뚫을 때 매매 신호가 되고, 반대로 매매 신호가 된다. 이렇게 하면 시장의 변화 경향을 더 민감하게 포착할 수 있다.
HMACCI 지표는 전통적인 CCI 지표에 기초하여 Hull 이동 평균을 사용하여 가격 자체를 대신하여 오버 바이 오버 셀 영역을 판단하는 일부 잡음을 차단할 수 있습니다. 오버 바이 오버 셀 영역은 TSI 지표의 신호 방향을 다시 확인할 수 있습니다.
전략의 핵심 논리는 이 두 지표의 판단 결과를 결합하고, 잘못된 신호를 필터링하기 위해 특정 부가 조건을 설정하는 것입니다. 예를 들어, K 선의 종결 가격과 여러 주기의 최고 가격 전 최저 가격과 같은 반전 신호의 품질을 제어합니다.
포지션 개시의 측면에서, 조건이 충족되면, 매번 K 라인 종료 시 시 시장 가격에 포지션을 개시하고, 동시에 더 많은 공백을 한다. 이렇게 하면 더 안정적인 수익을 얻을 수 있지만, 마이너스 리스크를 감수해야 한다.
스톱스톱의 경우, 부동의 스톱스톱과 이윤의 전체 평준을 설정한다. 이것은 일방적인 거래의 위험을 잘 통제할 수 있다.
이것은 비교적 안정적이고 신뢰할 수 있는 고주파수 중매 전략이다. 주요 장점은 다음과 같다:
주의해야 할 주요 위험은 다음과 같습니다.
위험은 다음과 같은 방법으로 줄일 수 있습니다.
이 전략은 여전히 개선할 수 있는 여지가 있습니다.
이 전략은 전반적으로 안정적이고, 신뢰할 수 있으며, 오류율이 높은 쌍방위 거래 전략이다. 그것은 추세 판단과 반전 지표를 결합하여 빈번한 쌍방위 입장을 통해 안정적인 수익을 얻는다. 또한, 전략 자체는 강력한 최적화 공간과 잠재력을 가지고 있으며, 깊이 연구할 가치가 있는 고주파 거래 사상이다.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the suns bipolarity
//©SeaSide420
//@version=4
strategy(title="TSI HMA CCI", default_qty_type=strategy.cash,default_qty_value=1000,commission_type=strategy.commission.percent,commission_value=0.001)
long = input(title="TSI Long Length", type=input.integer, defval=25)
short = input(title="TSI Short Length", type=input.integer, defval=25)
signal = input(title="TSI Signal Length", type=input.integer, defval=13)
length = input(33, minval=1, title="HMACCI Length")
src = input(open, title="Price Source")
ld = input(50, minval=1, title="Line Distance")
CandlesBack = input(8,minval=1,title="Candles Look Back")
StopLoss= input(3000,minval=1, title="Stop Loss")
TargetProfitAll= input(3000,minval=1, title="Target Profit Close All")
FromMonth=input(defval=1,title="FromMonth",minval=1,maxval=12)
FromDay=input(defval=1,title="FromDay",minval=1,maxval=31)
FromYear=input(defval=2020,title="FromYear",minval=2020)
ToMonth=input(defval=1,title="ToMonth",minval=1,maxval=12)
ToDay=input(defval=1,title="ToDay",minval=1,maxval=31)
ToYear=input(defval=9999,title="ToYear",minval=2017)
start=timestamp(FromYear,FromMonth,FromDay,00,00)
finish=timestamp(ToYear,ToMonth,ToDay,23,59)
window()=>true
ul = (ld)
ll = (ld-ld*2)
ma = hma(src, length)
cci = (src - ma) / (0.015 * dev(src, length))
price = close
double_smooth(src, long, short) =>
fist_smooth = ema(src, long)
ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)*10
tsi_value2=ema(tsi_value/10, signal)*10
cc = color.white
ct = color.new(color.gray, 90)
if cci<ll or cci[1]<ll
cc:=color.red
if cci>ul or cci[1]>ul
cc:=color.green
if cci<ul and cci>ll
cc:=color.new(color.yellow, 90)
ccc = color.white
if cci>ul
ccc:=color.green
if cci<cci[1] and cci<ul and cci>ll
ccc:=color.red
if cci<ll
ccc:=color.red
if cci>cci[1] and cci>ll and cci<ul
ccc:=color.green
tsiplot= plot(tsi_value, color=color.lime)
tsiplot2=plot(tsi_value2, color=color.red)
colorchange2 =tsi_value>tsi_value2?color.lime:color.orange
fill(tsiplot, tsiplot2, color=colorchange2, title="TSIBackground", transp=50)
band1 = hline(ul, "Upper Band 1", color=ct, linestyle=hline.style_dashed)
band0 = hline(ll, "Lower Band 1", color=ct, linestyle=hline.style_dashed)
fill(band1, band0, color=cc, title="MidBandBackground", transp=0)
band2 = hline(ul, "Upper Band 2", color=ct, linestyle=hline.style_dashed)
band3 = hline(ll, "Lower Band 2", color=ct, linestyle=hline.style_dashed)
cciplot2 = plot(cci, "CCIvHMA 2", color=color.black, transp=0, linewidth=5)
cciplot = plot(cci, "CCIvHMA", color=ccc, transp=0, linewidth=3)
hline(0, title="Zero")
hline(420, title="420")
hline(-420, title="-420")
fill(cciplot, cciplot2, color=ccc, title="CCIBackground", transp=0)
LongCondition=cci>cci[1] and cci>ll and src>src[CandlesBack] and tsi_value>tsi_value2
ShortCondition=cci<cci[1] and cci<ul and src<src[CandlesBack] and tsi_value<tsi_value2
plotshape(LongCondition, title="BUY", style=shape.circle, location=location.top, color=color.green)
plotshape(ShortCondition, title="SELL", style=shape.circle, location=location.top, color=color.red)
if strategy.openprofit>TargetProfitAll
strategy.close_all(when=window(),comment="close all profit target")
if LongCondition and strategy.openprofit>-1
strategy.order("BUY", strategy.long,when=window())
if ShortCondition and strategy.openprofit>-1
strategy.order("SELL", strategy.short,when=window())
strategy.exit("SL exit a sell", "SELL", loss = StopLoss,when=window())
strategy.exit("SL exit a buy", "BUY", loss = StopLoss,when=window())