
단기한계空頭策略 (영어: Short-term limit airhead strategy) 은 가격이 지지선에 접근하거나 돌파할 때空頭ポジション을 구축하여, 극소한의 손실 및 중지 수준을 설정하는 고주파 거래 전략이다. 이 전략은 가격의 단기 돌파구를 이용하여 시장의 변동을 포착하여 수익을 창출한다.
이 전략은 우선 가격의 선형 회귀선을 계산한다. 실제 종료 가격이 예측된 종료 가격보다 낮으면 다단위 포지션을 설정한다. 실제 종료 가격이 예측된 종료 가격보다 높으면 공백 포지션을 설정한다.
주요 파라미터는 다음과 같습니다:
이 전략의 주요 아이디어는 가격의 평균에 대한 단기간의 돌파구를 포착하는 것입니다. 가격이 지원 또는 저항 라인을 접근하거나 돌파 할 때 적시에 입장을 설정하고 극소량의 스톱 및 스톱을 설정하여 수익을 얻으면 즉시 평정하고 프로세스를 반복합니다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이에 대응하는 위험 대응은 다음과 같습니다.
이 전략은 다음과 같은 방향으로 더 개선될 수 있습니다.
단기 제한 공허 전략은 전형적인 고 주파수 거래 전략이다. 단기 가격 변동을 포착하기 위해 중요한 가격 지점 근처에 적시에 입장을 세우고 극소량의 스톱 스톱을 설정한다. 높은 수익을 얻을 수 있지만, 특정 위험에 직면합니다. 지속적인 테스트와 최적화를 통해 이 전략은 안정성과 수익성을 더욱 향상시킬 수 있습니다.
/*backtest
start: 2024-01-09 00:00:00
end: 2024-01-16 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Extreme Scalping", overlay=true )
src = input(close,title="Source")
len = input(defval=14, minval=1, title="Length")
offset = input(1)
out = linreg(src, len, offset)
plot(out)
gap_tick=input(100)
fixedTP=input(300)
fixedSL=input(100)
useFixedSLTP=input(true)
direction=input(defval="ALL",title="Direction of order",options=["ALL","BUY ONLY","SELL ONLY"])
gap=gap_tick*syminfo.mintick
plot(out+gap,color=color.red)
plot(out-gap,color=color.green)
tp=useFixedSLTP?fixedTP:gap_tick
sl=useFixedSLTP?fixedSL:gap_tick
longCondition = close<(out-gap) and (direction=="ALL" or direction=="BUY ONLY")
shortCondition = close>(out+gap) and (direction=="ALL" or direction=="SELL ONLY")
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("exit long","Long",profit = tp,loss = sl)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("exit short","Short",profit =tp,loss=sl)
// === Backtesting Dates === thanks to Trost
// testPeriodSwitch = input(true, "Custom Backtesting Dates")
// testStartYear = input(2019, "Backtest Start Year")
// testStartMonth = input(10, "Backtest Start Month")
// testStartDay = input(3, "Backtest Start Day")
// testStartHour = input(0, "Backtest Start Hour")
// testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,testStartHour,0)
// testStopYear = input(2019, "Backtest Stop Year")
// testStopMonth = input(12, "Backtest Stop Month")
// testStopDay = input(31, "Backtest Stop Day")
// testStopHour = input(23, "Backtest Stop Hour")
// testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,testStopHour,0)
// testPeriod() =>
// time >= testPeriodStart and time <= testPeriodStop ? true : false
// isPeriod = testPeriodSwitch == true ? testPeriod() : true
// // === /END
// if not isPeriod
// strategy.cancel_all()
// strategy.close_all()