強気相場修正の短期戦略


作成日: 2024-01-30 16:33:54 最終変更日: 2024-01-30 16:33:54
コピー: 0 クリック数: 607
1
フォロー
1617
フォロワー

強気相場修正の短期戦略

概要

牛市回調ショートライン戦略は,トレンドを追跡する戦略である.牛市で回調を購入し,大きなストップを設定して,利益を得るために出場する.この戦略は,牛市に主に適用され,余剰利益を得ることができる.

戦略原則

この戦略は,まず,最近の一定の周期における閉盘価格の変化幅を計算し,株価が設定された逆戻り幅を上回ったときに買入シグナルを発信する.同時に,閉盘価格よりも高い移動平均を要求し,これは上昇傾向を確認する条件である.

入場後,ストップとストップの価格を設定する.ストップ幅が大きい場合,十分な資金の要求を満たす.ストップ幅が小さい場合,迅速に利益を得て出場する.ストップまたはストップが触発されたときに,平仓で出場する.

優位分析

この戦略の利点は以下の通りです.

  1. トレンド操作の考え方は,余分な利益をもたらす
  2. 調整幅とトレンド判断条件の合理的な設定,操作の正確性を確保する
  3. 金融安全を考慮したストップダメージ幅の設計
  4. ストップセットは迅速に利益を得,撤退は適切に制御される

リスク分析

この戦略にはいくつかのリスクがあります.

  1. 低迷やトレンドの逆転により損失を招く可能性
  2. 大幅な停滞による撤回リスク
  3. 状況が平穏で,止損条件が満たされない場合

対策: ポジションの規模を厳密に管理し,ストップの幅を調整し,ストップの退出率を適切に縮小し,リスクを低減する.

最適化の方向

この戦略は以下の点で最適化できます.

  1. ダイナミックな調整により,入場機会を最適化
  2. 意思決定の正確さを高めるための判断指標を追加する
  3. 変動性,動的に調整されたストップ・ストップ比率
  4. ポジション管理の最適化とリスク管理

要約する

牛市回調ショートライン戦略は,高いストップ損失と引き換えに余剰利益を得る.それは,トレンド判断と回調買いの配合を利用して,牛市情勢がもたらす機会を効果的に得ることができる.パラメータ調整とリスク管理により,より良い安定した利益を得ることができる.

ストラテジーソースコード
/*backtest
start: 2023-12-30 00:00:00
end: 2024-01-29 00:00:00
period: 1h
basePeriod: 15m
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/
// © Coinrule

//@version=3
strategy(shorttitle='Scalping Dips On Trend',title='Scalping Dips On Trend (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)

//Backtest dates
fromMonth = input(defval = 1,  title = "From Month")     
fromDay   = input(defval = 10,    title = "From Day")       
fromYear  = input(defval = 2020, title = "From Year")       
thruMonth = input(defval = 1,    title = "Thru Month")     
thruDay   = input(defval = 1,    title = "Thru Day")     
thruYear  = input(defval = 2112, title = "Thru Year")       

showDate  = input(defval = true, title = "Show Date Range")

start     = timestamp(fromYear, fromMonth, fromDay, 00, 00)        // backtest start window
finish    = timestamp(thruYear, thruMonth, thruDay, 23, 59)        // backtest finish window
window()  => true

inp_lkb = input(1, title='Lookback Period')
 
perc_change(lkb) =>
    overall_change = ((close[0] - close[lkb]) / close[lkb]) * 100

// Call the function    
overall = perc_change(inp_lkb)

//MA inputs and calculations
MA=input(50, title='Moving Average')

MAsignal = sma(close, MA)

//Entry

dip= -(input(2))

strategy.entry(id="long", long = true, when = overall< dip and MAsignal > close and window()) 

//Exit
Stop_loss= ((input (10))/100)
Take_profit= ((input (3))/100)

longStopPrice  = strategy.position_avg_price * (1 - Stop_loss)
longTakeProfit = strategy.position_avg_price * (1 + Take_profit)

strategy.close("long", when = close < longStopPrice or close > longTakeProfit and window())