
突破回調戦略は,トレンドを追跡する戦略である.その基本原理は,前K線の最高価格または最低価格を突破したときに多空をすることであり,ストップ・ストップ・損失を設定した後,利潤が継続することを許す.
この戦略は,価格が前K線の最高価格または最低価格を突破するかどうかを判断することによってEntryのタイミングを決定する.具体的論理は:
もし現在のK線の最高値が前のK線の最高値より高いなら,多信号を発する.
もし,現在のK線の最低値が,前のK線の最低値より低ければ,空き信号を発する.
多空信号を受信するとすぐに入場する.入場後にストップを50ポイント,ストップロスを100ポイントに設定する.
損失が止損ポイントに等しいものや利益が止ポイントに等しいものであれば,主動退場する.
この突破的なリコール戦略は,以下の利点があります.
この戦略にはいくつかのリスクがあります.
この戦略をさらに改善するには,以下のポイントを考慮する必要があります.
価格突破の有効性を判断し,偽突破を回避する.例えば,指標フィルタリングと取引量検証を追加することができる.
トレンド判断の仕組みを増やして,市場を整合させる所から引き出される封鎖リスクを回避する.移動平均などのトレンド指標を添加することができる.
ストップ・ストップ・ストップ・ストラトジーを最適化します. 例えば,ストップ・ストップを追跡し,ストップ・ストップを利得後に移動させ,利得を最大化します.
パラメータを最適化して,最適のストップ・ストラスト・ポイントを見つけます.
この突破的な回調戦略は,全体的に論理的にシンプルで,実行に便利で,トレンドの開始を効果的に捉えることができ,後退とリスク管理能力も強い.さらに最適化することで,非常に実用的な量化戦略になることができます.
/*backtest
start: 2023-01-25 00:00:00
end: 2024-01-31 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Breakout Strategy", shorttitle="BS", overlay=true)
// Input for take profit and stop loss in pips
tp_pips = input(50, title="Take Profit (in pips)")
sl_pips = input(100, title="Stop Loss (in pips)")
// Calculate take profit and stop loss levels in points
tp_level = tp_pips * syminfo.mintick
sl_level = sl_pips * syminfo.mintick
// Function to check if a breakout has occurred
breakout(high_or_low) =>
high_or_low > request.security(syminfo.tickerid, "D", high[1]) ? true : false
// Buy condition
buy_condition = breakout(high)
strategy.entry("Buy", strategy.long, when=buy_condition)
// Sell condition
sell_condition = breakout(low)
strategy.entry("Sell", strategy.short, when=sell_condition)
// Take profit and stop loss conditions for Buy
tp_buy_condition = strategy.position_avg_price + tp_level
sl_buy_condition = strategy.position_avg_price - sl_level
strategy.exit("Take Profit/Close Buy", from_entry="Buy", profit=tp_buy_condition, loss=sl_buy_condition)
// Take profit and stop loss conditions for Sell
tp_sell_condition = strategy.position_avg_price - tp_level
sl_sell_condition = strategy.position_avg_price + sl_level
strategy.exit("Take Profit/Close Sell", from_entry="Sell", profit=tp_sell_condition, loss=sl_sell_condition)