牛市回调短线策略是一种趋势跟踪策略。它在牛市中买入回调,设置较大止损,以获利出场。该策略主要适用于牛市,可以获取超额收益。
该策略首先计算最近一定周期内的收盘价变化幅度,当股价下跌超过设置的回调幅度时,即发出买入信号。同时,要求移动平均线高于收盘价,这是一个确认上升趋势的条件。
入场后,设置止损和止盈价格。止损幅度较大,达到资金充足的要求;止盈幅度较小,快速获利出场。在止损或止盈触发时,平仓离场。
该策略具有以下优势:
该策略也存在一定的风险:
对策:严格把控仓位规模,调整止损幅度,适当缩小止盈退出比例,降低风险。
该策略可以从以下几个方面进行优化:
牛市回调短线策略,以较高的止损换取超额收益。它利用趋势判断和回调买入的配合,可以有效获取牛市行情带来的机会。通过参数调整和风险控制,可以获得较好的稳定收益。
/*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())