
ストキャスティック指数に基づく周期的なオプション取引戦略と呼ばれるこの戦略は,オプション取引の潜在的入場と退出点を識別するためにストキャスティック振動指数を使用します.この戦略はオプション取引に専用であり,多空の両端で取引機会を識別できます.
この戦略は,14周期のストカスティック%K線と3周期のシンプル移動平均を使用してストカスティック%D線を描きます.%K線が低位から%D線を突破すると,看板信号とみなされ,%K線が高位から%D線を突破すると,看板信号とみなされます.具体的入場および退出条件は以下のとおりです.
多頭入場:%K線が20以下のレベルから%D線を突破すると多頭入場 多頭退出:%Kラインが80以上のレベルから%Dラインを破るときに平仓 空頭入場:%K線が80以上のレベルから%D線を破るとき空頭 空頭退出:%K線が20以下から%D線を突破すると平仓
この戦略は,Stochastic指標の超買い超売り原理を使用して,潜在的な入場タイミングを識別する.従来のトレンド追跡戦略と比較して,市場転換点でより大きな市場を捕捉することができる.パラメータ最適化,シグナルフィルターなどの手段によって戦略の安定性をさらに向上させることができる.この戦略は,リスクを制御した前提で高い収益を勝ち取るために,オプション取引に使用することができる.
/*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)