//@version=5 strategy("The BEST Day Trading Strategy For Beginners in 2026", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10) // --- Inputs --- htf_period = input.timeframe("240", title="HTF Period (Structure Filter)") fast_ema_len = input.int(50, title="HTF Fast EMA Length") slow_ema_len = input.int(200, title="HTF Slow EMA Length") atr_len = input.int(14, title="ATR Length for Level Identification") atr_mult = input.float(1.5, title="Displacement ATR Multiplier") stoch_k_len = input.int(14, title="Stochastic K Length") stoch_d_len = input.int(3, title="Stochastic D Length") stoch_smooth = input.int(3, title="Stochastic Smooth") stoch_ob = input.float(80.0, title="Stochastic Overbought Level") stoch_os = input.float(20.0, title="Stochastic Oversold Level") rr_ratio = input.float(2.0, title="Risk-to-Reward Ratio") // --- High Timeframe Market Structure (S) --- htf_fast = request.security(syminfo.tickerid, htf_period, ta.ema(close, fast_ema_len), barmerge.gaps_off, barmerge.lookahead_off) htf_slow = request.security(syminfo.tickerid, htf_period, ta.ema(close, slow_ema_len), barmerge.gaps_off, barmerge.lookahead_off) is_bullish_structure = htf_fast > htf_slow is_bearish_structure = htf_fast < htf_slow // --- Supply and Demand Levels Identification (L) --- atr = ta.atr(atr_len) var float demand_high = na var float demand_low = na var float supply_high = na var float supply_low = na body = close - open is_strong_up = body > atr * atr_mult is_strong_down = -body > atr * atr_mult // Update levels dynamically when displacement is identified if is_strong_up[1] demand_high := high[2] demand_low := low[2] if is_strong_down[1] supply_high := high[2] supply_low := low[2] // --- Confirmation Logic (C) --- stoch_raw = ta.stoch(close, high, low, stoch_k_len) stoch_k = ta.sma(stoch_raw, stoch_smooth) in_demand_zone = (low <= demand_high and high >= demand_low) in_supply_zone = (high >= supply_low and low <= supply_high) stoch_cross_over = ta.crossover(stoch_k, stoch_os) stoch_cross_under = ta.crossunder(stoch_k, stoch_ob) long_condition = is_bullish_structure and in_demand_zone and stoch_cross_over short_condition = is_bearish_structure and in_supply_zone and stoch_cross_under // --- Trade Execution and Management --- var float trade_sl = na var float trade_tp = na if long_condition and strategy.position_size == 0 trade_sl := demand_low - (atr * 0.5) trade_tp := close + (close - (demand_low - (atr * 0.5))) * rr_ratio strategy.entry("Long Setup", strategy.long) strategy.exit("Exit Long", "Long Setup", stop=trade_sl, limit=trade_tp) if short_condition and strategy.position_size == 0 trade_sl := supply_high + (atr * 0.5) trade_tp := close - ((supply_high + (atr * 0.5)) - close) * rr_ratio strategy.entry("Short Setup", strategy.short) strategy.exit("Exit Short", "Short Setup", stop=trade_sl, limit=trade_tp) // --- Visualizing Supply/Demand Levels --- plot(demand_high, "Demand High", color=color.new(color.green, 50), style=plot.style_line) plot(demand_low, "Demand Low", color=color.new(color.green, 70), style=plot.style_line) plot(supply_high, "Supply High", color=color.new(color.red, 50), style=plot.style_line) plot(supply_low, "Supply Low", color=color.new(color.red, 70), style=plot.style_line)