이 전략은 가격의 다양한 영역에서의 체류 시간을 계산하여 가격이 새로운 저항없는 영역에 진입했는지 판단하여 저항없는 영역에서 트렌드 추적 거래 신호를 생성합니다. 트렌드 추적 전략에 속합니다.
지난 N주기 동안, 가격의 현재 수준 근처에 머무는 비율을 계산하여 가격 마찰의 척도로 니다.
지난 한 시간 동안 가격이 낮은 마찰 영역에 들어갔는지 판단하기 위해, 신호를 생성하는 무저항 영역으로 사용한다.
빠른 가중 이동 평균을 사용하여 최근 트렌드 방향을 판단하고, 저항 없는 영역이 돌파될 때 트렌드 거래를 한다.
가격이 높은 마찰 영역으로 다시 들어갔을 때, 전조 추세는 정지와 퇴출을 반전한다.
거래 매개 변수는 friction zone 판단 주기, breakout entry zone 등으로 사용자 정의할 수 있다.
가격 마찰을 이용해서 저항이 없는 지역을 판단하고, 흔들림이 있는 지역을 피한다.
빠른 평균선은 최근 트렌드를 추적하고, 조합을 사용하여 판단 방향을 니다.
가격 마찰 영역을 보여주는 직관적인 시각 인터페이스
기본 파라미터는 암호화폐의 고주파 거래에 최적화되었다.
정책 규칙은 간단하고 명확하며, 이해하기 쉽고 수정하기 쉽습니다.
가격 마찰은 가격 움직임을 완전히 예측할 수 없습니다.
빠른 평행선 판단 시기는 정확하지 않을 수 있습니다.
시장의 진입과 퇴출을 원활하게 할 수 없습니다.
최적화 시에는 과적합의 위험이 있을 수 있습니다.
시장이 급격하게 변할 때 고정 변수 효과는 좋지 않을 수 있다.
다른 주기적 변수를 테스트하여 가격 마찰을 계산한다.
다양한 유형의 평균을 평가하여 최근 추세를 판단하십시오.
무저항 영역을 뚫는 매개 변수를 최적화하여 전략의 안정성을 높인다.
스톱로스 스 (Stop Loss Stop) 전략을 추가하고 거래 위험을 관리합니다.
동적 변수를 고려하여 시장 변화에 적응하십시오.
더 많은 품종과 주기에서 재검토 및 검증한다.
이 전략은 가격 마찰도를 통해 높은 확률의 트렌드 폭발 지역을 찾아 거래하는 데 장점이 있다. 그러나 또한 매개 변수 고정 한계가 있다. 동적 매개 변수 최적화, 위험 관리 등의 메커니즘을 강화함으로써 전략을 더욱 안정적이고 효율적으로 만들 수 있다.
/*backtest
start: 2023-08-20 00:00:00
end: 2023-09-19 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
//made for 30m chart with BTCUSD or other cryptocurrency
strategy("LUBE",overlay=false )
friction=0.0
barsback=input(500,"bars back to measure friction",step=100)
flevel=input(50,"0-100 friction level to stop trade",step=2)
tlevel=input(-10,"pic lower than 0 to number selected above to initiate trade",step=2)
fl=flevel/100
tl=tlevel/100
for i = 1 to barsback
friction := if high[i] >= close and low[i] <= close
friction+(1+barsback)/(i+barsback)
else
friction
range=input(100,"bars back to measure lowest friction",step=10)
lowf = lowest(friction,range)
highf = highest(friction,range)
midf = (lowf*(1-fl)+highf*fl)
lowf2 = (lowf*(1-tl)+highf*tl)
plot(friction)
m=plot(midf[5],color=color.red)
l=plot(lowf2[5],color=color.white)
h=plot(highf[5],color=color.white)
fill(l,h,color.white)
src = input(title="Source", type=input.source, defval=close)
//FIR Filter
_fir(src) =>
(4 * src + 3 * nz(src[1]) + 2 * nz(src[2]) + nz(src[3])) / 10
fir = _fir(src)
trend = fir > fir[1]? 1:-1
//bgcolor(trend==1?color.lime:color.red,transp=50)
long=friction<lowf2[5] and trend == 1
short=friction<lowf2[5] and trend == -1
end=friction > midf[5]
keeplong=0
keeplong:=long?1:nz(keeplong[1])
keeplong:=short or end?0:keeplong
keepshort=0
keepshort:=short?1:nz(keepshort[1])
keepshort:=long or end?0:keepshort
bgcolor(keeplong==1?color.lime:keepshort==1?color.red:na,transp=50)
leverage=input(2,"leverage",step=.5)
enableshort=input(true,"enable shorts?")
barcount=0
barcount:=nz(barcount[1])+1
contracts=min(max(.000001,(strategy.equity/close)*leverage),50000)
strategy.entry("Long",strategy.long,when=long and barcount>20, qty=contracts)
strategy.close("Long",when=short or end )
strategy.entry("Short",strategy.short,when=short and enableshort==true and barcount>20, qty=contracts)
strategy.close("Short",when=(long or end) and enableshort==true)
alertcondition(keeplong==1 and keeplong[1]==0,"LONG")
alertcondition(keepshort==1 and keepshort[1]==0,"SHORT")
alertcondition((keeplong[1]==1 or keepshort[1]==1) and (keeplong==0 and keepshort==0),"CLOSE TRADE")