
이 전략은 다중 시간 프레임 EMA 지표와 K선 형태 판단을 결합하여 보다 민감한 긴선 신호 캡처 및 정지 퇴출을 구현한다.
이 정책은 다음과 같은 몇 가지 지표에 기초하여 판단됩니다.
EMA 평균선: 13주기, 21주기 2군 EMA를 이용하여 가격 돌파가 거래 신호를 형성하는 것을 판단한다.
K선 형태: K선 개체 방향을 판단, EMA 지표와 함께 사용, 필터 가짜 돌파구.
지원 저항: 최근 10주기 highest 고점을 사용하여 구축하여, 이 영역을 통해 신호 신뢰성을 강화하는 돌파구를 판단한다.
상승 분 시간:120 주기close폐쇄가격이open폐쇄가격 위에 상승분으로 판단될 때, 보조 판단으로서
거래 신호 생성 규칙은 다음과 같습니다.
다단 신호: 빠른 EMA는 상향으로 느린 EMA를 뚫고, K선으로 K선으로, 빈 창을 닫습니다.
공중 신호: 빠른 EMA는 느린 EMA를 넘어 아래로 떨어지고, 음선 K선으로, 다중 포지션을 평행한다.
스톱로스 탈퇴: 반박 신호가 발산될 때 스톱로스는 현재 포지션을 탈퇴한다.
위와 같은 위험은 과도한 최적화를 피하고, 신중하게 매개 변수를 선택하고, 포지션 크기를 엄격하게 통제하는 방법으로 완화될 수 있다.
이 전략은 다중 시간 프레임 엠아 지표와 K선 엔티티 판단을 통합하여 보다 신뢰할 수 있는 추세 판단을 실현한다. 동시에 지원 저항과 분기 상황을 결합하여 보조하여 신호 품질을 보장한다. 반손 신호 메커니즘을 통해 중지 손실을 효과적으로 제어 할 수 있다. 머신 러닝 모델을 도입하여 자동으로 중지 손실, 감정 면 분석 및 위치 관리 모듈 등을 최적화하여 전략을 더 안정화 할 수 있다.
/*backtest
start: 2023-02-14 00:00:00
end: 2024-02-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy(title='ck - CryptoSniper Longs Only (Strategy)', shorttitle='ck - CryptoSniper Longs (S) v1', overlay=true, precision=2, commission_value=0.25, default_qty_type=strategy.percent_of_equity, pyramiding=0, default_qty_value=100, initial_capital=100)
open_long = 0
close_position = 0
last_long=close
last_short=close
//Candle body resistance Channel-----------------------------//
len = 34
src = input(close, title="Candle body resistance Channel")
out = sma(src, len)
last8h = highest(close, 13)
lastl8 = lowest(close, 13)
bearish = cross(close,out) == 1 and falling(close, 1)
bullish = cross(close,out) == 1 and rising(close, 1)
channel2=false
//-----------------Support and Resistance
RST = input(title='Support / Resistance length:', defval=10)
RSTT = valuewhen(high >= highest(high, RST), high, 0)
RSTB = valuewhen(low <= lowest(low, RST), low, 0)
//--------------------Trend colour ema------------------------------------------------//
src0 = close, len0 = input(13, minval=1, title="EMA 1")
ema0 = ema(src0, len0)
direction = rising(ema0, 2) ? +1 : falling(ema0, 2) ? -1 : 0
//-------------------- ema 2------------------------------------------------//
src02 = close, len02 = input(21, minval=1, title="EMA 2")
ema02 = ema(src02, len02)
direction2 = rising(ema02, 2) ? +1 : falling(ema02, 2) ? -1 : 0
//=============Hull MA//
show_hma = false
hma_src = input(close, title="HullMA Source:")
hma_base_length = input(8, minval=1, title="HullMA Base Length:")
hma_length_scalar = input(5, minval=0, title="HullMA Length Scalar:")
hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length)))
//============ signal Generator ==================================//
Period=input(title='Period', defval='120')
ch1 = request.security(syminfo.tickerid, Period, open)
ch2 = request.security(syminfo.tickerid, Period, close)
// Signals//
long = crossover(request.security(syminfo.tickerid, Period, close),request.security(syminfo.tickerid, Period, open))
short = crossunder(request.security(syminfo.tickerid, Period, close),request.security(syminfo.tickerid, Period, open))
last_long := long ? time : nz(last_long[1])
last_short := short ? time : nz(last_short[1])
long_signal = crossover(last_long, last_short) ? 1 : -1
short_signal = crossover(last_short, last_long) ? -1 : 1
if (long_signal == 1)
strategy.entry("Long Open", strategy.long)
if (short_signal == -1)
strategy.close("Long Open")
if (long_signal[1] == 1 and short_signal[1] == 1)
open_long := 1
close_position := 0
if (short_signal[1] == -1 and long_signal[1] == -1)
open_long := 0
close_position := 1
plotshape(open_long == 1, title="Open Long", location=location.belowbar, style=shape.triangleup, size=size.small, color=green, transp=10)
plotshape(close_position == 1, title="Close Long", location=location.abovebar, style=shape.triangledown, size=size.small, color=red, transp=10)
//plot(0, title="Trigger", color=white)
///////////////////////////////////////////////////////////////////////////////////////////