
Chiến lược này được gọi là chiến lược giao dịch quyền chọn định kỳ dựa trên chỉ số Stochastic, sử dụng chỉ số Stochastic Shock để xác định điểm vào và thoát tiềm năng của giao dịch quyền chọn. Chiến lược này được sử dụng đặc biệt cho giao dịch quyền chọn, có thể xác định cơ hội giao dịch ở hai đầu của đa không gian.
Chiến lược này sử dụng đường Stochastic %K 14 chu kỳ và đường trung bình di chuyển đơn giản 3 chu kỳ để vẽ đường Stochastic %D. Khi đường%K vượt qua đường%D từ mức thấp, nó được coi là tín hiệu lạc quan; Khi đường%K vượt qua đường%D từ mức cao, nó được coi là tín hiệu giảm. Các điều kiện nhập cảnh và thoát ra cụ thể như sau:
Tham gia nhiều đầu: làm nhiều khi đường %K vượt qua đường %D từ mức dưới 20 Multihead exit: Hạ lỗ khi %K line phá vỡ %D line từ mức 80 trở lên Bước vào không đầu: Khi % K line phá vỡ % D line từ mức 80 trở lên Bỏ đầu trống: Khi đường% K vượt qua đường% D từ mức dưới 20
Chiến lược này sử dụng nguyên tắc mua quá mức của chỉ số Stochastic để xác định thời điểm đầu vào tiềm năng. So với chiến lược theo dõi xu hướng truyền thống, nó có thể nắm bắt được các giao dịch lớn hơn tại các điểm biến động của thị trường.
/*backtest
start: 2024-01-04 00:00:00
end: 2024-02-03 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stochastic Weekly Options Strategy", overlay=true, shorttitle="WOS")
// Stochastic settings
K = ta.stoch(close, high, low, 14)
D = ta.sma(K, 3)
// Entry and exit conditions
longEntry = ta.crossover(K, 20)
longExit = ta.crossunder(K, 80)
shortEntry = ta.crossunder(K, 80)
shortExit = ta.crossover(K, 20)
// Strategy execution
strategy.entry("Long", strategy.long, when=longEntry)
strategy.close("Long", when=longExit)
strategy.entry("Short", strategy.short, when=shortEntry)
strategy.close("Short", when=shortExit)
// Alert conditions
alertcondition(longEntry, title="Long Entry Alert", message="Stochastic bullish crossover! Consider buying a call option.")
alertcondition(longExit, title="Long Exit Alert", message="Stochastic bearish crossover! Consider selling the call option.")
alertcondition(shortEntry, title="Short Entry Alert", message="Stochastic bearish crossover! Consider buying a put option.")
alertcondition(shortExit, title="Short Exit Alert", message="Stochastic bullish crossover! Consider selling the put option.")
// Plotting shapes for buy and sell signals
plotshape(longEntry, title="Calls Entry Label", color=color.new(color.green, 25),
textcolor=color.white, style=shape.triangleup, text="Calls", location=location.belowbar, size=size.small)
plotshape(longExit, title="Calls Exit Label", color=color.new(color.green, 25),
textcolor=color.white, style=shape.circle, text="Exit", location=location.belowbar, size=size.small)
plotshape(shortEntry, title="Puts Entry Label", color=color.new(color.red, 25),
textcolor=color.white, style=shape.triangledown, text="Puts", location=location.abovebar, size=size.small)
plotshape(shortExit, title="Puts Exit Label", color=color.new(color.red, 25),
textcolor=color.white, style=shape.circle, text="Exit", location=location.abovebar, size=size.small)
// Plotting
plot(K, color=color.blue, title="Stochastic %K")
plot(D, color=color.red, title="Stochastic %D")
hline(80, "Overbought", color=color.red)
hline(20, "Oversold", color=color.green)