이 전략은 “목요일 반전 전략 ((주말 필터링)) “이라고 불리며, 주요 아이디어는 평균선 및 기타 필터링 조건을 기반으로, 조건을 충족하는 월요일 상장 구매, 수요일 상장 판매를 통해 화요일 반전 상황을 포착한다. 이 전략은 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)