
短期极限空头策略是一种试图通过在价格接近或突破支持线时建立空头头寸,并设置极小止损和止盈水平的高频交易策略。该策略利用价格的短期突破来捕捉市场波动,实现盈利。
该策略首先计算价格的线性回归线。如果实际收盘价低于预测收盘价则建立多头头寸;如果实际收盘价高于预测收盘价则建立空头头寸。 止损和止盈设置为极小的点数。该策略允许选择只做多、只做空或者全部方向的交易。
关键参数包括:
该策略的主要思路是捕捉价格对均线的短期突破。当价格接近或突破支撑或阻力线时,及时建立仓位;并设置极小的止损和止盈,实现盈利后立即平仓,重复该过程。
该策略具有以下优势:
该策略也存在一些风险:
对应风险应对措施包括:
该策略可以进一步优化的方向包括:
短期极限空头策略是一种典型的高频交易策略。其通过在关键价格点附近及时建仓,并设置极小止损止盈来捕捉短期价格波动。虽然可以获得较高收益,但也面临一定的风险。通过持续测试和优化,该策略可以进一步增强稳定性和盈利能力。
/*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()