
短期極限空頭戦略は,価格がサポートラインに近づいたり突破したときに空頭ポジションを確立し,最小限のストップとストップのレベルを設定した高頻度取引戦略を試みる.この戦略は,価格の短期突破を利用して市場の波動を捕捉し,利益を上げる.
この戦略は,まず価格の線形回帰線を計算する.実際の閉店価格が予測閉店価格より低ければ,多頭ポジションを確立する.実際の閉店価格が予測閉店価格より高ければ,空頭ポジションを確立する.ストップ・ロズとストップ・ストップは,非常に小さなポイント数に設定する.この戦略は,多頭,空頭,または全方向の取引を選択する.
重要なパラメータは以下の通りです.
この戦略の主な構想は,価格が平均線に対する短期的な突破を捕捉することである.価格がサポート線またはレジスタンス線に近づいたり突破したときに,適切なタイミングでポジションを確立すること;そして,最小限のストップとストップを設定し,利益が実現した直後に平仓を立て,このプロセスを繰り返すことである.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
リスク対応には以下が含まれます.
この戦略をさらに最適化できる方向は以下の通りです.
短期極限空頭戦略は,典型的な高頻度取引戦略である.それは,重要な価格点の近くでタイムリーにポジションを建設し,極小のストップ・ストップを設定して,短期的な価格変動を捕捉する.高い利益を得ることができるが,一定のリスクも伴う.継続的なテストと最適化により,この戦略は,安定性と収益性をさらに高めることができる.
/*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()