jaems_Double BB[Alert]/W-Bottom/Dashboard// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Kingjmaes
//@version=6
strategy("jaems_Double BB /W-Bottom/Dashboard", shorttitle="jaems_Double BB /W-Bottom/Dashboard", overlay=true, commission_type=strategy.commission.percent, commission_value=0.05, slippage=1, process_orders_on_close=true)
// ==========================================
// 1. 사용자 입력 (Inputs)
// ==========================================
group_date = "📅 백테스트 기간 설정"
startTime = input.time(timestamp("2024-01-01 00:00"), "시작일", group=group_date)
endTime = input.time(timestamp("2099-12-31 23:59"), "종료일", group=group_date)
group_bb = "📊 더블 볼린저 밴드 설정"
bb_len = input.int(20, "길이 (Length)", minval=5, group=group_bb)
bb_mult_inner = input.float(1.0, "내부 밴드 승수 (Inner A)", step=0.1, group=group_bb)
bb_mult_outer = input.float(2.0, "외부 밴드 승수 (Outer B)", step=0.1, group=group_bb)
group_w = "📉 W 바닥 패턴 설정"
pivot_left = input.int(3, "피벗 좌측 봉 수", minval=1, group=group_w)
pivot_right = input.int(1, "피벗 우측 봉 수", minval=1, group=group_w)
group_dash = "🖥️ 대시보드 설정"
show_dash = input.bool(true, "대시보드 표시", group=group_dash)
comp_sym = input.symbol("NASDAQ:NDX", "비교 지수 (GS Trend)", group=group_dash, tooltip="S&P500은 'SP:SPX', 비트코인은 'BINANCE:BTCUSDT' 등을 입력하세요.")
rsi_len = input.int(14, "RSI 길이", group=group_dash)
group_risk = "🛡 리스크 관리"
use_sl_tp = input.bool(true, "손절/익절 사용", group=group_risk)
sl_pct = input.float(2.0, "손절매 (%)", step=0.1, group=group_risk) / 100
tp_pct = input.float(4.0, "익절매 (%)", step=0.1, group=group_risk) / 100
// ==========================================
// 2. 데이터 처리 및 계산 (Calculations)
// ==========================================
// 기간 필터
inDateRange = time >= startTime and time <= endTime
// 더블 볼린저 밴드
basis = ta.sma(close, bb_len)
dev_inner = ta.stdev(close, bb_len) * bb_mult_inner
dev_outer = ta.stdev(close, bb_len) * bb_mult_outer
upper_A = basis + dev_inner
lower_A = basis - dev_inner
upper_B = basis + dev_outer
lower_B = basis - dev_outer
percent_b = (close - lower_B) / (upper_B - lower_B)
// W 바닥형 (W-Bottom) - 리페인팅 방지
pl = ta.pivotlow(low, pivot_left, pivot_right)
var float p1_price = na
var float p1_pb = na
var float p2_price = na
var float p2_pb = na
var bool is_w_setup = false
if not na(pl)
p1_price := p2_price
p1_pb := p2_pb
p2_price := low
p2_pb := percent_b
// 패턴 감지
bool cond_w = (p1_price < lower_B ) and (p2_price > p1_price) and (p2_pb > p1_pb)
is_w_setup := cond_w ? true : false
w_bottom_signal = is_w_setup and close > open and close > lower_A
if w_bottom_signal
is_w_setup := false
// GS 트렌드 (나스닥 상대 강도)
ndx_close = request.security(comp_sym, timeframe.period, close)
rs_ratio = close / ndx_close
rs_sma = ta.sma(rs_ratio, 20)
gs_trend_bull = rs_ratio > rs_sma
// RSI & MACD
rsi_val = ta.rsi(close, rsi_len)
= ta.macd(close, 12, 26, 9)
macd_bull = macd_line > signal_line
// ==========================================
// 3. 전략 로직 (Strategy Logic)
// ==========================================
long_cond = (ta.crossover(close, lower_A) or ta.crossover(close, basis) or w_bottom_signal) and inDateRange and barstate.isconfirmed
short_cond = (ta.crossunder(close, upper_B) or ta.crossunder(close, upper_A) or ta.crossunder(close, basis)) and inDateRange and barstate.isconfirmed
// 진입 실행 및 알람 발송
if long_cond
strategy.entry("Long", strategy.long, comment="Entry Long")
alert("Long Entry Triggered | Price: " + str.tostring(close), alert.freq_once_per_bar_close)
if short_cond
strategy.entry("Short", strategy.short, comment="Entry Short")
alert("Short Entry Triggered | Price: " + str.tostring(close), alert.freq_once_per_bar_close)
// 청산 실행
if use_sl_tp
if strategy.position_size > 0
strategy.exit("Exit Long", "Long", stop=strategy.position_avg_price * (1 - sl_pct), limit=strategy.position_avg_price * (1 + tp_pct), comment_loss="L-SL", comment_profit="L-TP")
if strategy.position_size < 0
strategy.exit("Exit Short", "Short", stop=strategy.position_avg_price * (1 + sl_pct), limit=strategy.position_avg_price * (1 - tp_pct), comment_loss="S-SL", comment_profit="S-TP")
// 별도 알람: W 패턴 감지 시
if w_bottom_signal
alert("W-Bottom Pattern Detected!", alert.freq_once_per_bar_close)
// ==========================================
// 4. 대시보드 시각화 (Dashboard Visualization)
// ==========================================
c_bg_head = color.new(color.black, 20)
c_bg_cell = color.new(color.black, 40)
c_text = color.white
c_bull = color.new(#00E676, 0)
c_bear = color.new(#FF5252, 0)
c_neu = color.new(color.gray, 30)
get_trend_color(is_bull) => is_bull ? c_bull : c_bear
get_pos_text() => strategy.position_size > 0 ? "LONG 🟢" : strategy.position_size < 0 ? "SHORT 🔴" : "FLAT ⚪"
get_pos_color() => strategy.position_size > 0 ? c_bull : strategy.position_size < 0 ? c_bear : c_neu
var table dash = table.new(position.top_right, 2, 7, border_width=1, border_color=color.gray, frame_color=color.gray, frame_width=1)
if show_dash and (barstate.islast or barstate.islastconfirmedhistory)
table.cell(dash, 0, 0, "METRIC", bgcolor=c_bg_head, text_color=c_text, text_size=size.small)
table.cell(dash, 1, 0, "STATUS", bgcolor=c_bg_head, text_color=c_text, text_size=size.small)
table.cell(dash, 0, 1, "GS Trend", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 1, gs_trend_bull ? "Bullish" : "Bearish", bgcolor=c_bg_cell, text_color=get_trend_color(gs_trend_bull), text_size=size.small)
rsi_col = rsi_val > 70 ? c_bear : rsi_val < 30 ? c_bull : c_neu
table.cell(dash, 0, 2, "RSI (14)", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 2, str.tostring(rsi_val, "#.##"), bgcolor=c_bg_cell, text_color=rsi_col, text_size=size.small)
table.cell(dash, 0, 3, "MACD", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 3, macd_bull ? "Bullish" : "Bearish", bgcolor=c_bg_cell, text_color=get_trend_color(macd_bull), text_size=size.small)
w_status = w_bottom_signal ? "DETECTED!" : is_w_setup ? "Setup Ready" : "Waiting"
w_col = w_bottom_signal ? c_bull : is_w_setup ? color.yellow : c_neu
table.cell(dash, 0, 4, "W-Bottoms", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 4, w_status, bgcolor=c_bg_cell, text_color=w_col, text_size=size.small)
table.cell(dash, 0, 5, "Position", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 5, get_pos_text(), bgcolor=c_bg_cell, text_color=get_pos_color(), text_size=size.small)
last_sig = long_cond ? "BUY SIGNAL" : short_cond ? "SELL SIGNAL" : "HOLD"
last_col = long_cond ? c_bull : short_cond ? c_bear : c_neu
table.cell(dash, 0, 6, "Signal", bgcolor=c_bg_cell, text_color=c_text, text_halign=text.align_left, text_size=size.small)
table.cell(dash, 1, 6, last_sig, bgcolor=c_bg_cell, text_color=last_col, text_size=size.small)
// ==========================================
// 5. 시각화 (Visualization)
// ==========================================
p_upper_B = plot(upper_B, "Upper B", color=color.new(color.red, 50))
p_upper_A = plot(upper_A, "Upper A", color=color.new(color.red, 0))
p_basis = plot(basis, "Basis", color=color.gray)
p_lower_A = plot(lower_A, "Lower A", color=color.new(color.green, 0))
p_lower_B = plot(lower_B, "Lower B", color=color.new(color.green, 50))
fill(p_upper_B, p_upper_A, color=color.new(color.red, 90))
fill(p_lower_A, p_lower_B, color=color.new(color.green, 90))
plotshape(long_cond, title="Long", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(short_cond, title="Short", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
Candlestick analysis
Bull-Bear Strategy10-level EMA cross-period resonance, accurately capturing trend ignition points and outperforming single-period strategies by far. K-line bull-bear power weighting filters out 90% of oscillating noise, leading to a sharp surge in signal win rate. Historical backtesting yields an outstanding win rate. Strict position control is required for live trading. This does not constitute investment advice.
Auto Selling Zone V71.1 - Full Struct ExitIn the strategy setting, you have to select the opposite side ticket, i.e. if you are on the CE Chart then select the PE strike in the opposite side ticker.
Breakout Opening Range MNQThis is another look at the ORB strategy
Added a couple of tricks to increase performance
Please, use it for NQ/MNQ on the 1min chart
Suddenly, it works the best for the 20-minute Opening Range Period.
TJR asia session sweep//@version=5
strategy("TJR asia session sweep", "TJR Asia Sweep", overlay=true, max_lines_count=500, max_labels_count=500)
// Input settings
show_asian = input.bool(true, "Show Asian Session", group="Visual Settings")
show_london = input.bool(true, "Show London Session", group="Visual Settings")
show_swing_points = input.bool(true, "Show Asian Swing Points", group="Visual Settings")
show_market_structure = input.bool(true, "Show Market Structure", group="Visual Settings")
show_bos = input.bool(true, "Show Break of Structure", group="Visual Settings")
// Session Time Settings
asian_start_hour_input = input.int(22, "Asian Session Start Hour", minval=0, maxval=23, group="Session Times")
asian_end_hour_input = input.int(3, "Asian Session End Hour", minval=0, maxval=23, group="Session Times")
london_start_hour_input = input.int(3, "London Session Start Hour", minval=0, maxval=23, group="Session Times")
london_end_hour_input = input.int(8, "London Session End Hour", minval=0, maxval=23, group="Session Times")
session_timezone = input.string("America/New_York", "Session Timezone", options= , group="Session Times")
// Risk Management Settings
use_atr_sl = input.bool(false, "Use ATR Multiplier for Stop Loss", group="Risk Management")
atr_length = input.int(14, "ATR Length", minval=1, maxval=50, group="Risk Management")
atr_multiplier = input.float(2.0, "ATR Multiplier for Stop Loss", minval=0.5, maxval=10.0, group="Risk Management")
force_london_close = input.bool(true, "Force Close at London Session End", group="Risk Management")
cutoff_minutes = input.int(60, "Minutes Before Session End to Stop New Trades", minval=0, maxval=300, group="Risk Management")
// Position Sizing Settings
position_sizing_method = input.string("USD Risk", "Position Sizing Method", options= , group="Position Sizing")
usd_risk_per_trade = input.float(100.0, "USD Risk Per Trade", minval=1.0, maxval=10000.0, group="Position Sizing")
fixed_contracts = input.float(1.0, "Fixed Number of Contracts", minval=0.01, maxval=1000.0, step=0.01, group="Position Sizing")
// Color settings
asian_color = input.color(color.red, "Asian Session Color")
london_color = input.color(color.blue, "London Session Color")
swing_high_color = input.color(color.orange, "Swing High Color")
swing_low_color = input.color(color.lime, "Swing Low Color")
bullish_structure_color = input.color(color.green, "Bullish Structure Color")
bearish_structure_color = input.color(color.red, "Bearish Structure Color")
bos_color = input.color(color.orange, "Break of Structure Color")
// Line settings
line_width = input.int(2, "Line Width", minval=1, maxval=5)
// ATR calculation for stop loss
atr = ta.atr(atr_length)
// Position size calculation function
calculate_position_size(entry_price, stop_loss_price) =>
var float position_size = na
if position_sizing_method == "Fixed Contracts"
position_size := fixed_contracts
else // USD Risk method
stop_distance = math.abs(entry_price - stop_loss_price)
if stop_distance > 0
// Calculate position size based on USD risk per trade
// For forex: position_size = risk_amount / (stop_distance * point_value)
// For most forex pairs, point value = 1 (since we're dealing with price differences directly)
position_size := usd_risk_per_trade / stop_distance
else
position_size := fixed_contracts // Fallback to fixed contracts if stop distance is 0
position_size
// Session time definitions (using input variables)
asian_start_hour = asian_start_hour_input
asian_end_hour = asian_end_hour_input
london_start_hour = london_start_hour_input
london_end_hour = london_end_hour_input
// Get current hour using selected timezone
current_hour = hour(time, session_timezone)
// Previous hour for transition detection
prev_hour = hour(time , session_timezone)
// Session transition detection
asian_start = current_hour == asian_start_hour and prev_hour != asian_start_hour
asian_end = current_hour == asian_end_hour and prev_hour != asian_end_hour
london_start = current_hour == london_start_hour and prev_hour != london_start_hour
london_end = current_hour == london_end_hour and prev_hour != london_end_hour
// Session activity detection
asian_active = (current_hour >= asian_start_hour) or (current_hour < asian_end_hour)
london_active = (current_hour >= london_start_hour) and (current_hour < london_end_hour)
// Session boxes - keep previous sessions visible
var box asian_session_box = na
var box london_session_box = na
// Create Asian session box
if show_asian and asian_start
// Create new box at session start (previous box remains visible)
asian_session_box := box.new(bar_index, high, bar_index + 1, low,
border_color=asian_color, bgcolor=color.new(asian_color, 90),
border_width=2, border_style=line.style_solid)
// Pre-calculate session highs and lows for consistency
asian_session_length = asian_active and not na(asian_session_box) ? bar_index - box.get_left(asian_session_box) + 1 : 1
current_asian_high = ta.highest(high, asian_session_length)
current_asian_low = ta.lowest(low, asian_session_length)
// Update Asian session box continuously during session
if show_asian and asian_active and not na(asian_session_box)
box.set_right(asian_session_box, bar_index)
// Update box to contain session highs and lows
box.set_top(asian_session_box, current_asian_high)
box.set_bottom(asian_session_box, current_asian_low)
// Create London session box
if show_london and london_start
// Create new box at session start (previous box remains visible)
london_session_box := box.new(bar_index, high, bar_index + 1, low,
border_color=london_color, bgcolor=color.new(london_color, 90),
border_width=2, border_style=line.style_solid)
// Pre-calculate London session highs and lows for consistency
london_session_length = london_active and not na(london_session_box) ? bar_index - box.get_left(london_session_box) + 1 : 1
current_london_high = ta.highest(high, london_session_length)
current_london_low = ta.lowest(low, london_session_length)
// Update London session box continuously during session
if show_london and london_active and not na(london_session_box)
box.set_right(london_session_box, bar_index)
// Update box to contain session highs and lows
box.set_top(london_session_box, current_london_high)
box.set_bottom(london_session_box, current_london_low)
// Asian Session Swing Points Detection
var float asian_session_high = na
var float asian_session_low = na
var int asian_high_bar = na
var int asian_low_bar = na
// Asian Session Absolute High/Low for TP levels
var float asian_absolute_high = na
var float asian_absolute_low = na
var line asian_high_line = na
var line asian_low_line = na
var label asian_high_label = na
var label asian_low_label = na
var bool high_broken = false
var bool low_broken = false
// London Session High/Low tracking for stop loss
var float london_session_high = na
var float london_session_low = na
// Market structure tracking variables
var string breakout_direction = na // "bullish" or "bearish"
var float last_hh_level = na // Last Higher High level
var float last_hl_level = na // Last Higher Low level
var float last_ll_level = na // Last Lower Low level
var float last_lh_level = na // Last Lower High level
var int structure_count = 0
var string last_structure_type = na // "HH", "HL", "LL", "LH"
// Legacy variables for compatibility
var float last_swing_high = na
var float last_swing_low = na
var int last_high_bar = na
var int last_low_bar = na
// Market structure state tracking
var float pending_high = na
var float pending_low = na
var int pending_high_bar = na
var int pending_low_bar = na
var bool waiting_for_confirmation = false
// Break of Structure tracking variables
var float most_recent_hl = na
var float most_recent_lh = na
var int most_recent_hl_bar = na
var int most_recent_lh_bar = na
var bool bos_detected = false
// Trading variables
var bool trade_taken = false
// Trade visualization boxes (based on Casper strategy approach)
var box current_profit_box = na
var box current_sl_box = na
// Update swing points during Asian session
if asian_active and show_swing_points
// Always track absolute high/low for both TP levels and breakout detection
if na(asian_absolute_high) or high > asian_absolute_high
asian_absolute_high := high
if na(asian_absolute_low) or low < asian_absolute_low
asian_absolute_low := low
// Use absolute high/low for breakout levels (simplified logic)
if na(asian_session_high) or high > asian_session_high
asian_session_high := high
asian_high_bar := bar_index
if na(asian_session_low) or low < asian_session_low
asian_session_low := low
asian_low_bar := bar_index
// Track London session high/low for stop loss levels
if london_active
if na(london_session_high) or high > london_session_high
london_session_high := high
if na(london_session_low) or low < london_session_low
london_session_low := low
// Draw initial lines when Asian session ends
if asian_end and show_swing_points
if not na(asian_session_high) and not na(asian_high_bar)
// Draw extending line for high
asian_high_line := line.new(asian_high_bar, asian_session_high, bar_index + 200, asian_session_high,
color=swing_high_color, width=2, style=line.style_dashed, extend=extend.right)
asian_high_label := label.new(bar_index + 5, asian_session_high, "Asian High: " + str.tostring(asian_session_high, "#.####"), style=label.style_label_left, color=swing_high_color, textcolor=color.white, size=size.small)
if not na(asian_session_low) and not na(asian_low_bar)
// Draw extending line for low
asian_low_line := line.new(asian_low_bar, asian_session_low, bar_index + 200, asian_session_low,
color=swing_low_color, width=2, style=line.style_dashed, extend=extend.right)
asian_low_label := label.new(bar_index + 5, asian_session_low, "Asian Low: " + str.tostring(asian_session_low, "#.####"), style=label.style_label_left, color=swing_low_color, textcolor=color.white, size=size.small)
// Reset break flags for new session
high_broken := false
low_broken := false
// Check for breakouts during London session
if london_active and show_swing_points and not na(asian_session_high) and not na(asian_session_low)
// Check if Asian high is broken
if not high_broken and not low_broken and high > asian_session_high
high_broken := true
// Update high line to end at break point
if not na(asian_high_line)
line.set_x2(asian_high_line, bar_index)
line.set_extend(asian_high_line, extend.none)
// Remove the low line (first break wins)
if not na(asian_low_line)
line.delete(asian_low_line)
if not na(asian_low_label)
label.delete(asian_low_label)
// Add break marker
label.new(bar_index, asian_session_high * 1.001, "HIGH BREAK!",
style=label.style_label_down, color=color.red, textcolor=color.white, size=size.normal)
// Set breakout direction and initialize structure tracking
breakout_direction := "bullish"
last_swing_high := asian_session_high
last_swing_low := asian_session_low
last_high_bar := bar_index
structure_count := 0
// Check if Asian low is broken
if not low_broken and not high_broken and low < asian_session_low
low_broken := true
// Update low line to end at break point
if not na(asian_low_line)
line.set_x2(asian_low_line, bar_index)
line.set_extend(asian_low_line, extend.none)
// Remove the high line (first break wins)
if not na(asian_high_line)
line.delete(asian_high_line)
if not na(asian_high_label)
label.delete(asian_high_label)
// Add break marker
label.new(bar_index, asian_session_low * 0.999, "LOW BREAK!",
style=label.style_label_up, color=color.red, textcolor=color.white, size=size.normal)
// Set breakout direction and initialize structure tracking
breakout_direction := "bearish"
last_swing_high := asian_session_high
last_swing_low := asian_session_low
last_low_bar := bar_index
structure_count := 0
// Stop extending lines when London session ends (if not already broken)
if london_end and show_swing_points
if not high_broken and not na(asian_high_line)
line.set_x2(asian_high_line, bar_index)
line.set_extend(asian_high_line, extend.none)
if not low_broken and not na(asian_low_line)
line.set_x2(asian_low_line, bar_index)
line.set_extend(asian_low_line, extend.none)
// Force close all trades at London session end (if enabled)
if london_end and force_london_close
if strategy.position_size != 0
// Extend boxes immediately before session close to prevent timing issues
if not na(current_profit_box)
// Ensure minimum 8 bars width or extend to current bar, whichever is longer
box_left = box.get_left(current_profit_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_profit_box, final_right)
current_profit_box := na // Clear reference after extending
if not na(current_sl_box)
// Ensure minimum 8 bars width or extend to current bar, whichever is longer
box_left = box.get_left(current_sl_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_sl_box, final_right)
current_sl_box := na // Clear reference after extending
strategy.close_all(comment="London Close")
trade_taken := false // Reset trade flag for next session
// Market structure detection after breakout (only during London session and before first BoS)
if show_market_structure and not na(breakout_direction) and london_active and not bos_detected
// Bullish structure tracking (HH, HL alternating)
if breakout_direction == "bullish"
// Check for Higher High pattern: Bullish candle followed by bearish candle
pattern_high = math.max(high , high)
prev_hh = na(last_hh_level) ? last_swing_high : last_hh_level
// HH Detection: Only if we expect HH next (no last structure or last was HL)
if (na(last_structure_type) or last_structure_type == "HL") and close > open and close < open and pattern_high > prev_hh and close > prev_hh
// Check consolidation
is_too_close = not na(last_high_bar) and (bar_index - last_high_bar) <= 4
should_create_hh = true
if is_too_close and structure_count > 0 and pattern_high <= last_hh_level
should_create_hh := false
if should_create_hh
structure_count := structure_count + 1
label.new(bar_index - 1, high + (high * 0.0003), "HH" + str.tostring(structure_count),
style=label.style_none, color=color.new(color.white, 100),
textcolor=color.white, size=size.small)
last_hh_level := pattern_high
last_swing_high := pattern_high
last_high_bar := bar_index
last_structure_type := "HH"
// HL Detection: Only if we expect HL next (last was HH)
pattern_low = math.min(low , low)
prev_hl = na(last_hl_level) ? last_swing_low : last_hl_level
if last_structure_type == "HH" and close < open and close > open and pattern_low > prev_hl and close > prev_hl
// Check consolidation
is_too_close = not na(last_low_bar) and (bar_index - last_low_bar) <= 4
should_create_hl = true
if is_too_close and pattern_low <= last_hl_level
should_create_hl := false
if should_create_hl
structure_count := structure_count + 1
label.new(bar_index - 1, low - (low * 0.0003), "HL" + str.tostring(structure_count),
style=label.style_none, color=color.new(color.white, 100),
textcolor=color.white, size=size.small)
last_hl_level := pattern_low
most_recent_hl := pattern_low // Update most recent HL for BoS detection
most_recent_hl_bar := bar_index - 1 // Store HL bar position
last_low_bar := bar_index
last_structure_type := "HL"
// Bearish structure tracking (LL, LH alternating)
if breakout_direction == "bearish"
// Check for Lower Low pattern: Bearish candle followed by bullish candle
pattern_low = math.min(low , low)
prev_ll = na(last_ll_level) ? last_swing_low : last_ll_level
// LL Detection: Only if we expect LL next (no last structure or last was LH)
if (na(last_structure_type) or last_structure_type == "LH") and close < open and close > open and pattern_low < prev_ll and close < prev_ll
// Check consolidation
is_too_close = not na(last_low_bar) and (bar_index - last_low_bar) <= 4
should_create_ll = true
if is_too_close and structure_count > 0 and pattern_low >= last_ll_level
should_create_ll := false
if should_create_ll
structure_count := structure_count + 1
label.new(bar_index - 1, low - (low * 0.0003), "LL" + str.tostring(structure_count),
style=label.style_none, color=color.new(color.white, 100),
textcolor=color.white, size=size.small)
last_ll_level := pattern_low
last_swing_low := pattern_low
last_low_bar := bar_index
last_structure_type := "LL"
// LH Detection: Only if we expect LH next (last was LL)
pattern_high = math.max(high , high)
prev_lh = na(last_lh_level) ? last_swing_high : last_lh_level
if last_structure_type == "LL" and close > open and close < open and pattern_high < prev_lh and close < prev_lh
// Check consolidation
is_too_close = not na(last_high_bar) and (bar_index - last_high_bar) <= 4
should_create_lh = true
if is_too_close and pattern_high >= last_lh_level
should_create_lh := false
if should_create_lh
structure_count := structure_count + 1
label.new(bar_index - 1, high + (high * 0.0003), "LH" + str.tostring(structure_count),
style=label.style_none, color=color.new(color.white, 100),
textcolor=color.white, size=size.small)
last_lh_level := pattern_high
most_recent_lh := pattern_high // Update most recent LH for BoS detection
most_recent_lh_bar := bar_index - 1 // Store LH bar position
last_high_bar := bar_index
last_structure_type := "LH"
// Check if we're within the cutoff period before London session end
current_minute = minute(time, session_timezone)
london_end_time_minutes = london_end_hour * 60 // Convert London end hour to minutes
current_time_minutes = current_hour * 60 + current_minute // Current time in minutes
// Calculate minutes remaining in London session
london_session_minutes_remaining = london_end_time_minutes - current_time_minutes
// Handle day rollover case (e.g., if london_end is 8:00 (480 min) and current is 23:30 (1410 min))
if london_session_minutes_remaining < 0
london_session_minutes_remaining := london_session_minutes_remaining + (24 * 60) // Add 24 hours in minutes
// Only allow trades if more than cutoff_minutes remaining in London session
allow_new_trades = london_session_minutes_remaining > cutoff_minutes
// Break of Structure (BoS) Detection and Trading Logic - Only first BoS per London session and outside cutoff period
if show_bos and london_active and show_market_structure and not bos_detected and not trade_taken and allow_new_trades
// Bullish BoS: Price closes below the most recent HL (after bullish breakout) - SELL SIGNAL
if breakout_direction == "bullish" and not na(most_recent_hl) and not na(most_recent_hl_bar)
// Check minimum distance requirement (at least 4 candles between BoS and HL)
if close < most_recent_hl and (bar_index - most_recent_hl_bar) >= 4
// Draw dotted line from HL position to BoS point
line.new(most_recent_hl_bar, most_recent_hl, bar_index, most_recent_hl,
color=bos_color, width=2, style=line.style_dotted, extend=extend.none)
// Calculate center position for BoS label
center_bar = math.round((most_recent_hl_bar + bar_index) / 2)
// Draw BoS label below the line for HL break
label.new(center_bar, most_recent_hl - (most_recent_hl * 0.0005), "BoS",
style=label.style_none, color=color.new(color.white, 100),
textcolor=bos_color, size=size.normal)
// SELL ENTRY
if not na(london_session_high) and not na(asian_absolute_low)
// Calculate stop loss based on settings
stop_loss_level = use_atr_sl ? close + (atr * atr_multiplier) : london_session_high
take_profit_level = asian_absolute_low
entry_price = close
// Calculate position size based on user settings
position_size = calculate_position_size(entry_price, stop_loss_level)
strategy.entry("SELL", strategy.short, qty=position_size, comment="BoS Sell")
strategy.exit("SELL EXIT", "SELL", stop=stop_loss_level, limit=take_profit_level, comment="SL/TP")
// Create trade visualization boxes (TradingView style) - minimum 8 bars width
// Blue profit zone box (from entry to take profit)
current_profit_box := box.new(left=bar_index, top=take_profit_level, right=bar_index + 8, bottom=entry_price,
bgcolor=color.new(color.blue, 70), border_width=0)
// Red stop loss zone box (from entry to stop loss)
current_sl_box := box.new(left=bar_index, top=entry_price, right=bar_index + 8, bottom=stop_loss_level,
bgcolor=color.new(color.red, 70), border_width=0)
trade_taken := true
bos_detected := true // Mark BoS as detected for this session
// Bearish BoS: Price closes above the most recent LH (after bearish breakout) - BUY SIGNAL
if breakout_direction == "bearish" and not na(most_recent_lh) and not na(most_recent_lh_bar)
// Check minimum distance requirement (at least 4 candles between BoS and LH)
if close > most_recent_lh and (bar_index - most_recent_lh_bar) >= 4
// Draw dotted line from LH position to BoS point
line.new(most_recent_lh_bar, most_recent_lh, bar_index, most_recent_lh,
color=bos_color, width=1, style=line.style_dotted, extend=extend.none)
// Calculate center position for BoS label
center_bar = math.round((most_recent_lh_bar + bar_index) / 2)
// Draw BoS label above the line for LH break
label.new(center_bar, most_recent_lh + (most_recent_lh * 0.0005), "BoS",
style=label.style_none, color=color.new(color.white, 100),
textcolor=bos_color, size=size.normal)
// BUY ENTRY
if not na(london_session_low) and not na(asian_absolute_high)
// Calculate stop loss based on settings
stop_loss_level = use_atr_sl ? close - (atr * atr_multiplier) : london_session_low
take_profit_level = asian_absolute_high
entry_price = close
// Calculate position size based on user settings
position_size = calculate_position_size(entry_price, stop_loss_level)
strategy.entry("BUY", strategy.long, qty=position_size, comment="BoS Buy")
strategy.exit("BUY EXIT", "BUY", stop=stop_loss_level, limit=take_profit_level, comment="SL/TP")
// Create trade visualization boxes (TradingView style) - minimum 8 bars width
// Blue profit zone box (from entry to take profit)
current_profit_box := box.new(left=bar_index, top=entry_price, right=bar_index + 8, bottom=take_profit_level,
bgcolor=color.new(color.blue, 70), border_width=0)
// Red stop loss zone box (from entry to stop loss)
current_sl_box := box.new(left=bar_index, top=stop_loss_level, right=bar_index + 8, bottom=entry_price,
bgcolor=color.new(color.red, 70), border_width=0)
trade_taken := true
bos_detected := true // Mark BoS as detected for this session
// Position close detection for extending boxes (based on Casper strategy)
if barstate.isconfirmed and strategy.position_size == 0 and strategy.position_size != 0
// Extend trade visualization boxes to exact exit point when position closes
if not na(current_profit_box)
// Ensure minimum 8 bars width or extend to current bar, whichever is longer
box_left = box.get_left(current_profit_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_profit_box, final_right)
current_profit_box := na // Clear reference after extending
if not na(current_sl_box)
// Ensure minimum 8 bars width or extend to current bar, whichever is longer
box_left = box.get_left(current_sl_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_sl_box, final_right)
current_sl_box := na // Clear reference after extending
// Backup safety check - extend boxes if position is closed but boxes still active
if not na(current_profit_box) and strategy.position_size == 0
box_left = box.get_left(current_profit_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_profit_box, final_right)
current_profit_box := na
if not na(current_sl_box) and strategy.position_size == 0
box_left = box.get_left(current_sl_box)
min_right = box_left + 8
final_right = math.max(min_right, bar_index)
box.set_right(current_sl_box, final_right)
current_sl_box := na
// Reset everything when new Asian session starts
if asian_start and show_swing_points
asian_session_high := na
asian_session_low := na
asian_high_bar := na
asian_low_bar := na
// Reset absolute levels
asian_absolute_high := na
asian_absolute_low := na
asian_high_line := na
asian_low_line := na
asian_high_label := na
asian_low_label := na
high_broken := false
low_broken := false
// Reset London session levels
london_session_high := na
london_session_low := na
// Reset market structure tracking
breakout_direction := na
last_hh_level := na
last_hl_level := na
last_ll_level := na
last_lh_level := na
last_swing_high := na
last_swing_low := na
last_high_bar := na
last_low_bar := na
structure_count := 0
last_structure_type := na
pending_high := na
pending_low := na
pending_high_bar := na
pending_low_bar := na
waiting_for_confirmation := false
// Reset BoS tracking
most_recent_hl := na
most_recent_lh := na
most_recent_hl_bar := na
most_recent_lh_bar := na
bos_detected := false
// Reset trading
trade_taken := false
// Reset current trade boxes
current_profit_box := na
current_sl_box := na
// Debug info (optional)
show_debug = input.bool(false, "Show Debug Info")
if show_debug
var table debug_table = table.new(position.top_right, 2, 3, bgcolor=color.white, border_width=1)
if barstate.islast
table.cell(debug_table, 0, 0, "Current Hour:", text_color=color.black)
table.cell(debug_table, 1, 0, str.tostring(current_hour), text_color=color.black)
table.cell(debug_table, 0, 1, "Asian Active:", text_color=color.black)
table.cell(debug_table, 1, 1, str.tostring((current_hour >= asian_start_hour) or (current_hour < asian_end_hour)), text_color=color.black)
table.cell(debug_table, 0, 2, "London Active:", text_color=color.black)
table.cell(debug_table, 1, 2, str.tostring((current_hour >= london_start_hour) and (current_hour < london_end_hour)), text_color=color.black)
RSI + Smoothed HA Strategy 🚀 RSI + SMOOTHED HEIKEN ASHI STRATEGY (TRAILING TP, 1% SL) 📊
🎯 STRATEGY OVERVIEW
This professional trading strategy combines MOMENTUM ANALYSIS with TREND CONFIRMATION using two powerful technical indicators. The system executes LONG-ONLY POSITIONS when bullish conditions align, featuring AUTOMATED RISK MANAGEMENT with a fixed stop loss and dynamic trailing exit.
⚙️ CORE COMPONENTS
📈 INDICATOR 1: RELATIVE STRENGTH INDEX (RSI)
CALCULATION: Standard 14-period RSI (configurable)
ENTRY THRESHOLD: 55 LEVEL (adjustable parameter)
PURPOSE: Identifies MOMENTUM STRENGTH and OVERBOUGHT CONDITIONS
VISUAL: Blue RSI line with gray threshold level plotted separately
🕯️ INDICATOR 2: DOUBLE-SMOOTHED HEIKEN ASHI
UNIQUE FEATURE: DOUBLE EMA SMOOTHING applied to Heiken Ashi candles
SMOOTHING LAYERS:
FIRST LAYER: EMA applied to raw OHLC data (default: 10 periods)
SECOND LAYER: EMA applied to Heiken Ashi values (default: 10 periods)
COLOR SCHEME:
🟢 LIME GREEN: Bullish candle (close > open)
🔴 RED: Bearish candle (close < open)
BENEFIT: REDUCES MARKET NOISE while maintaining trend clarity
🎮 ENTRY CONDITIONS
📈 LONG POSITIONS ACTIVATE WHEN ALL THREE CONDITIONS CONVERGE:
RSI MOMENTUM: RSI ≥ 55 (configurable level)
TREND CONFIRMATION: Current smoothed Heiken Ashi candle is GREEN
TREND REVERSAL SIGNAL: Previous smoothed Heiken Ashi candle was RED
✅ ENTRY LOGIC: This triple-filter approach ensures trades are taken only during CONFIRMED BULLISH SHIFTS with underlying momentum strength.
🛡️ RISK MANAGEMENT SYSTEM
⛔ STOP LOSS PROTECTION
FIXED 1% RISK PER TRADE
AUTOMATIC CALCULATION: Stop placed at 99% of entry price
IMMEDIATE ACTIVATION: Engages upon position entry
BENEFIT: CAPS MAXIMUM LOSS regardless of market volatility
💰 TRAILING TAKE-PROFIT MECHANISM
DYNAMIC EXIT STRATEGY: Tracks trend continuation
EXIT CONDITION: Closes position when smoothed Heiken Ashi turns RED
ADVANTAGE: LOCKS IN PROFITS during trend reversals
LOGIC: Allows winners to run while protecting gains
💼 POSITION SIZING
CAPITAL ALLOCATION: 10% of equity per trade (fully customizable)
INITIAL CAPITAL: $10,000 (user-adjustable)
FLEXIBILITY: Compatible with various account sizes
✨ KEY ADVANTAGES
🎯 PRECISE TIMING
Combines MOMENTUM FILTER (RSI) with TREND FILTER (Heiken Ashi)
Reduces false signals through CONFIRMATION SEQUENCE
🛡️ DISCIPLINED RISK CONTROL
PREDEFINED 1% STOP LOSS eliminates emotional decisions
SYSTEMATIC EXITS remove subjective profit-taking
👁️ VISUAL CLARITY
CLEAN CHART PLOTTING with color-coded candles
SEPARATE RSI DISPLAY for momentum monitoring
REAL-TIME SIGNALS directly on price chart
⚡ OPTIMIZATION TIPS
ADJUST RSI LEVEL based on asset volatility (55-70 range)
MODIFY SMOOTHING PERIODS for different timeframes
TEST POSITION SIZE according to risk tolerance
COMBINE WITH VOLUME CONFIRMATION for enhanced accuracy
📊 RECOMMENDED MARKETS
TRENDING FOREX PAIRS (EUR/USD, GBP/USD)
LIQUID INDICES (S&P 500, NASDAQ)
HIGH-CAP CRYPTO (BTC/USD, ETH/USD)
TIME FRAMES: 1-hour to daily charts
⚠️ RISK DISCLAIMER
This strategy is a TOOL FOR ANALYSIS, not financial advice. Always:
BACKTEST extensively before live trading
START WITH SMALL CAPITAL
USE PROPER RISK MANAGEMENT
CONSULT FINANCIAL PROFESSIONALS
BTC-USDC 4-Hour xingchen fuliBTC-USDC 4-Hour Timeline Super Strategy
This strategy uses a 4-hour chart as its basic framework. For more details, please contact the author.
GKZ 3-Bar Compression ReversalThis one is NOT an indicator but a strategy
Simple rules
Weekly close is above 30 EMA weekly for atleast 3-5 weeks ( keeping fans of Stan Weinstein happy)
following assumptions
today is Day T , SO
T-2 was a red candle
T-1 was a green candle but its high is lower than T-2 and its close is above T-2
T ( confirmation candle):
T's high is higher than T-2 and T-1 and its close is higher than T-1
aiyyo, this is so confusing...how do i find such stocks G?
Drummmrolllllll : chartink.com
ADX Price Movement Strategy. TG:@MrBCNADX Price Movement Strategy is a trading strategy for TradingView that uses the ADX indicator to determine the strength of price movement. The strategy identifies the beginning and end of momentum, filters out flat periods, and generates LONG/SHORT signals only when there is a strong trend. Suitable for cryptocurrencies, forex, and stocks, it is effective on short and medium timeframes.
ADX Price Movement Strategy — торговая стратегия для TradingView, использующая индикатор ADX для определения силы движения цены. Стратегия выявляет моменты начала и окончания импульса, фильтрует флет и подаёт сигналы LONG / SHORT только при наличии сильного тренда. Подходит для криптовалют, форекса и акций, эффективна на младших и средних таймфреймах.
TG:@MrBCN
Order Block Strategy Pyramiding. TG:@MrBCNOrder Block Strategy Pyramiding is a strategy for TradingView based on the concept of Order Blocks. It identifies areas of interest for major market participants and looks for price reversal points when prices return to these areas. It generates LONG/SHORT signals, is suitable for cryptocurrencies, forex, and stocks, and is effective on short and medium timeframes.
Order Block Strategy Pyramiding — стратегия для TradingView, основанная на концепции Order Blocks. Определяет зоны интереса крупных участников рынка и ищет точки разворота цены при возврате в эти зоны. Генерирует сигналы LONG / SHORT, подходит для криптовалют, форекса и акций, эффективна на младших и средних таймфреймах.
TG:@MrBCN
Order Block Strategy ReversWIN: 70-100%
8, 3, 3,1
TP 1.6%
Order Block Strategy Revers is a trading indicator that identifies key order block zones (areas of accumulation by large players) and looks for price reversal points. The indicator tracks impulsive movements, forms supply and demand levels, and generates LONG/SHORT signals when the price returns to the order block with confirmation. Suitable for crypto, forex, and stocks, effective on medium and lower timeframes.
Translated with DeepL.com (free version)
Order Block Strategy Revers — это торговый индикатор, который определяет ключевые order block зоны (области накопления крупных игроков) и ищет точки разворота цены. Индикатор отслеживает импульсные движения, формирует уровни спроса и предложения и подаёт сигналы LONG / SHORT при возврате цены в order block с подтверждением. Подходит для крипты, форекса и акций, эффективен на средних и младших таймфреймах.
ATR + BB Swing StrategyMechanical daily stock swing strategy using ATR stops, Heikin Ashi trend confirmation, and Bollinger Bands context. Entries occur above 50 SMA on bullish Heikin Ashi candles; initial stop is 3xATR with trailing stop of highest close minus 2xAtr, reducing to 1.5xATR when profit protection triggers (+2R and momentum weakening). Exits are fully ATR-based, giving a simple, rules-driven approach to ride trends while protecting gains
SPCE PROYou see a green arrow Buy and put your take profit on the blue points and for shorts reverse the process
FÜR MAKRA!❤
GOLD TERTIUM estrategiaThis indicator is a visual tool for TradingView designed to help you read trend structure using EMAs and highlight potential long and short entries on the MGC 1‑minute chart, while filtering pullbacks and avoiding trades when the 200 EMA is flat.
It calculates five EMAs (32, 50, 110, 200, 250) and plots them in different colors so you can clearly see the moving‑average stack and overall direction. The main trend is defined by the 200 EMA: bullish when price and the fast EMAs (32 and 50) are above it with a positive slope, and bearish when they are below it with a negative slope; if the 200 EMA is almost flat, signals are blocked to reduce trading in choppy markets.
GoldenEA trendcatcher STRATEGY📈 GoldenEA Trendcatcher – Strategy Description
GoldenEA Trendcatcher is a precision-built intraday trading strategy designed for traders who prefer clarity, discipline, and controlled risk.
It focuses on capturing high-probability market moves while maintaining strict trade management and capital protection.
This strategy is session-aware and operates only during user-defined trading hours, helping traders avoid low-liquidity and unfavorable market conditions. It automatically limits the number of trades per day, ensuring disciplined execution and preventing overtrading.
🔒 Smart Risk & Trade Management
Built-in dynamic risk control with automatic stop-loss and profit-target handling
Breakeven protection that activates once price moves favorably, with an optional buffer to account for brokerage and commissions
Clear visual markers on the chart for breakeven and profit milestones
Automatic exits to protect profits and reduce emotional decision-making
📊 Visual & Analytical Clarity
Clean chart presentation with optional historical plotting
Real-time risk-to-reward visualization for every trade
On-chart boxes and labels that help traders understand trade structure at a glance
Designed to stay lightweight and non-intrusive
⚙️ Fully Customizable
Adjustable trade session timing
Configurable daily trade limits
User-defined profit targets, breakeven levels, and visual styles
Works seamlessly across intraday timeframes
🎯 Who Is This For?
GoldenEA Trendcatcher is ideal for traders who:
Want rule-based execution without constant monitoring
Prefer visual confirmation over complex indicators
Value risk management first, profits second
Trade intraday and want consistency over randomness
Note: This strategy is intended for educational and backtesting purposes. Always test thoroughly on demo accounts before considering live deployment.
SSL MACD - nhuthang83supertrend method, supertrend method, supertrend method, supertrend method, supertrend method,
MW Futures Liquidity ScalperMW Futures Liquidity Scalper - ICT-Inspired Algorithmic Trading
A comprehensive ICT (Inner Circle Trader) inspired strategy that automates liquidity pool detection, fair value gap (FVG) analysis, and precision entries for futures and forex markets. This strategy implements institutional trading concepts with customizable filters, multi-timeframe confirmation, and complete risk management.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 What This Strategy Does
This strategy scans the market for areas where stop losses cluster (liquidity pools), identifies price imbalances (FVGs), and places precision entries when conditions align. It automates the "liquidity hunt" concept: tracking where institutions sweep stops before price reverses.
The key principle: Time first, then price. Configure when to trade, which liquidity to target, and how to enter - the strategy handles the rest.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 How The Algorithm Works
Step 1 - Liquidity Mapping: Calculates session highs (buy-side liquidity/BSL) and lows (sell-side liquidity/SSL) at your chosen intervals
Step 2 - Bias Detection: More BSL than SSL = bearish bias. More SSL than BSL = bullish bias
Step 3 - FVG Search: Finds the first valid Fair Value Gap matching your size requirements and current bias
Step 4 - Filter Check: Validates all enabled filters (EMA, NWOG/NDOG, orderflow, correlation, macro time)
Step 5 - Entry Placement: Places limit order at FVG boundary with configured slippage
Step 6 - Exit Management: Sets take profits at opposing liquidity pools, manages trailing stops and breakeven
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔑 Core Concepts Explained
Liquidity Pools
Areas where stop losses cluster - above swing highs (BSL/blue lines) or below swing lows (SSL/red lines). Institutions often sweep these zones before reversing. Darker colors indicate pools that have been purged.
Fair Value Gaps (FVGs)
Price imbalances from aggressive moves where 3-candle wicks don't overlap. These act as entry zones. Green = bullish, Red = bearish, Blue = invalid/neutral.
First Presentation
The first FVG after session start (Asia 18:30, London 00:30, NY AM 09:30, NY PM 13:30 NY time). Used until the next session begins.
2022 Model
Only searches for FVGs after a liquidity pool is purged. Loops backward from the sweep to find the enabling FVG - often used for IFVG (Inverse FVG) trades.
Volume Imbalance
When candle bodies don't touch within an FVG, extends the FVG boundaries for more precise entries.
Premium/Discount
Above 50% of a range = premium (favorable for shorts). Below 50% = discount (favorable for longs).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Key Features
Liquidity Detection
• Configurable calculation intervals: 15-minute, 30-minute, or hourly
• Optional AM Opening Range (09:30-10:00 NY)
• Daily reset at 18:00 NY time
• Visual tracking of BSL (blue) and SSL (red) levels
FVG Analysis
• Minimum/maximum FVG size filters (handles)
• Skip invalid FVGs to find next valid one
• Volume imbalance integration
• Four session-based first presentation options
• 2022 Model for post-purge entries
Orderflow Filters
• Short-Term (STH/STL) - 3-candle swings (yellow)
• Intermediate-Term (ITH/ITL) - higher-degree swings (purple)
• Long-Term (LTH/LTL) - major swing structure (green)
• Premium/discount zones for each level
• Automatic bias shift when levels are taken
Direction Filters
• NDOG: New Day Opening Gap - gap between 16:59 and 18:00
• NWOG: New Week Opening Gap - Friday close to Sunday open
• EMA Filters: 9/18 EMA crossovers on daily, weekly, or custom timeframes
• Macro Time: Trade only during xx:50 to xx:10 windows
• Midnight Filter: Use 00:00 NY close as bias reference
Correlation Filters
• Compare with any ticker using 9/18 EMA
• Positive correlation: both must align
• Negative correlation: must be opposite (e.g., NQ long when DXY short)
• Available on weekly, daily, and custom timeframes
Risk Management
• Three stoploss placement methods (FVG boundary, 2nd candle, 1st candle)
• Configurable min/max stoploss sizes
• Trailing stoploss (close-based or high/low)
• Auto-breakeven after first TP with handle offset
• Option to skip breakeven during avoidance times
Position Sizing
• Topstep 50k/100k/150k presets with proper limits
• AMP Live margin-based sizing
• Custom daily loss, drawdown, and contract limits
• Max risk per trade with automatic contract scaling
Entry Precision
• Entry slippage: positive = outside FVG, negative = inside FVG
• Close above/below requirement before entry
• 75% body closure filter to avoid wick-driven signals
Exit Management
• Take profits at opposing liquidity pools
• Runner contracts for extended trends
• TP clustering to merge nearby targets
• Max trades per hour limiter
Time Controls
• Configurable timezone (9 major zones)
• Liquidity search windows
• Trading hours restrictions
• Day-specific avoidance times
• Close all positions time
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Building Your Model (Step-by-Step)
1. Define Time: When do you want to trade? (NY open 09:30-11:30 recommended)
2. Choose Liquidity: 15-minute, 30-minute, hourly, or AM opening range
3. Select FVG Method: First presentation, timed intervals, or 2022 model
4. Set Entry Rules: Slippage, close confirmation, body filter
5. Configure Stoploss: Placement method, min/max sizes, trailing
6. Add Orderflow: STH/STL, ITH/ITL, LTH/LTL with premium/discount
7. Apply Direction Filters: EMA, NWOG/NDOG, macro, correlation
8. Set Profit Targets: Min distance, max TP, runners, clustering
Tip: Start simple with steps 1-3, then optimize incrementally. Don't enable all filters at once.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 Settings Groups
Time Settings - Trading Periods: Timezone, start date, liquidity windows, trading hours
Liquidity Settings: Calculation intervals, AM opening range
FVG Settings: Size filters, first presentation, 2022 model, volume imbalance
Entry Settings: Slippage, close confirmation, body filter
Stoploss Settings: Placement, min/max, trailing, alerts
Breakeven Settings: Amount, trigger conditions, avoidance time behavior
Orderflow Filters: STH/STL, ITH/ITL, LTH/LTL with premium/discount
Line Filters: Daily matrix, midnight filter, custom hourly/minute
Direction Filters: NDOG, NWOG, EMA daily/weekly/custom, macro time
Correlation Settings: Weekly/daily/custom with ticker and type
Profit Targets: Min range, max TP, runners, clustering
Funded Account Rules: Account type, loss limits, margin, contracts
Time Settings - Avoidance: Macro first 2 minutes, day-specific blocks
Miscellaneous: Visual colors for FVGs, liquidity, labels
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Usage Guidelines
Use on 1-minute timeframe (warning displays otherwise)
Designed for futures (ES, NQ, MES, MNQ) and forex
Enable bar magnifier for realistic backtesting
TradingView Premium recommended for extended history
Commission: $0.62/contract for futures accuracy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Optimization Tips
Focus on ONE trading model - don't combine everything
Trade high-liquidity sessions (NY open is most active)
Optimize in stages: time → filters → stoploss → trailing → avoidance
Use realistic commission and slippage settings
Avoid over-optimization - keep models simple
Test across multiple market conditions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Risk Considerations
Execution Risk: Fast markets can cause slippage beyond settings
False Signals: Not all FVGs lead to profitable trades
Time Sensitivity: Liquidity concepts work best during active sessions
Market Conditions: Performance varies in trending vs ranging markets
Capital Risk: Futures require appropriate margin and risk capital
Leverage: Futures amplify both gains and losses
Over-Optimization: Past performance does not guarantee future results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ IMPORTANT DISCLAIMER
Trading futures, forex, and other leveraged products involves substantial risk of loss and is not suitable for all investors. You could lose more than your initial investment. Never trade with money you cannot afford to lose.
Past performance shown in backtests is NOT indicative of future results. No trading strategy guarantees profits. Markets are inherently unpredictable, and historical patterns may not repeat.
This strategy is provided for EDUCATIONAL and INFORMATIONAL purposes only. It does not constitute financial advice, trading advice, or any other type of advice. The concepts are based on ICT (Inner Circle Trader) methodology as interpreted by the author.
Before trading:
• Understand the risks involved
• Use proper position sizing
• Always use stop-losses
• Test thoroughly on demo accounts
• Only trade with capital designated for risk
By using this strategy, you acknowledge that you understand and accept these risks. Trade responsibly.
Madstrat 2.0 StrategyMadstrat 2.0 Strategy Overview
A multi-timeframe trading strategy implementing the Madstrat methodology with dual timeframe systems (15m/1hr and 30m/2hr), sophisticated day classification, and exhaustion-based exits.
---
Signal Types (Priority Order)
1. **Day 3 Signals** - GSD/RSD Day 3 with full confluence
2. **Day 2 Signals** - GSD/RSD Day 2 with full confluence
3. **M3 EQ Entry** - HTF 50 EMA rejection at equilibrium + LTF 50 SMA touch + 9/50 cross
4. **Pure Madstrat** - All confluence requirements except day count
---
Function Reference
Instrument & Tolerance
| Function | Purpose |
|----------|---------|
| `f_get_baseline_tolerance()` | Returns adaptive pip tolerance—wider for gold (~150 ticks), tighter for forex (~80 pips) |
| `f_get_breakout_points()` | Returns breakout threshold by instrument type |
Day Classification Engine (5m Authoritative)
| Function | Purpose |
|----------|---------|
| `f_day_state_5m()` | **Core engine**: handles rollover detection, daily/weekly OHLC, GSD/RSD counting, inside days, FBR, clean breakouts |
| `f_get_power_of_3_count()` | Maps DOW to Power of 3 (Mon=1, Tue=2, Wed=3, Thu=2, Fri=3) |
Touch & Alignment Detection
| Function | Purpose |
|----------|---------|
| `f_baseline_touch_buy/sell()` | Detects 50 EMA touch with directional close |
| `f_touch_buy/sell()` | Generic level touch detection |
| `f_update_touch_counter()` | Increments/resets touch bar counters |
| `f_stack_buy/sell()` | Full stack check: `close > 9 > 18 > 50 EMA > 50 SMA` |
| `f_ema_alignment_buy/sell()` | Basic 9/18 EMA alignment |
| `f_ema_slope_bullish/bearish()` | All EMAs sloping same direction |
| `f_candle_closed_above/below_emas()` | Candle position vs 9/18 EMAs |
Setup Grading & HTF Confirmation
| Function | Purpose |
|----------|---------|
| `f_grade_setup()` | Grades A/B setup based on multi-TF alignment + candle direction |
| `f_htf_rejection_bearish/bullish()` | Detects HTF 50 EMA rejection patterns |
Confluence Scoring
| Function | Purpose |
|----------|---------|
| `f_get_required_confluence()` | Dynamic score requirement by day count (Day 1→5, Day 2→4, Day 3+→3) |
| `f_confluence_score_day3()` | Scores Day 2/3 signals (max 10 factors) |
| `f_confluence_score_pure()` | Scores Pure signals (max 9 factors) |
Position & Risk Management
| Function | Purpose |
|----------|---------|
| `f_position_size()` | Calculates qty from entry, SL, and risk % |
| `f_calculate_rr()` | Computes risk-reward ratio |
| `f_find_swing_high/low()` | Locates historical swings for TP3 |
| `f_partial_close_longs/shorts()` | Closes % of all long/short entries |
| `f_close_all_longs/shorts()` | Full position close |
Exhaustion Areas (M1/M2)
| Function | Purpose |
|----------|---------|
| `f_is_bullish/bearish_candle()` | Candle direction check |
| `f_create_exhaustion_box()` | Draws exhaustion zone visualization |
Session & Utilities
| Function | Purpose |
|----------|---------|
| `f_session_string()` | Formats session time range |
| `f_get_label_size()` | Converts string to `size.*` constant |
| `f_chart_tf_minutes()` | Current chart TF in minutes |
UI Tables
| Function | Purpose |
|----------|---------|
| `f_auto_system()` / `f_selected_system()` | Auto-selects 15m or 30m system based on chart TF |
| `f_draw_confluence_table()` | Renders confluence scoring panel |
| `f_draw_status_table()` | Renders status/signal panel |
| `f_status_row/header()`, `f_touch_status_text()` | Table cell helpers |
---
Exit System
| Exit | Trigger | Action |
|------|---------|--------|
| **TP1** | Price hits PDH (longs) / PDL (shorts) | Close 50% |
| **TP2** | Price hits PWH / PWL | Close 30% (60% of remaining) |
| **TP3** | Price hits next swing level | Close remaining 20% |
| **M1-R1** | Test exhaustion zone + reject | Close 50% |
| **M1-R2** | Break exhaustion + return | Close 50% |
| **Stop Loss** | EMAs reverse + break entry candle | Full close |
---
Key Entry Requirements
- **All levels touched** (9/18/50 EMA + 50 SMA)
- **Full stack alignment**
- **5m EMA confirmation**
- **HTF baseline + EQ touch** (within lookback)
- **EQ rejection** (optional)
- **Minimum RR threshold**
- **Session filter** (optional)
- **No inside day**






















