
この戦略は,価格の動的変化に応じて入札と止損点を決定するダイナミックな振動通路の突破方法を採用しています.戦略は,単純で分かりやすいので,トレンド株の操作に適しています.
この戦略は,まず20日間の最高値と最低値を計算し,動的揺動の通路を得ます。それから,8日目指数移動平均と32日目指数移動平均を計算し,価格の閉盘価格が通路上線を突破し,8日目平均線が32日目平均線より高いとき,多めにします;価格が通路下線を突破したときに,または8日目平均線の下線で32日目平均線を突破したときに,平仓します。ストップダストは,価格が通路中線より低いときのストップダストです。
この戦略の入場条件は以下の通りです.
閉店価格が20日ぶりの最高値から上昇
8日間の平均線は32日間の平均線より高い
退出条件は以下の通りです.
経路の中央線より低い価格で止まる
8日平均線の下から32日平均線を通過すると平仓
この戦略は,動的チャネルを活用してトレンドの方向を判断し,平均線を活用して現在上昇傾向にあると判断し,リスクを効果的に制御します.
経路周期パラメータ,平均線周期パラメータ,合理的な止損設定によって戦略を最適化し,リスクを制御することができる.
動的震動突破策の全体的な構想は明快で分かりやすく,動的チャネルでトレンドの方向性を判断し,その後均線フィルタリング効果を利用して上場する.停止損失を設定すると,リスクを効果的に制御できる.パラメータを最適化することで,戦略のProfit Factorを向上させることができる.この戦略は,突破継続効果を持つ株式に適用され,特に,イノベーションが高向上突破するシナリオに適している.
/*backtest
start: 2022-11-09 00:00:00
end: 2023-11-15 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Robrecht99
//@version=5
strategy("My Strategy", overlay=true, margin_long=100, margin_short=100)
fast = ta.sma(close, 8)
slow = ta.sma(close, 32)
plot(fast, color=color.red)
plot(slow, color=color.navy)
entrycondition1 = ta.crossover(fast, slow)
entrycondition2 = fast > slow
sellcondition1 = ta.crossunder(fast, slow)
sellcondition2 = slow > fast
atr = ta.atr(14)
//Donchian Channels
days = 20
h1 = ta.highest(high[1], days)
l1 = ta.lowest(low[1], days)
mid = math.avg(h1, l1)
plot(mid, "channel", color=#FF6D00)
u = plot(h1, "Upper", color=#2962FF)
l = plot(l1, "Lower", color=#2962FF)
fill(u, l, color.new(color.blue, 90))
if (close > h1 and entrycondition2)
strategy.entry("long", strategy.long)
stoploss = close - atr * 3
trail = close - atr * 3
strategy.exit("exit", "long", stop=stoploss, trail_offset=trail)
if (sellcondition1 and sellcondition2)
strategy.close(id="long")