
이 전략은 헐 이동 평균, 어부 전환 지표 및 상품 통로 지수를 결합한 자율적 다중 요소 전략이다. 그것은 트렌드를 지능적으로 인식하고, 다양한 품종과 주기에 적합한 매개 변수를 자동으로 조정할 수 있다.
이 전략의 핵심 논리는 낚시꾼이 지표로 전환한 금색 포크 사다리를 기반으로 입지와 출전을 판단한다. 낚시꾼이 지표로 전환한 지표는 이동 평균과 흔들림 지표의 장점을 결합하여 트렌드 전환점을 더 정확하게 판단할 수 있다.
전략은 먼저 헐 이동 평균과 낚시꾼의 전환 지표를 계산한다. 그리고 상품 통로 지수 보조 판단과 결합하여 진입 조건을 형성한다. 낚시꾼의 전환 지표가 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축 위쪽에서 0축으로 0축 위쪽에서 0축으로 0축 위쪽에서 0
출구 조건은 반대로, 금포가 더 많은 거래를 할 때 사포 평지; 사포가 빈 거래를 할 때 금포 평지. 따라서 지표 사이의 교차점을 사용하여 트렌드 전환점을 잡습니다.
이 전략의 가장 큰 장점은 다인자 자율성이다. 그것은 동시에 이동 평균, 진동 지표 및 경향 지표의 장점을 활용하여 하락 시장에서 좋은 성적을 얻을 수 있다. 그리고 파라미터 설정은 품종 및 주기에 따라 조정할 수 있으며, 자율성을 실현한다.
또한, 전략에는 자동으로 손실을 중지하는 장치가 포함되어 있습니다. 가격이 헐 이동 평균을 다시 깨면 자동으로 손실이 중단됩니다. 이것은 전략의 손실 위험을 크게 줄입니다.
이 전략의 가장 큰 위험은 지표들 사이에 오차 신호를 생성하는 것이다. 가격의 간격적인 변동이 있을 때, 지표들은 불필요한 교차를 일으킬 수 있다. 이것은 불필요한 진입과 정지 손실을 초래한다.
해결 방법은 지표 파라미터를 적절히 조정하여 작은 신호를 필터링하는 것이다. 또는 더 많은 보조 지표를 결합하여 확인하는 것이다. 예를 들어, 거래량 지표를 추가하여 진정한 신호를 판단하는 것이다.
이 전략은 다음과 같은 방향으로 최적화될 수 있습니다.
기계 학습 알고리즘을 추가하여 매개 변수의 자동 최적화를 구현한다. 역사적 데이터 훈련에 따라 지표 매개 변수를 실시간으로 조정할 수 있다.
더 많은 지표 포지션을 추가하고, 더 많은 의사결정 전략을 취하고, 의사결정의 정확성을 향상시킵니다.
가격의 중요한 수준과 통로를 이용한 재확인 메커니즘을 추가하여 잘못된 조작을 방지하십시오.
위험 평가 모듈을 추가하여 시장 환경에 따라 자동으로 포지션 규모와 중지 손실을 조정할 수 있습니다.
이 전략은 전체적으로 매우 좋은 다중 요소 적응 프레임 워크입니다. 그것은 이동 평균의 추세 판단, 충격 지표의 과매매 판단 및 추세 지표의 교차 응용과 결합하여 전체적인 입시 출구 메커니즘을 형성합니다. 추가 적응 및 지능화 구성 요소를 추가하여 추가적으로 최적화 할 수 있다면 매우 상업적으로 가치가있는 전략 제품입니다.
/*backtest
start: 2023-01-09 00:00:00
end: 2024-01-15 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is free to copy/paste/use. no permission required. just do it!
// © @SeaSide420
//@version=4
strategy(title="Hull Fisher",currency="USD",default_qty_type=strategy.percent_of_equity,default_qty_value=100,commission_type=strategy.commission.percent,commission_value=0.25)
//=================================== Inputs =========================================================
period =input(title="HullMA Length", type=input.integer, defval=14, minval=2)
length =input(9, minval=1, title="Signal Length")
line1 = input(5, minval=2, title="Top Line")
line5 = input(-5, maxval=-2, title="Bottom Line")
price = input(open, type=input.source, title="Price data")
entry1 =input(true,type=input.bool, title="Open when HullFisher crossover outside Lines")
entry2 =input(true,type=input.bool, title="Open when HullFisher past zero")
useHMA =input(true,type=input.bool, title="Include Hull_moving_average")
useCCI =input(true,type=input.bool, title="Include Commodity_channel_index")
fishclose=input(true,type=input.bool, title="Close order when Fisher crossover")
HMAclose=input(true,type=input.bool, title="Close order when Hull crossover")
//================================ Calculations ======================================================
HMA = hma(price,period)
HMA2 = HMA[1]
high_ = highest(HMA, length)
low_ = lowest(HMA, length)
round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
value = 0.0
value := round_(.66 * ((HMA - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
value1 = 0.0
value1 := .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(value1[1])
value2 = value1[1]
CCI1 = cci(price,period)
CCI2 = CCI1[1]
line2 = line1/2
line4 = line5/2
//================================ Draw Plots =======================================================
colorchange1 =CCI1>CCI2?color.lime:color.red
colorchange2 =value1>value2?color.lime:color.red
a =plot(line1,style=plot.style_line,color=color.red,transp=50,linewidth=2,title="Top Line")
b =plot(line2,style=plot.style_line,color=color.red,transp=50,linewidth=2,title="Upper Line")
c =plot(0,style=plot.style_line,color=color.black,transp=50,linewidth=2,title="Middle Line")
d =plot(line4,style=plot.style_line,color=color.lime,transp=50,linewidth=2,title="Lower Line")
e =plot(line5,style=plot.style_line,color=color.lime,transp=50,linewidth=2,title="Bottom Line")
f =plot(value1, color=color.black,transp=50,linewidth=2, title="Value 1")
g =plot(value2, color=color.black,transp=50,linewidth=2, title="Value 2")
h =plot(CCI1/50,style=plot.style_area, color=colorchange1,transp=50,linewidth=2, title="CCI")
fill(f,g,color=colorchange2,transp=20,title="Color fill")
plot(cross(value1, value2) ? value1 : na, style=plot.style_circles, color=color.black, linewidth=10)
plot(cross(value1, value2) ? value1 : na, style=plot.style_circles, color=color.white, linewidth=8)
plot(cross(value1, value2) ? value1 : na, style=plot.style_circles, color=colorchange2, linewidth=5)
//============================= Entry conditions ====================================================
// Outside Lines crossover or zero lines crossover
LongCondition1 = value1>value2 and value1<line5 and entry1 and not useCCI and not useHMA
ShortCondition1 = value1<value2 and value1>line1 and entry1 and not useCCI and not useHMA
LongCondition2 = value1>value2 and value1>0 and entry2 and not useCCI and not useHMA
ShortCondition2 = value1<value2 and value1<0 and entry2 and not useCCI and not useHMA
// Use CCI
LongCondition3 = value1>value2 and value1<line5 and CCI1>CCI2 and entry1 and useCCI and not useHMA
ShortCondition3 = value1<value2 and value1>line1 and CCI1<CCI2 and entry1 and useCCI and not useHMA
LongCondition4 = value1>value2 and value1>0 and CCI1>CCI2 and entry2 and useCCI and not useHMA
ShortCondition4 = value1<value2 and value1<0 and CCI1<CCI2 and entry2 and useCCI and not useHMA
// Use HMA
LongCondition5 = value1>value2 and value1<line5 and CCI1>CCI2 and HMA>HMA2 and entry1 and not useCCI and useHMA
ShortCondition5 = value1<value2 and value1>line1 and CCI1<CCI2 and HMA<HMA2 and entry1 and not useCCI and useHMA
LongCondition6 = value1>value2 and value1>0 and CCI1>CCI2 and HMA>HMA2 and entry2 and not useCCI and useHMA
ShortCondition6 = value1<value2 and value1<0 and CCI1<CCI2 and HMA<HMA2 and entry2 and not useCCI and useHMA
//Use CCI & HMA
LongCondition7 = value1>value2 and value1<line5 and CCI1>CCI2 and HMA>HMA2 and entry1 and useCCI and useHMA
ShortCondition7 = value1<value2 and value1>line1 and CCI1<CCI2 and HMA<HMA2 and entry1 and useCCI and useHMA
LongCondition8 = value1>value2 and value1>0 and CCI1>CCI2 and HMA>HMA2 and entry2 and useCCI and useHMA
ShortCondition8 = value1<value2 and value1<0 and CCI1<CCI2 and HMA<HMA2 and entry2 and useCCI and useHMA
//========================= Exit & Entry excecution =================================================
if HMAclose and fishclose and value1<value2 and HMA<HMA2
strategy.close("BUY")
if HMAclose and fishclose and value1>value2 and HMA>HMA2
strategy.close("SELL")
if HMAclose and HMA<HMA2
strategy.close("BUY")
if HMAclose and HMA>HMA2
strategy.close("SELL")
if fishclose and value1<value2
strategy.close("BUY")
if fishclose and value1>value2
strategy.close("SELL")
if LongCondition1 or LongCondition2 or LongCondition3 or LongCondition4 or LongCondition5 or LongCondition6 or LongCondition7 or LongCondition8
strategy.entry("BUY", strategy.long)
if ShortCondition1 or ShortCondition2 or ShortCondition3 or ShortCondition4 or ShortCondition5 or ShortCondition6 or ShortCondition7 or ShortCondition8
strategy.entry("SELL", strategy.short)