//@version=5 strategy("TJR $100 Prop Firm Strategy", overlay=true, initial_capital=100, default_qty_type=strategy.percent_of_equity, default_qty_value=10) // Inputs htf_res = input.timeframe("60", title="Higher Timeframe Trend") ema_length = input.int(50, title="HTF EMA Filter Length") atr_length = input.int(14, title="ATR Length") atr_multiplier = input.float(1.5, title="ATR Momentum Multiplier") rr_ratio = input.float(2.0, title="Risk-to-Reward Ratio") // Get HTF values (safely shifted to avoid repainting) htf_ema = request.security(syminfo.tickerid, htf_res, ta.ema(close, ema_length)[1], barmerge.gaps_off, barmerge.lookahead_off) htf_close = request.security(syminfo.tickerid, htf_res, close[1], barmerge.gaps_off, barmerge.lookahead_off) // LTF indicators atr = ta.atr(atr_length) // Conditions candle_body = math.abs(close - open) is_momentum_candle = candle_body > (atr * atr_multiplier) is_bullish = (close > open) and is_momentum_candle is_bearish = (close < open) and is_momentum_candle trend_up = htf_close > htf_ema trend_down = htf_close < htf_ema long_condition = trend_up and is_bullish short_condition = trend_down and is_bearish // Manage trades var float sl = na var float tp = na if (long_condition and strategy.position_size == 0) sl := low - atr tp := close + (close - sl) * rr_ratio strategy.entry("Long", strategy.long) strategy.exit("Exit Long", "Long", stop=sl, limit=tp) if (short_condition and strategy.position_size == 0) sl := high + atr tp := close - (sl - close) * rr_ratio strategy.entry("Short", strategy.short) strategy.exit("Exit Short", "Short", stop=sl, limit=tp) plot(htf_ema, color=color.blue, title="HTF EMA Filter")