该策略名为”周二反转策略(周末过滤)“,主要思路是基于均线和其他过滤条件,在满足条件的周一开盘买入,周三开盘卖出,以捕捉周二的反转行情。该策略通过对RSI、ATR等指标的过滤,排除5月份等特定时间,以提高策略胜率和收益风险比。
周二反转策略(周末过滤)通过均线、RSI和ATR等指标的组合判断,在特定时间买卖标的,以捕捉周二的反转行情。策略交易频率低,手续费成本小,并通过时间段过滤和指标过滤,提高了策略的胜率和风险收益比。但是,策略也存在一定的局限性和风险,如趋势行情下表现不佳,以及买卖时机和持仓周期固定等。未来可以通过引入更多过滤条件,优化出场时机,动态调整参数,仓位管理和风控等方面进行优化和改进,使策略能够更好地适应多变的市场状态。
/*backtest start: 2024-03-01 00:00:00 end: 2024-03-31 23:59:59 period: 2h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © muikol //@version=5 strategy("Turnaround Tuesday", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.035) // Inputs for MA period, filter_1, filter_2, month filter, and testing period ma_period = input(30, title="Moving Average Period") use_filter_1 = input(true, title="Use RSI Filter") use_filter_2 = input(true, title="Use ATR Filter") use_month_filter = input(true, title="Exclude May") start_date = input(defval=timestamp("2009-01-01 00:00:00"), title="Start Backtest") end_date = input(defval=timestamp("2025-01-01 00:00:00"), title="End Backtest") // Data calculations MA_tt = ta.sma(close, ma_period) atr10 = ta.atr(10) rsi3 = ta.rsi(close, 3) c_1 = close[1] // Entry conditions isMonday = dayofweek == dayofweek.monday bear = close[1] < MA_tt[1] filter_1 = use_filter_1 ? rsi3[1] < 51 : true filter_2 = use_filter_2 ? c_1/atr10[1] < 95 : true notMay = use_month_filter ? month != 5 : true entryCondition = isMonday and bear and notMay and filter_1 and filter_2 // Date check inTestPeriod = true // Exit conditions isWednesdayOpen = dayofweek == dayofweek.wednesday // Entry and exit triggers if entryCondition and inTestPeriod strategy.entry("Buy", strategy.long) if isWednesdayOpen and strategy.position_size > 0 and inTestPeriod strategy.close("Buy") // Plot the moving average plot(MA_tt, title="Moving Average", color=color.blue)