0.06% Price ChangePower indicator candle - Ideal for IntraDay Bank Nifty
Optiions Buying indicator - Trade after this candle + Doji + Continuity
نماذج فنيه
TTB 8 + 9 simpleMarks Sequential 8 and 9 exhaustion counts on your chart. Green labels = potential buy reversals, red labels = potential sell reversals. Includes alerts and toggles for buy/sell signals. Lightweight script with no external dependencies.
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)
SA Range Rank WMT DAY 1.13.2026 PM SESSIONDAILY — PREPARE / POSITION MODE
Developer Note: Bias & Position Framing
This daily view is preparatory, not executable.
The purpose of the Daily timeframe is to define directional bias, not entries.
It helps frame which side of the market deserves attention and which activity should be ignored.
The goal here is context, not action.
________________________________________
Purpose on Daily
The Daily timeframe is used to:
• Define directional bias for the week
• Prepare position-building zones
• Identify environments where participation is unnecessary or elevated-risk
• Reduce overtrading by narrowing focus
Daily charts answer one question only:
“If I participate this week, which side makes sense?”
________________________________________
What Matters Most (Public View)
SA Range Indicator (RI):
→ Is the market transitioning or trending?
→ Is energy building, releasing, or rotating?
SA ZoneEngine (visual context only):
→ Are daily moves aligned with higher-timeframe structure?
→ Is price operating with or against dominant bias?
These visuals explain environment, not decisions.
________________________________________
How to Interpret Public Daily Posts
• Daily is not timing
• Daily is not execution
• Daily is not a signal
Daily charts prepare the trader mentally and structurally by clarifying:
• what deserves patience
• what deserves caution
• what deserves no attention at all
________________________________________
Messaging Line
“Daily charts prepare the trade — they don’t execute it.”
________________________________________
SEO Intent
daily equity bias, position preparation, market structure analysis
________________________________________
🤝 For Those Who Find Value
If these daily posts help you see the market more clearly:
• Follow, boost, and share my scripts, Ideas, and MINDS posts
• Feel free to message me directly with questions or build requests
• Constructive feedback and collaboration are always welcome
For traders who want to go deeper, optional memberships may include:
• Additional signal access
• Early previews
• Occasional free tools and upgrades
🔗 Membership & Signals
trianchor.gumroad.com
________________________________________
________________________________________
⏱ 15-MIN — PREPARE / POSITION MODE
Developer Note: Setup Formation Phase
The 15-minute timeframe is where setups begin to form, not where they are acted on.
This view exists to separate developing structure from noise.
________________________________________
Purpose on 15-Minute
The 15-minute timeframe is used to:
• Spot trap-prone conditions
• Identify developing structure
• Observe compression, rotation, or early expansion
• Prepare for execution — without acting
This timeframe answers a different question:
“Is something forming — or is this noise?”
________________________________________
What Matters Most (Public View)
SA Range Indicator (RI):
→ Compression → expansion transitions
→ Energy buildup vs premature release
SA CloudRegimes (visual only):
→ Whether price behavior reflects continuation, pullback, or contraction
→ Whether movement is controlled or impulsive
These visuals describe behavior, not entries.
________________________________________
How to Interpret Public 15-Minute Posts
• 15m is setup formation
• 15m is environmental awareness
• 15m is not execution
Most errors occur when traders act before structure has finished forming.
This timeframe exists to slow that impulse down.
________________________________________
Messaging Line
“Preparation happens before the move — not during it.”
________________________________________
SEO Intent
15 minute futures setup, market preparation, stop hunt behavior
________________________________________
🤝 For Those Who Find Value
If these posts help you better recognize developing structure:
• Follow, boost, and share my scripts, Ideas, and MINDS posts
• Feel free to message me directly with questions or build requests
• Constructive feedback and collaboration are always welcome
For traders who want to go deeper, optional memberships may include:
• Additional signal access
• Early previews
• Occasional free tools and upgrades
🔗 Membership & Signals
trianchor.gumroad.com
Daily (D) — Swing Bias / “This is the side that has permission”
Goal: Define swing participation: are we in a supported trend or mean-revert risk?
How to use:
• Daily RECLAIM = “permission restored” after a shock move / trend resumption.
• Use it to decide:
Hold adds / reduce hedges / stop fighting direction.
Best use case:
• After earnings/news displacement days
• After large liquidation candles
• After a major gap day
Settings:
• dispMult 1.1–1.5
• reclaimWindow 12–25
• cooldown 6–12
🔵 DAILY — Swing Environment & Risk Framing
1️⃣ Range Indicator (RI)
• Compression → swing expansion likely
• Expansion → continuation or exhaustion
Use:
Tells you whether to expect patience or momentum.
________________________________________
2️⃣ ZoneEngine (Structure)
• Confirms whether daily swings align with higher bias
• Filters false daily breakouts
Use:
Only trust daily moves that occur inside structure.
________________________________________
3️⃣ Cloud / Reclaim (Behavior)
• Trend Clouds → continuation environment
• Pullback Clouds → reload or fade zones
• Reclaim shows acceptance back into value
Use:
Distinguishes real pullbacks from traps.
________________________________________
4️⃣ Stop-Hunt Proxy
• Clears weak swing participants
• Often precedes continuation when aligned
Use:
Stop-hunt + compression + trend cloud = swing continuation context.
ICT 1st Pres. FVGs & RTH Open Gaps version 13/01/2026
ICT 1st Pres. FVGs & RTH Open Gaps
By Timo Haapsaari (@hqtimppa) based on ICT (Inner Circle Trader / Michael J.
Huddleston) teachings.
This indicator identifies and displays:
• First Presented Fair Value Gaps (FVGs) after Midnight Open (00:00 NY)
• First Presented FVGs after NY Open (09:30 NY)
• Regular Trading Hours (RTH) Opening Gaps (16:14 close vs 09:30 open)
All detections are based on 1-minute data for accuracy across any timeframe.
Special thanks to cephxs (https:x.com/dyk_ceph) for inspiration on settings
structure and visual appearance.
Happy trading! 📈
Daily Upside LinePlots an intraday upside line.
Uses proprietary breakout score logic to show when intraday setups are ripe for continuation.
Finds the average of these lines to plot the upside line
QUARTERS THEORY XAUUSDThe “Quarter Theory XAUUSD” indicator on TradingView is designed to automatically plot horizontal price levels in $25 increments on your chart, providing traders with a clear visual representation of key psychological and technical price points. These levels are particularly useful for instruments like XAU/USD, where price often reacts to round numbers, forming support and resistance zones that can be leveraged for both scalping and swing trading strategies. By showing all $25 increments as horizontal white lines, the indicator ensures that traders can quickly identify potential entry and exit points, without the need for manual drawing or repeated calculations.
The indicator works by calculating the nearest $25 multiple relative to the current market price and then drawing horizontal lines across the chart for all increments within a defined range. This range can be customized to suit the instrument being traded; for example, for gold (XAU/USD), a typical range might extend from 0 to 5000, covering all practical price levels that could be relevant in both high and low market conditions. By using Pine Script’s persistent variables, the indicator efficiently creates these lines only once at the start of the chart, avoiding unnecessary resource usage and preventing TradingView from slowing down, which can happen if lines are redrawn every bar.
From a trading perspective, these levels serve multiple purposes. For scalpers, the $25 increments act as micro support and resistance points, helping to determine short-term price reactions and potential breakout zones. Scalpers can use these levels to enter positions with tight stop-loss orders just beyond a level and take profits near the next $25 increment, which aligns with common price behavior patterns in highly liquid instruments. For swing traders, the same levels provide broader context, allowing them to identify areas where price might pause or reverse over several days. Swing traders can use these levels to align trades with the prevailing trend, particularly when combined with other indicators such as moving averages or trendlines.
Another key advantage of the Quarterly Levels indicator is its simplicity and visual clarity. By plotting lines in a uniform white color and extending them to the right, the chart remains clean and easy to read, allowing traders to focus on price action and market dynamics rather than cluttered technical drawings. This visual consistency also helps in backtesting and strategy development, as traders can quickly see how price interacts with each level over time. Additionally, the use of round-number increments leverages the psychological tendencies of market participants, as many traders place stop orders or entry points near these levels, making them natural zones of interest.
Overall, the Quarterly Levels indicator combines efficiency, clarity, and practical trading utility into a single tool. It streamlines chart analysis, highlights meaningful price zones, and supports both scalping and swing trading approaches, making it an essential addition to a trader’s toolkit. By understanding how to integrate these levels into trading strategies, traders can make more informed decisions, manage risk effectively, and identify high-probability trade setups across various market conditions.
MES ORB Fakeout Alert - No RSIVWAP Integration: In 2025/2026 trading, price action often "reverses" to the VWAP. If the MES breaks the ORB High but stays below the VWAP, it’s a high-probability fakeout. This script catches that.
Relative Volume (Effort vs. Result): Instead of RSI, it looks at the Volume SMA. If the market tries to break a level with less volume than the 20-candle average, the "effort" isn't there, and the "result" (the breakout) is likely a lie.
Automatic Session Handling: It specifically looks at America/New_York time to ensure the 9:30 AM open is captured correctly regardless of where you are located.
eBacktesting - Learning: InducementeBacktesting - Learning: Inducement
Inducement is the “trap” move that often shows up right before a real push. Price briefly takes an internal swing level (a small high/low), pulls traders in the wrong direction, and then snaps back — usually right before continuing toward the larger objective.
How to study it:
- First, get a simple trend bias (are we making higher highs/higher lows, or lower highs/lower lows?).
- Watch the most recent internal swing level inside that trend.
- An inducement often looks like a quick sweep through that internal level, followed by a close back on the “correct” side.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Gold Scalp//@version=5
indicator("scalp strategy (Boxed)", overlay=true)
// Ensure 5-minute chart
isFiveMin = timeframe.isminutes and timeframe.multiplier == 5
// New York time (EST/EDT auto)
nyHour = hour(time, "America/New_York")
nyMinute = minute(time, "America/New_York")
// Target times (exact candle close)
triggerTime =
(nyHour == 11 and nyMinute == 0) or
(nyHour == 19 and nyMinute == 0) or
(nyHour == 14 and nyMinute == 0) or
(nyHour == 6 and nyMinute == 0) or
(nyHour == 8 and nyMinute == 0) or
(nyHour == 21 and nyMinute == 0) or
(nyHour == 00 and nyMinute == 0)
// Final trigger
trigger = isFiveMin and triggerTime and barstate.isconfirmed
// Draw box + label
if trigger
box.new(bar_index - -5, high, bar_index, low, bgcolor=color.new(#0e06eb, 76), border_color=color.rgb(4, 252, 136))
label.new(bar_index, high, "", style=label.style_label_down, color=color.rgb(11, 48, 3), textcolor=color.white, size=size.small)
// Alert
alertcondition(trigger, title="LETS GO", message="5-minute candle CLOSED at key EST time")
CRE Multi Pair Scanner
✔ 1 lead asset (capital source)
✔ Multiple receiver assets
✔ CRE signal fires per asset
✔ Table + labels show rotation winner
Multi TF Volume ATRThis indicator measures volatility using ATR applied to volume across multiple timeframes. It helps identify when real momentum enters the market by showing volume spikes on 1h, 4h, 12h, and Daily charts. When several timeframes spike at the same time, it often signals strong moves, breakouts, or major shifts in volatility.
The script calculates Volume ATR for 1h, 4h, 12h, and 1D. Each timeframe generates its own spike condition. The indicator then checks for alignment between timeframes. The 1h histogram changes color based on the strength of the signal.
Red means multi timeframe alignment. This is the strongest signal and shows that several timeframes are spiking together.
Yellow means a 1h spike only. This is an early warning of local volatility.
Blue means no spike.
The indicator also plots higher timeframe ATR lines for context. These include 4h ATR, 12h ATR, and 1D ATR. When these lines rise together, volatility is building. Spike markers appear at the top of the pane when higher timeframes trigger.
You can choose how strict the alignment should be. Options include all three timeframes (1h, 4h, 12h), at least two timeframes, or including the daily timeframe for even stronger confirmation.
The script includes alert conditions for 1h spikes, multi timeframe alignment spikes, and daily spikes. These alerts help you stay ahead of volatility without watching charts constantly.
This indicator is useful for many trading styles. Breakout traders use red bars to confirm momentum. Mean reversion traders use daily spikes to confirm volatility conditions. Trend traders watch rising 4h and 12h ATR lines. Scalpers use yellow bars as early warnings.
Volume ATR shows how quickly volume is expanding. When several timeframes spike together, it often signals institutional activity, liquidity events, volatility shifts, breakouts, or reversals. This provides information that price alone cannot show.
30d Rolling TWAP (Hourly)code:
//@version=5
indicator("30d Rolling TWAP (Hourly)", overlay=true)
// Calculation: (High + Low + Close) / 3
typicalPrice = hlc3
// 30 days * 24 hours = 720 bars
length = 720
twap30 = ta.sma(typicalPrice, length)
// Plotting
plot(twap30, color=color.new(#2962FF, 0), title="30d Hourly TWAP", linewidth=2)
// Optional: Background highlight
fillColor = close > twap30 ? color.new(color.green, 90) : color.new(color.red, 90)
bgcolor(fillColor)
Long + Short + Signal//@version=6
indicator("Long + Short + Signal", overlay=true)
Buy = input.bool(false, "Buy ")
Sell = input.bool(false, "Sell ")
// ================= INPUTS =================
// ---- LONG ----
periodK_Long = 50
smoothK_Long = 3
periodD_Long = 3
// ---- SHORT ----
periodK_Short = 14
smoothK_Short = 3
periodD_Short = 3
// ================= FUNCTIONS =================
f_stoch_long(tf) =>
k = request.security(syminfo.tickerid, tf,
ta.sma(ta.stoch(close, high, low, periodK_Long), smoothK_Long))
d = request.security(syminfo.tickerid, tf,
ta.sma(k, periodD_Long))
k > 50 and d > 50 ? color.green : k < 40 and d < 40 ? color.red : color.gray
f_stoch_short(tf) =>
k = request.security(syminfo.tickerid, tf,
ta.sma(ta.stoch(close, high, low, periodK_Short), smoothK_Short))
d = request.security(syminfo.tickerid, tf,
ta.sma(k, periodD_Short))
k > 60 and d > 60 ? color.green : k < 40 and d < 40 ? color.red : color.gray
// ================= TABLE =================
// 2 rows × 8 columns
var table t = table.new(position.top_right, 8, 2, border_width=3)
if barstate.islast
// ===== HEADINGS (BIGGER) =====
table.cell(
t, 0, 0, "Short",
bgcolor=color.black,
text_color=color.white,
text_size=size.large,
text_halign=text.align_center
)
table.cell(
t, 0, 1, "Long",
bgcolor=color.black,
text_color=color.white,
text_size=size.large,
text_halign=text.align_center
)
// ===== LONG ROW =====
table.cell(t, 1, 0, "1m", bgcolor=f_stoch_short("1"), text_color=color.white, text_size=size.normal)
table.cell(t, 2, 0, "5m", bgcolor=f_stoch_short("5"), text_color=color.white, text_size=size.normal)
table.cell(t, 3, 0, "15m", bgcolor=f_stoch_short("15"), text_color=color.white, text_size=size.normal)
table.cell(t, 4, 0, "60m", bgcolor=f_stoch_short("60"), text_color=color.white, text_size=size.normal)
table.cell(t, 5, 0, "D", bgcolor=f_stoch_short("D"), text_color=color.white, text_size=size.normal)
table.cell(t, 6, 0, "W", bgcolor=f_stoch_short("W"), text_color=color.white, text_size=size.normal)
table.cell(t, 7, 0, "M", bgcolor=f_stoch_short("M"), text_color=color.white, text_size=size.normal)
// ===== SHORT ROW =====
table.cell(t, 1, 1, "1m", bgcolor=f_stoch_long("1"), text_color=color.white, text_size=size.normal)
table.cell(t, 2, 1, "5m", bgcolor=f_stoch_long("5"), text_color=color.white, text_size=size.normal)
table.cell(t, 3, 1, "15m", bgcolor=f_stoch_long("15"), text_color=color.white, text_size=size.normal)
table.cell(t, 4, 1, "60m", bgcolor=f_stoch_long("60"), text_color=color.white, text_size=size.normal)
table.cell(t, 5, 1, "D", bgcolor=f_stoch_long("D"), text_color=color.white, text_size=size.normal)
table.cell(t, 6, 1, "W", bgcolor=f_stoch_long("W"), text_color=color.white, text_size=size.normal)
table.cell(t, 7, 1, "M", bgcolor=f_stoch_long("M"), text_color=color.white, text_size=size.normal)
lengthK = 14
lengthD = 3
lengthEMA = 3
emaEma(source, length) => ta.ema(ta.ema(source, length), length)
highestHigh = ta.highest(lengthK)
lowestLow = ta.lowest(lengthK)
highestLowestRange = highestHigh - lowestLow
relativeRange = close - (highestHigh + lowestLow) / 2
smi = 200 * (emaEma(relativeRange, lengthD) / emaEma(highestLowestRange, lengthD))
// ===== BUY / SELL CONDITIONS =====
buyEntry = ta.crossover(smi, 50)
buyExit = ta.crossunder(smi, 50)
sellEntry = ta.crossunder(smi, -40)
sellExit = ta.crossover(smi, -40)
// ===== PLOTS =====
plotshape( Buy and buyEntry, title="BUY", style=shape.triangleup,location=location.belowbar, color=color.green,size=size.small, text="BUY")
plotshape( Buy and buyExit, title="EXIT BUY", style=shape.triangledown, location=location.abovebar, color=color.lime,size=size.tiny, text="EXIT")
plotshape( Sell and sellEntry,title="SELL", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, text="SELL")
plotshape( Sell and sellExit, title="EXIT SELL", style=shape.triangleup, location=location.belowbar, color=color.orange, size=size.tiny, text="EXIT")
shortest = ta.ema(close, 9)
shortEMA = ta.ema(close, 21)
longer = ta.ema(close, 50)
longest = ta.ema(close, 200)
plot(shortest, color=color.red, title="EMA 9")
plot(shortEMA, color=color.orange, title="EMA 21")
plot(longer, color=color.aqua, title="EMA 50")
plot(longest, color=color.blue, title="EMA 200")
First Candle Session Levels. Sessions custom timeframes settingsFirst Candle Rule – Scalping Itinerary
Chart Setup
Use two charts at the same time: the five-minute chart and the one-minute chart. This double-chart approach allows you to define structure on the higher timeframe and execute with precision on the lower timeframe.
The First Candle
Focus on the first five-minute candle of the session. Once this candle has fully closed, mark its high and its low. These two price levels form the operating range for the setup.
Execution Phase
After the range is marked, wait for price to return into or react around the first candle range. Execution is carried out on the one-minute chart, using price reaction at the high or low of the first five-minute candle.
Conceptual Framework
This method is built around Smart Money Concepts and Inner Circle Trader principles. It aligns closely with first candle theory and candle range theory. If you understand ICT concepts, the logic behind this setup will be immediately familiar.
Strategy Type
This is a scalping system designed to be simple, repeatable, and effective on a daily basis. It is not about prediction, but about reacting to price within a clearly defined range.
Learning Path
To fully understand the background of this approach, study first candle theory and related ICT material on YouTube. This will help you see how and why the setup works across different market conditions.
Final Purpose
This algorithm was built to be accessible to everyone. The objective is consistency, discipline, and structure, with the long-term goal of helping traders work toward financial freedom through a clear and repeatable process.
Crypto Camp Day Key LevelsDaily key levels Daily key levels Daily key levels Daily key levels Daily key levels Daily key levels
EST Time Table//@version=6
indicator("EST Time Table", overlay = true)
// ─── Table Settings ─────────────────────────────────────────────
var table timeTable = table.new(
position.top_right,
1, 12,
border_width = 1
)
// ─── Header ────────────────────────────────────────────────────
if barstate.isfirst
table.cell(timeTable, 0, 0, "Time (EST)",
bgcolor = color.black,
text_color = color.white,
text_size = size.normal)
// ─── Time Rows ─────────────────────────────────────────────────
times = array.from(
"2:00 AM",
"6:00 AM",
"8:00 AM",
"8:30 AM",
"9:00 AM",
"9:30 AM",
"10:00 AM",
"11:00 AM",
"14:00 PM",
"19:00 PM",
"21:00 PM"
)
// ─── Fill Table ────────────────────────────────────────────────
for i = 0 to array.size(times) - 1
bg = i % 2 == 0 ? color.rgb(220, 220, 220) : color.white
table.cell(
timeTable,
0,
i + 1,
array.get(times, i),
bgcolor = bg,
text_color = color.black,
text_size = size.normal
)
Institutional Engine SAFEThis indicator is designed for traders who want to visualize institutional-level market execution patterns across multiple timeframes. It combines high-timeframe trend analysis, liquidity sweeps, fair value gaps (FVG), intermarket divergence (SMT), inverse FVGs, and change-in-state-of-delivery (CSID) to identify high-probability long and short setups.
Institutional Engine SAFEThe Institutional HTF → LTF Execution Engine is a multi-timeframe trading indicator designed to identify high-probability institutional-level entries by analyzing higher timeframe (HTF) trends and projecting them onto lower timeframe (LTF) charts.
This tool integrates trend analysis, liquidity sweeps, fair value gaps, intermarket divergence, and risk management to provide traders with actionable BUY and SELL signals. It is ideal for day traders, scalpers, and swing traders seeking structured entries aligned with larger market flow.
Crypto Accumulation Candle FinderThis indicator give you long entry signal to dectect MM's entry time.
it's recommended to use it in 5min. time frame.
eBacktesting: MultieBacktesting: Multi is an all-in-one chart toolkit built for structured day-trading study: multi-timeframe levels, “clean” movement zones, session context, bias, candle normalization, gaps, and a powerful alert system — all from one indicator.
What it can show on your chart
1) Multi-timeframe Support/Resistance (S/R) markup
- Detects and plots S/R levels from up to 8 configurable timeframes (mix HTF + LTF).
- Optional labeling styles: Simple, Type (S/R), or Directional.
- Optional price labels next to levels.
- Levels cleanup (decongestion): hides clustered levels to keep the chart readable
- Grouping: can group timeframes that share the same level into a single line.
- Level invalidation: levels can disappear after X passthroughs (with a “getting weaker” dashed style when close to invalidation).
2) Psychological levels (round numbers)
- Automatically draws round-number lines at a practical interval (with optional manual interval control).
- Has smart defaults for common markets (e.g., indices, BTC, metals).
3) Levels heatmap
- Shows level density as shaded “pressure areas”: areas where an agglomeration of S/R levels are present
- Can be simple or persisted (so you can study where price repeatedly reacts)
4) Repeated levels highlight
- Highlights “same area again” levels using a tolerance setting.
- Can require same direction (support with support / resistance with resistance) or allow any direction.
5) LTAs (Low Traffic Areas)
- Marks “air pockets” between levels where price can travel fast.
- Can be built from:
- S/R spacing (between detected levels), or
- Candle sequences (clean directional runs).
- Optional filters:
- By how “untouched” the boundary levels are (passthrough filter)
- By number of candles
- By size (points)
6) Clean zones (candle-based)
- Detects strong same-direction runs and boxes them as “clean zones” for study and backtesting practice.
7) Session Bias
- Computes a bias score from selected timeframes and shows it as a %.
- Can be weighted, inverted weight, or not weighted across timeframes (e.g. HTF candles having more weight towards bias calculation).
- Optional color coded “bias candles” overlay + option to dim weak candles so the signal is clearer.
- Alert when bias flips bullish/bearish/neutral.
8) Candles tools
- Smooth candles: removes candle gaps by drawing candles with open = previous close (useful for price action analysis).
- Ghost current candle: de-emphasizes the still-forming candle until it’s near completion (useful for not going in FOMO).
- Highlight no-wick candles: helps spot strong displacement / clean opens/closes.
- Snap candles: rounds candles to a chosen interval (ATR % or fixed), for cleaner structure reading.
- Optional candle stats: ATR & Average candle size
- Candle score: rates the last candle’s strength (body/wicks/size + context), useful for quick quality checks.
- Gaps: highlights unfilled gaps and optionally removes them once filled.
9) Sessions
- Up to 4 customizable sessions, each with its own color and optional background highlight.
- Option to hide candles outside session hours (great for focused session study).
10) Notifications
- Before session start alerts (X minutes early).
- Before session end alerts (X minutes early).
- Closing beyond detected S/R levels
- Closing beyond custom prices: type your prices (one per line)
- Proximity allowance + “advance notice” option for getting notified 30s/1m/5m before the candle closes based on your preferences
- Timer alerts (“check chart every X minutes”) with a custom message template.
eBacktesting integration (the important part)
This indicator fully integrates with the eBacktesting extension to automatically detect “important moments” during backtesting, so it can auto-pause, tag, and allow you to practice them step-by-step.
- When bias changed
- When a candle closed beyond an automatically detected S/R level
- When a candle closed beyond your custom price
- When new LTAs & clean zones are detected or invalidated
These indicator is built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
EMA distance forward returns.Use it to determine forward average returns based on a chosen percentage extension from a chosen EMA on the daily chart.
To exclude outliers I also made sure to include the median.
Let me know if you see any mistakes or if you have suggestions
MAGIC TRADER RANGE BOX 2.0//@version=6
indicator("MAGIC TRADER RANGE BOX 2.0", overlay=false
// ===== PARAMÈTRES =====
rangeLen = input.int(20, "Longueur Range H1", minval=5)
atrLen = input.int(14, "ATR H1")
atrFactor = input.float(1.0, "Facteur ATR", step=0.1)
maLen = input.int(20, "MA H1")
slopeLimit = input.float(0.05, "Tolérance direction", step=0.01)
// 🎨 STYLE BOÎTE
boxColor = input.color(color.gray, "Couleur de la boîte")
opacity = input.int(85, "Opacité (0-100)", minval=0, maxval=100)
borderColor = input.color(color.gray, "Couleur du contour")
// ===== DONNÉES H1 =====
= request.security(
syminfo.tickerid,
"60",
)
h1HH = request.security(syminfo.tickerid, "60", ta.highest(high, rangeLen))
h1LL = request.security(syminfo.tickerid, "60", ta.lowest(low, rangeLen))
h1ATR = request.security(syminfo.tickerid, "60", ta.atr(atrLen))
h1MA = request.security(syminfo.tickerid, "60", ta.sma(close, maLen))
h1Slope = math.abs(h1MA - h1MA )
// ===== CONDITIONS RANGE H1 =====
lowVol = (h1HH - h1LL) < h1ATR * atrFactor
noDir = h1Slope < slopeLimit
isH1Range = lowVol and noDir
// ===== BOÎTE =====
var box h1Box = na
if isH1Range and na(h1Box)
h1Box := box.new(
left = bar_index,
right = bar_index,
top = h1HH,
bottom = h1LL,
bgcolor = color.new(boxColor, opacity),
border_color = borderColor
)
if isH1Range and not na(h1Box)
box.set_right(h1Box, bar_index)
box.set_top(h1Box, h1HH)
box.set_bottom(h1Box, h1LL)
if not isH1Range and not na(h1Box)
h1Box := na
// ===== ALERTES =====
alertcondition(isH1Range,
title="Range H1 détecté",
message="📦 RANGE H1 détecté sur {{ticker}}")
alertcondition(close > h1HH,
title="Breakout H1 Haussier",
message="🚀 Breakout HAUSSIER du range H1 sur {{ticker}}")
alertcondition(close < h1LL,
title="Breakout H1 Baissier",
message="🔻 Breakout BAISSIER du range H1 sur {{ticker}}")






















