Saeu v5 SMC+ Fixed — Strategy by klz840307

By version

Performance Metrics

Description

//version=6strategy( "Saeu v5 SMC+ Fixed", overlay=true, initial_capital=1000, commission_value=0.04)// =====================================================// 입력// =====================================================risk_pct = input.float(1.0, "Risk %") * 0.01atr_sl = input.float(1.5, "Stop ATR")atr_tp1 = input.float(2.5, "TP1 ATR")atr_tp2 = input.float(4.0, "TP2 ATR")use_fvg = input.bool(true, "Use FVG")use_mtf = input.bool(true, "Use MTF")use_vol = input.bool(true, "Use Volume")start_h = input.int(0, "Start Hour")end_h = input.int(0, "End Hour")// =====================================================// 지표// =====================================================ema50 = ta.ema(close, 50)ema200 = ta.ema(close, 200)atr14 = ta.atr(14)rsi14 = ta.rsi(close, 14)[diplus, diminus, adx] = ta.dmi(14, 14)sma20 = ta.sma(close, 20)volMa = ta.sma(volume, 20)// =====================================================// FVG// =====================================================fvg_bull = low > high[2]fvg_bear = high mtf_ema50// =====================================================// 조건// =====================================================long_cond = close > ema50 and close > ema200 and rsi14 > 50 and adx >= 20short_cond = close = 20// =====================================================// FVG 필터// =====================================================if use_fvg long_cond := long_cond and fvg_bull short_cond := short_cond and fvg_bear// =====================================================// MTF 필터// =====================================================if use_mtf long_cond := long_cond and mtf_bull short_cond := short_cond and not mtf_bull// =====================================================// 거래량 필터// =====================================================if use_vol long_cond := long_cond and volume > volMa short_cond := short_cond and volume > volMa// =====================================================// 시간 필터// =====================================================time_ok = (start_h == end_h) or (hour >= start_h and hour <= end_h)long_cond := long_cond and time_okshort_cond := short_cond and time_ok// =====================================================// 수량 계산// =====================================================risk_cap = strategy.initial_capital * risk_pctqty = risk_cap / (atr14 * atr_sl * syminfo.pointvalue)qty := math.max(math.floor(qty), 1)// =====================================================// 롱// =====================================================if long_cond and strategy.position_size == 0 strategy.entry( "L", strategy.long, qty=qty) sl = close - atr14 * atr_sl tp1 = close + atr14 * atr_tp1 tp2 = close + atr14 * atr_tp2 strategy.exit( "L TP1", "L", limit=tp1, stop=sl, qty_percent=50) strategy.exit( "L TP2", "L", limit=tp2, stop=sl, qty_percent=100)// =====================================================// 숏// =====================================================if short_cond and strategy.position_size == 0 strategy.entry( "S", strategy.short, qty=qty) sl = close + atr14 * atr_sl tp1 = close - atr14 * atr_tp1 tp2 = close - atr14 * atr_tp2 strategy.exit( "S TP1", "S", limit=tp1, stop=sl, qty_percent=50) strategy.exit( "S TP2", "S", limit=tp2, stop=sl, qty_percent=100)// =====================================================// 시각화// =====================================================plot(ema50, color=color.orange)plot(ema200, color=color.blue)plotshape( long_cond, title="LONG", style=shape.labelup, location=location.belowbar, color=color.green)plotshape( short_cond, title="SHORT", style=shape.labeldown, location=location.abovebar, color=color.red)

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView