Holy Grail趋势追踪大师Trend Tracking Master - Multidimensional Trend Analysis Indicators
🎯 core functionality
Intelligent Trend Recognition System - Working collaboratively with multiple technical analysis tools to accurately capture market trend direction and intensity
📊 Technical Characteristics
1. Trend analysis of multi cycle EMA
Triple EMA arrangement: 21/55/144 period EMA long short arrangement recognition
Trend intensity quantification: Calculate the percentage of trend intensity based on EMA spacing
Multi time frame analysis: Simultaneously monitor the trend status of 1 minute, 15 minutes, and 1 hour
2. Bollinger Bands Trend Positioning
Price Position Analysis: Identifying the Relative Position of Prices in the Bollinger Bands
Trend breakthrough signal: above the upper track (strong bullish)/below the lower track (strong bearish)
Custom parameters: adjustable length, multiple, MA type, and offset
3. ZigZag trend structure
High and Low Point Recognition: Automatically marking important high and low points
Trend turning warning: HH, HL, LH, LL mode detection
Customizable parameters: depth, deviation, and rollback steps can be freely adjusted
4. Support resistance system
Dynamic horizontal line: 6-level support resistance network
Intelligent extension: automatically extend to the boundary of the chart
Real time update: dynamically adjusted with price changes
🚦 Trading signals
Long position signal
✅ EMA bullish alignment+price above Bollinger Bands=strong bullish
✅ Consistent bullish view in three time frames+high-intensity=trend confirmation
✅ ZigZag shows HH pattern=upward trend continues
Short signal
✅ EMA bearish alignment+price below Bollinger Bands=strong bearish
✅ Three time frame consistent bearish+high-intensity=trend confirmation
✅ ZigZag shows LL pattern=downward trend continues
📈 Visual Display
Dashboard interface
Trend Status Panel: Real time display of trend directions across multiple time frames
Intensity rating: Weak/Medium/Strong Level 3 evaluation
Signal prompt: intuitive color coded signal identification
Chart overlay
Color EMA tape: Different colors distinguish fast and slow cycle EMA
Bollinger Bands Fill: Translucent Fill Enhances Visual Hierarchy
ZigZag Connection: Clear Display of Price Fluctuations Structure
⚙️ Custom Settings
parameter adjustment
EMA cycle: Fully customizable main and additional EMA lengths
Bollinger Bands Settings: Flexible Configuration of Length, Multiply, Source Value, and MA Type
ZigZag sensitivity: fine adjustment of depth, deviation, and rollback steps
Visual Style: All colors, line widths, and transparency can be customized
display control
Modular switch: independently controls the display/hide of each component
K-line quantity limit: optimize performance and avoid chart overload
Tag quantity management: Automatically clear old tags and keep charts clean
🎖️ Core strengths
Intelligent Analysis
Multidimensional trend confirmation to reduce false signals
Quantify trend intensity to avoid subjective judgments
Collaborative analysis across time frames to improve accuracy
Practical performance
Real time calculation, fast response
Resource optimization, stable operation
Intuitive interface, clear at a glance
Flexible adaptation
Suitable for various trading varieties
Compatible with different time frames
Adjustable parameters to adapt to different market environments
📋 Applicable scenarios
Trend tracking trading: Identify and follow the main trend direction
Trend reversal warning: Capture early signals of trend structure changes
Position management: Adjust position size based on trend intensity
Multi time analysis: simultaneously monitoring the trend status of different time frames
This indicator provides traders with a complete set of trend analysis tools to help them make wiser trading decisions in complex market environments.
Grafik Desenleri
3-Candle Reversal Pattern-vahid2star3-Candle Reversal Zones + Hammer Confirmation (with Risk Management & Alerts)
This script combines 3-candle reversal detection, hammer confirmations, and smart demand/supply zone plotting into a single tool designed for both discretionary and automated traders.
🔍 Core Logic
3-Candle Reversal Pattern
Candle-1: Strong move in one direction (big body).
Candle-2: Doji-like candle (high shadow/body ratio).
Candle-3: Reversal candle in the opposite direction (large body relative to Candle-2).
A gap after Candle-3 is required for extra confirmation.
Hammer Confirmation (Hammer-1 & Hammer-2)
After a valid 3-candle setup, the script searches for a hammer pattern near the zone.
Hammer-1: Draws a box directly on the hammer range if followed by a strong confirming candle.
Hammer-2: If another hammer forms after the confirmation candle and holds for N bars (configurable), a second hammer box is drawn.
Demand & Supply Zones
For bullish setups, a demand zone is created from the Candle-2 low to the Candle-1 low.
For bearish setups, a supply zone is created from the Candle-2 high to the Candle-1 high.
Zones extend to the right until price interacts with them.
🛠 Filters & Quality Controls
Trend filter (optional):
Only draw zones if price respects higher-timeframe EMA200 slope and LTF EMA alignment.
Market structure filter:
Require higher-high / higher-low (for bullish) or lower-high / lower-low (for bearish).
ATR filter:
Zones must have a minimum height relative to ATR.
Overlap control:
Avoid drawing zones that overlap too heavily with existing ones.
Cooldown:
Restrict consecutive zones of the same type within a user-defined bar distance.
🎯 Risk Management & Strategy
Dynamic position sizing:
Trade size is automatically calculated from account equity, risk %, and leverage.
Stop-loss & Take-profit:
SL placed just beyond the zone ± buffer ticks.
TP automatically set at user-defined Reward:Risk ratio (e.g., 3:1).
Capital protection:
Trades respect max leverage and risk per position settings.
⚡ Alerts
The script provides one-time alerts for each zone:
🔔 First Touch Alert → Triggered when price first touches a demand, supply, or hammer box.
Each zone only fires one alert, avoiding duplicates on re-touch or trade exit.
📊 Visuals
Demand zones: Green boxes.
Supply zones: Red boxes.
Hammer boxes: Blue (bullish) / Orange (bearish).
Used zones: Greyed out after price fills them.
Outcomes: Zones change to green if TP is hit, red if SL is hit.
Optional labels mark “Bullish zone ✓”, “Bearish zone ✓”, “Hammer-1 ✓”, or “Hammer-2 ✓” when confirmed.
🔧 Settings Overview
Core pattern ratios (C1/C2, C3/C2 size multipliers).
Doji definition (shadow/body ratio).
Hammer search depth, confirmation delay, and strictness.
Risk % per trade, leverage cap, stop buffer, RR ratio.
Visual styling (colors, max box count, labels).
Trend, structure, ATR, overlap, and cooldown filters.
Option to disable orders (use as indicator + alerts only).
⚠️ Disclaimer
This script is a technical analysis tool intended for educational purposes.
It does not guarantee profits. Use proper risk management and test thoroughly before applying in live trading.
✨ With its combination of 3-candle reversals, hammer confirmations, and smart filtering, this script is designed to reduce noise, highlight high-probability zones, and give traders both visual structure and actionable alerts.
ORB Breakouts with alerts"ORB Breakouts with Alerts" is a utility indicator that highlights an Opening Range Breakout (ORB) setup during a user-defined intraday time window. It allows traders to visualize price consolidation ranges and receive alerts when price breaks above or below the session high/low.
🔧 Features:
*Customizable session time (start and end), adjustable to local time using a timezone offset.
*Automatically plots:
*A shaded box around the session's high and low.
*Horizontal lines at session high and low levels.
*Optional "BUY"/"SELL" labels to mark breakout directions.
*Visual breakout signals when price crosses above or below the session range.
*Built-in alerts to notify when breakouts occur.
*Configurable styling options including box color, highlight color, and label placement.
⚙️ How It Works:
*During the defined time range, the script tracks the highest high and lowest low.
*After the session ends:
*A box is drawn to represent the opening range.
*Breakouts above the high or below the low trigger visual markers and optional alerts.
*Alerts are limited to one per direction per day to reduce noise.
⚠️ This indicator is a technical analysis tool only and does not provide financial advice or trade recommendations. Always use with proper risk management and in conjunction with your trading plan.
Custom Screener Score (MACD atan-slope + RSI + BB)MACD atan-slope + RSI + crossover
also added decay from crossover
Untouched ExtremesWhat it is
Untouched Extremes plots horizontal levels at green-candle highs and red-candle lows. Each level is considered “untouched” (clean liquidity) until price revisits it; on the first valid touch the line auto-deletes, keeping only live targets on your chart.
How it works (logic)
Bar close event
If close > open, the script draws a line at that bar’s high and extends it to the right.
If close < open, it draws a line at that bar’s low and extends it to the right.
(Optional) Perfect/almost-dojis can be classified as green or red via settings.
Touch & removal
A green-high line is removed when any later bar’s high ≥ level (optionally within a tick tolerance).
A red-low line is removed when any later bar’s low ≤ level (optionally within a tick tolerance).
You can delay deletion by N bars to make the touch visible before the line disappears.
Housekeeping
Maximum active lines per side and line styling are user-configurable.
Why it’s useful
Untouched highs/lows often coincide with resting liquidity and incomplete price probes. Tracking them helps:
Define targets and magnets price may seek.
Frame mean-reversion rotations after a failed push.
Keep the chart clean: only levels that have not been traded are displayed.
How to use it (trading idea)
Confirmation rule: Treat the line as a level/zone. Price can pierce it; wait for a clear reversal candle pattern (e.g., pin bar, engulfing, strong momentum shift) at or immediately after the touch.
Directional play:
If a bullish reversal pattern forms at/around a red-low line, the working assumption is that price will move toward the first untouched upper line (nearest green-high line above). Many traders use that as the primary target.
Conversely, if a bearish reversal pattern forms at/around a green-high line, expect rotation toward the first untouched lower line.
Risk management: Stops typically go just beyond the level or beyond the pattern’s wick. Consider a fixed R:R (e.g., 1:2) and partials at intermediate levels.
Settings
Doji handling: Choose how to classify close ≈ open bars (Green / Red / Ignore). A small equality margin (ticks) helps with rounding on some symbols.
Touch tolerance (ticks): Counts near-misses as touches if desired.
Deletion delay (bars): Wait N bars after creation before a line becomes eligible for deletion.
Max lines per side / width / colors: Keep the view readable.
Tips
Works on any symbol/timeframe; lower TFs produce more levels—adjust Max lines accordingly.
Combining with a trend filter (e.g., EMA-200), ATR distance, or volume clues can improve selectivity.
If spreads or wicks are noisy, increase tolerance slightly and/or use deletion delay to visualize touches.
Note: This tool provides structure and potential targets, not signals by itself. Always require your reversal pattern as confirmation and manage risk appropriately.
RTP11//@version=6
indicator("RTP11", overlay=true, scale=scale.right, max_lines_count=500, max_labels_count=500, max_boxes_count=500, max_bars_back=5000)
//──────────────────────────────── Inputs: Masked Names ───────────────────────────────
// yelow group (EMA200 + 5up/5down)
group200 = "yelow group"
emaLen200 = input.int(200, "yelow length", minval=1, group=group200)
show200Mid = input.bool(true, "show big brown", group=group200) // EMA200 mid
show200_5u = input.bool(true, "show yelow group up", group=group200) // 5up (EMA200)
show200_5d = input.bool(true, "show yelow group down",group=group200) // 5down (EMA200)
// Colors (masked)
groupClrMA = "Colors — lines"
colMid200 = input.color(color.rgb(100, 50, 0), "big brown", group=groupClrMA) // EMA200 mid
col5band = input.color(color.rgb(200,170, 0), "yelow up/down", group=groupClrMA) // 5up/5down
col85_4 = input.color(color.rgb(90,140,230), "blue up/down (x4)",group=groupClrMA) // EMA85 4up/4down
col35 = input.color(color.blue, "big blue", group=groupClrMA) // EMA35
colPNR = input.color(color.rgb(255,17,0), "pn", group=groupClrMA) // PNR
// blue group (EMA85 — 4 up/down)
group85 = "blue group"
emaLen85 = input.int(85, "blue length", minval=1, group=group85)
show85_4u = input.bool(true, "show blue group up", group=group85)
show85_4d = input.bool(true, "show blue group down", group=group85)
// big blue (EMA35)
group35 = "big blue"
emaLen35 = input.int(35, "big blue length", minval=1, group=group35)
useClose35 = input.bool(false, "big blue use close (else effClose)", group=group35)
showEMA35 = input.bool(true, "show big blue", group=group35)
// pn (PNR)
groupPNR = "pn"
pnrLen = input.int(15, "window size", minval=1, group=groupPNR)
pnrPerc = input.int(50, "percentile (0–100)", minval=0, maxval=100, group=groupPNR)
pnrSrc = input.source(close, "source", group=groupPNR)
showPNR = input.bool(true, "show pn", group=groupPNR)
// di (DSI)
groupDSI = "di"
showDSI = input.bool(true, "show di", group=groupDSI)
atrMovement= input.float(1.0, "ATR movement required", step=0.5, group=groupDSI)
lookback = input.int(25, "high/low lookback", step=5, group=groupDSI)
maxZoneSize= input.float(2.5, "max zone size (ATR multiple)", step=0.5, group=groupDSI)
newStructureReset = input.int(25, "zone update count before reset", step=5, group=groupDSI)
drawPreviousStructure = input.bool(true, "draw previous zones", group=groupDSI)
groupClrDSI = "Colors — zones"
dsiBullColor = input.color(color.green, "bull color", group=groupClrDSI)
dsiBearColor = input.color(color.red, "bear color", group=groupClrDSI)
//──────────────────────────────── FE (Trend-base Fibo) ───────────────────────────────
groupFE = "targets — FE"
feLenBars = input.int(35, "FE length (bars) from P3", minval=5, group=groupFE)
feLife = input.int(500, "FE lifespan (bars) before delete", minval=50, group=groupFE)
showFE = input.bool(true, "show FE", group=groupFE)
roundToTick = input.bool(true, "round FE to tick", group=groupFE)
// FE levels on/off
show95_105 = input.bool(true, "show 95/105 band", group=groupFE)
show1618 = input.bool(true, "show 161.8", group=groupFE)
show2618 = input.bool(true, "show 261.8", group=groupFE)
show3618 = input.bool(true, "show 361.8", group=groupFE) // NEW
show4618 = input.bool(true, "show 461.8", group=groupFE) // NEW
// FE colors
colBand = input.color(color.teal, "95/105 line", group=groupFE)
colBandFill = input.color(color.new(color.teal, 85), "95–105 band", group=groupFE)
col1618 = input.color(color.orange, "161.8 line", group=groupFE)
col2618 = input.color(color.fuchsia, "261.8 line", group=groupFE)
col3618 = input.color(color.new(color.purple, 0), "361.8 line", group=groupFE)
col4618 = input.color(color.new(color.maroon, 0), "461.8 line", group=groupFE)
//──────────────────────────────── P-series (เดิม) ───────────────────────────────
groupP1P2P3 = "P-series options"
p1Lookback = input.int(200, "P1 max left scan", minval=20, group=groupP1P2P3)
rightWinBars = input.int(5, "P2 right confirm bars", minval=1, group=groupP1P2P3)
p3MaxWindowBars = input.int(600, "P3 max window (bars)", minval=50, maxval=5000, step=50, group=groupP1P2P3)
resetWithinBars = input.int(50, "reset old set if new within (bars)", minval=1, group=groupP1P2P3)
//──────────────────────────────── Visual options ───────────────────────────────
groupPviz = "Visual — Body highlights & labels"
showBodyBoxes = input.bool(true, "show body boxes", group=groupPviz)
P1BoxFullCandle = input.bool(false, "P1: full candle box", group=groupPviz)
P2BoxFullCandle = input.bool(false, "P2: full candle box", group=groupPviz)
P3BoxFullCandle = input.bool(false, "P3: full candle box", group=groupPviz)
P1BoxColor = input.color(color.black, "P1 box color", group=groupPviz)
P1BoxFillTransp = input.int(85, "P1 box fill transp", minval=0, maxval=100, group=groupPviz)
P2BoxColor = input.color(color.lime, "P2 box color", group=groupPviz)
P2BoxFillTransp = input.int(70, "P2 box fill transp", minval=0, maxval=100, group=groupPviz)
P3BoxColor = input.color(color.orange, "P3 box color", group=groupPviz)
P3BoxFillTransp = input.int(70, "P3 box fill transp", minval=0, maxval=100, group=groupPviz)
BoxBorderTransp = input.int(0, "box border transp", minval=0, maxval=100, group=groupPviz)
recolorBars = input.bool(true, "barcolor P1/P2/P3", group=groupPviz)
colP1Candle = input.color(color.black, "P1 candle", group=groupPviz)
colP2Candle = input.color(color.lime, "P2 candle", group=groupPviz)
colP3Candle = input.color(color.orange,"P3 candle", group=groupPviz)
showP1Label = input.bool(true, "show P1 label", group=groupPviz)
showP2Label = input.bool(true, "show P2 label", group=groupPviz)
showP3Label = input.bool(true, "show P3 label", group=groupPviz)
PLabelTextColor = input.color(color.white, "label text color", group=groupPviz)
PLabelBgColor = input.color(color.black, "label bg color", group=groupPviz)
// ── Label placement/offset (split LONG/SHORT) ───────────────────────────────
groupLbl = "Labels — placement"
LP_AUTO = "Auto"
LP_ABOVE = "Above"
LP_BELOW = "Below"
OM_TICKS = "Ticks"
OM_ATR = "ATR"
lblPlaceLong = input.string(LP_ABOVE, "Placement (LONG)", options= , group=groupLbl)
lblPlaceShort = input.string(LP_BELOW, "Placement (SHORT)", options= , group=groupLbl)
lblOffsetMet = input.string(OM_ATR, "Offset method", options= , group=groupLbl)
lblTicks = input.int(5, "Ticks offset", minval=0, group=groupLbl)
lblAtrLen = input.int(14, "ATR length", minval=1, group=groupLbl)
lblAtrMult = input.float(0.25, "ATR multiple", minval=0.0, step=0.05, group=groupLbl)
lblSizeSel = input.string("small", "Label size", options= , group=groupLbl)
lblBgTransp = input.int(0, "Label BG transparency", minval=0, maxval=100, group=groupLbl)
//──────────────────────────────── Manual (แทน Override) ─────────────────────────
PM_OPEN = "Open"
PM_CLOSE = "Close"
PM_MID = "Mid"
PM_HIGH = "High"
PM_LOW = "Low"
PM_CUST = "Custom"
PK_TIME = "Time"
PK_OFF = "Offset"
// LONG
groupManL = "Manual (LONG)"
useManP1L = input.bool(false, "Use P1 manual (L)", group=groupManL)
pickP1L = input.string(PK_TIME, "P1 pick mode (L)", options= , group=groupManL)
manP1L_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P1 time (L)", group=groupManL)
manP1L_of = input.int(-5, "P1 offset (bars, L)", group=groupManL)
pmP1L = input.string(PM_OPEN, "P1 price mode (L)", options= , group=groupManL)
p1L_custom= input.float(0.0, "P1 custom price (L)", group=groupManL)
useManP2L = input.bool(false, "Use P2 manual (L)", group=groupManL)
pickP2L = input.string(PK_TIME, "P2 pick mode (L)", options= , group=groupManL)
manP2L_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P2 time (L)", group=groupManL)
manP2L_of = input.int(-3, "P2 offset (bars, L)", group=groupManL)
pmP2L = input.string(PM_CLOSE, "P2 price mode (L)", options= , group=groupManL)
p2L_custom= input.float(0.0, "P2 custom price (L)", group=groupManL)
useManP3L = input.bool(false, "Use P3 manual (L)", group=groupManL)
pickP3L = input.string(PK_TIME, "P3 pick mode (L)", options= , group=groupManL)
manP3L_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P3 time (L)", group=groupManL)
manP3L_of = input.int(-1, "P3 offset (bars, L)", group=groupManL)
pmP3L = input.string(PM_OPEN, "P3 price mode (L)", options= , group=groupManL)
p3L_custom= input.float(0.0, "P3 custom price (L)", group=groupManL)
// SHORT
groupManS = "Manual (SHORT)"
useManP1S = input.bool(false, "Use P1 manual (S)", group=groupManS)
pickP1S = input.string(PK_TIME, "P1 pick mode (S)", options= , group=groupManS)
manP1S_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P1 time (S)", group=groupManS)
manP1S_of = input.int(-5, "P1 offset (bars, S)", group=groupManS)
pmP1S = input.string(PM_OPEN, "P1 price mode (S)", options= , group=groupManS)
p1S_custom= input.float(0.0, "P1 custom price (S)", group=groupManS)
useManP2S = input.bool(false, "Use P2 manual (S)", group=groupManS)
pickP2S = input.string(PK_TIME, "P2 pick mode (S)", options= , group=groupManS)
manP2S_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P2 time (S)", group=groupManS)
manP2S_of = input.int(-3, "P2 offset (bars, S)", group=groupManS)
pmP2S = input.string(PM_CLOSE, "P2 price mode (S)", options= , group=groupManS)
p2S_custom= input.float(0.0, "P2 custom price (S)", group=groupManS)
useManP3S = input.bool(false, "Use P3 manual (S)", group=groupManS)
pickP3S = input.string(PK_TIME, "P3 pick mode (S)", options= , group=groupManS)
manP3S_t = input.time(timestamp("01 Jan 2024 00:00 +0000"), "P3 time (S)", group=groupManS)
manP3S_of = input.int(-1, "P3 offset (bars, S)", group=groupManS)
pmP3S = input.string(PM_OPEN, "P3 price mode (S)", options= , group=groupManS)
p3S_custom= input.float(0.0, "P3 custom price (S)", group=groupManS)
// Buttons: Reset (UI switches)
groupBtnL = "Manual Controls — Buttons (LONG)"
btnResetAllL = input.bool(false, "Reset ALL manual (L)", group=groupBtnL)
btnResetP1L = input.bool(false, "Reset P1 manual (L)", group=groupBtnL)
btnResetP2L = input.bool(false, "Reset P2 manual (L)", group=groupBtnL)
btnResetP3L = input.bool(false, "Reset P3 manual (L)", group=groupBtnL)
groupBtnS = "Manual Controls — Buttons (SHORT)"
btnResetAllS = input.bool(false, "Reset ALL manual (S)", group=groupBtnS)
btnResetP1S = input.bool(false, "Reset P1 manual (S)", group=groupBtnS)
btnResetP2S = input.bool(false, "Reset P2 manual (S)", group=groupBtnS)
btnResetP3S = input.bool(false, "Reset P3 manual (S)", group=groupBtnS)
// ── Momentary Reset (edge-detect) ───────────────────────────────
var bool resetReqAllL = false
var bool resetReqP1L = false
var bool resetReqP2L = false
var bool resetReqP3L = false
var bool resetReqAllS = false
var bool resetReqP1S = false
var bool resetReqP2S = false
var bool resetReqP3S = false
bool fireAllL = ta.change(btnResetAllL) and btnResetAllL
bool fireP1L = ta.change(btnResetP1L) and btnResetP1L
bool fireP2L = ta.change(btnResetP2L) and btnResetP2L
bool fireP3L = ta.change(btnResetP3L) and btnResetP3L
bool fireAllS = ta.change(btnResetAllS) and btnResetAllS
bool fireP1S = ta.change(btnResetP1S) and btnResetP1S
bool fireP2S = ta.change(btnResetP2S) and btnResetP2S
bool fireP3S = ta.change(btnResetP3S) and btnResetP3S
if fireAllL
resetReqAllL := true
resetReqP1L := true
resetReqP2L := true
resetReqP3L := true
if fireP1L
resetReqP1L := true
if fireP2L
resetReqP2L := true
if fireP3L
resetReqP3L := true
if fireAllS
resetReqAllS := true
resetReqP1S := true
resetReqP2S := true
resetReqP3S := true
if fireP1S
resetReqP1S := true
if fireP2S
resetReqP2S := true
if fireP3S
resetReqP3S := true
//──────────────────────────────── Core helpers ───────────────────────────────
float effClose = close >= open ? math.max(open, close) : math.min(open, close)
f_bodyTop(_o, _c) => math.max(_o, _c)
f_bodyBot(_o, _c) => math.min(_o, _c)
f_midBody_at(_i) =>
float bt = f_bodyTop(open , close )
float bb = f_bodyBot(open , close )
(bt + bb) / 2.0
f_core(_len) =>
float mid = ta.ema(effClose, _len)
float _dev = ta.stdev(effClose, _len)
float devS = _dev == 0.0 ? na : _dev
float plus = na(mid) or na(devS) ? na : (close > mid ? (close - mid) / devS : 0.0)
float minus = na(mid) or na(devS) ? na : (close < mid ? (mid - close) / devS : 0.0)
float mmax = na(plus) or na(minus) ? na : math.max(plus, minus)
float lm = ta.ema(mmax, _len)
f_core_src(_src, _len) =>
float mid = ta.ema(_src, _len)
float _dev = ta.stdev(_src, _len)
float devS = _dev == 0.0 ? na : _dev
float plus = na(mid) or na(devS) ? na : (_src > mid ? (_src - mid) / devS : 0.0)
float minus = na(mid) or na(devS) ? na : (_src < mid ? (mid - _src) / devS : 0.0)
float mmax = na(plus) or na(minus) ? na : math.max(plus, minus)
float lm = ta.ema(mmax, _len)
// Price by mode
f_price_by_mode(off, mode, custom) =>
switch mode
PM_OPEN => open
PM_CLOSE => close
PM_MID => (math.max(open , close ) + math.min(open , close ))/2.0
PM_HIGH => high
PM_LOW => low
PM_CUST => custom > 0 ? (roundToTick ? math.round(custom / syminfo.mintick) * syminfo.mintick : custom) : na
=> na
//──────────────────────────────── yelow group (EMA200 + 5up/5down) ───────────────────
= f_core_src(close, emaLen200)
phi_adj = 1.38196601
float fiveUp_200 = na(mid200) or na(dev200) or na(lm200) ? na : mid200 + (lm200 * phi_adj) * dev200
float fiveDown_200 = na(mid200) or na(dev200) or na(lm200) ? na : mid200 - (lm200 * phi_adj) * dev200
plot(show200_5d ? fiveDown_200 : na, title="yelow group down", color=col5band, linewidth=3)
plot(show200Mid ? mid200 : na, title="big brown", color=colMid200, linewidth=3)
plot(show200_5u ? fiveUp_200 : na, title="yelow group up", color=col5band, linewidth=3)
//──────────────────────────────── blue group (EMA85 — 4 up/down) ────────────────────
= f_core(emaLen85)
float up4_85 = na(mid85) or na(dev85) or na(lm85) ? na : mid85 + lm85 * dev85
float down4_85 = na(mid85) or na(dev85) or na(lm85) ? na : mid85 - lm85 * dev85
float fiveUp_85 = na(mid85) or na(dev85) or na(lm85) ? na : mid85 + (lm85 * phi_adj) * dev85
float fiveDown_85 = na(mid85) or na(dev85) or na(lm85) ? na : mid85 - (lm85 * phi_adj) * dev85
plot(show85_4u ? up4_85 : na, title="blue group up", color=col85_4, linewidth=2)
plot(show85_4d ? down4_85 : na, title="blue group down", color=col85_4, linewidth=2)
// big blue (EMA35)
float ema35 = useClose35 ? ta.ema(close, emaLen35) : ta.ema(effClose, emaLen35)
plot(showEMA35 ? ema35 : na, title="big blue", color=col35, linewidth=2)
// pn (PNR)
float pnr = na
if bar_index >= pnrLen - 1
float win = array.new_float()
for i = 0 to pnrLen - 1
array.push(win, pnrSrc )
array.sort(win)
float rankF = (pnrPerc / 100.0) * (pnrLen - 1)
int idx = int(math.round(rankF))
idx := math.max(0, math.min(idx, pnrLen - 1))
pnr := array.get(win, idx)
plot(showPNR ? pnr : na, title="pn", color=colPNR, linewidth=2)
//──────────────────────────────── Utilities ───────────────────────────────
isGreen_at(i) => close > open
isRed_at(i) => close < open
bodyTop_at(i) => f_bodyTop(open , close )
bodyBot_at(i) => f_bodyBot(open , close )
f_frac_body_above_line(i, lineV) =>
float bt = bodyTop_at(i), bb = f_bodyBot(open , close )
float body = bt - bb
body <= 0 or na(lineV) ? 0.0 : math.max(0.0, bt - math.max(bb, lineV)) / body
f_frac_body_below_line(i, lineV) =>
float bt = bodyTop_at(i), bb = f_bodyBot(open , close )
float body = bt - bb
body <= 0 or na(lineV) ? 0.0 : math.max(0.0, math.min(bt, lineV) - bb) / body
// Draw helpers
var box PBOXES = array.new_box()
var label PLABELS = array.new_label()
f_delete_boxes(box arr) =>
int n = array.size(arr)
for k = 0 to n - 1
int i = n - 1 - k
box.delete(array.get(arr, i))
array.clear(arr)
f_delete_labels(label arr) =>
int n = array.size(arr)
for k = 0 to n - 1
int i = n - 1 - k
label.delete(array.get(arr, i))
array.clear(arr)
// size mapper
f_lbl_size(s) =>
s == "tiny" ? size.tiny : s == "large" ? size.large : s == "normal" ? size.normal : size.small
// helper: one-line label.new (กัน syntax error)
f_make_label(_x, _y, _text, _placeAbove) =>
label.new(_x, _y, _text, xloc=xloc.bar_time, style=(_placeAbove ? label.style_label_down : label.style_label_up), textcolor=PLabelTextColor, color=color.new(PLabelBgColor, lblBgTransp), size=f_lbl_size(lblSizeSel))
// ── smarter label placement (split LONG/SHORT)
f_add_label_ret(_abs, _text, _isLong) =>
label lb = na
int off = bar_index - _abs
if off >= 0 and off <= 5000 and not na(time ) and not na(high ) and not na(low )
float pad = lblOffsetMet == OM_TICKS ? (syminfo.mintick * lblTicks) : (ta.atr(lblAtrLen) * lblAtrMult)
string opt = _isLong ? lblPlaceLong : lblPlaceShort
bool placeAbove = (opt == LP_ABOVE) ? true : (opt == LP_BELOW) ? false : (close >= open )
float yPos = placeAbove ? (high + pad) : (low - pad)
lb := f_make_label(time , yPos, _text, placeAbove)
array.push(PLABELS, lb)
if array.size(PLABELS) > 500
label.delete(array.get(PLABELS, 0))
array.remove(PLABELS, 0)
lb
f_draw_mark_group(_abs, _full, _boxCol, _fillT, _borderT, _labelOn, _labelText, _isLong) =>
if not na(_abs)
int off = bar_index - _abs
if off >= 0 and off <= 5000
float top = _full ? high : bodyTop_at(off)
float bot = _full ? low : f_bodyBot(open , close )
box nb = na
if showBodyBoxes
nb := box.new(math.max(0, int(_abs) - 1), math.max(top, bot), int(_abs), math.min(top, bot), xloc=xloc.bar_index, bgcolor=color.new(_boxCol, _fillT), border_color=color.new(_boxCol, _borderT))
array.push(PBOXES, nb)
if array.size(PBOXES) > 500
box.delete(array.get(PBOXES, 0))
array.remove(PBOXES, 0)
if _labelOn
f_add_label_ret(_abs, _labelText, _isLong)
//──────────────────────────────── FE helpers ───────────────────────────────
f_rt(v) => roundToTick ? math.round(v / syminfo.mintick) * syminfo.mintick : v
var line FE_l95 = array.new_line()
var line FE_l105 = array.new_line()
var line FE_l161 = array.new_line()
var line FE_l261 = array.new_line()
var line FE_l361 = array.new_line()
var line FE_l461 = array.new_line()
var linefill FE_fill = array.new_linefill()
var int FE_born = array.new_int()
f_delete_fe_index(idx) =>
int nAll = array.size(FE_born)
if idx >= 0 and idx < nAll
if idx < array.size(FE_fill)
linefill.delete(array.get(FE_fill, idx))
if idx < array.size(FE_l95)
line.delete(array.get(FE_l95, idx))
if idx < array.size(FE_l105)
line.delete(array.get(FE_l105, idx))
if idx < array.size(FE_l161)
line.delete(array.get(FE_l161, idx))
if idx < array.size(FE_l261)
line.delete(array.get(FE_l261, idx))
if idx < array.size(FE_l361)
line.delete(array.get(FE_l361, idx))
if idx < array.size(FE_l461)
line.delete(array.get(FE_l461, idx))
if idx < array.size(FE_l95)
array.remove(FE_l95, idx)
if idx < array.size(FE_l105)
array.remove(FE_l105, idx)
if idx < array.size(FE_l161)
array.remove(FE_l161, idx)
if idx < array.size(FE_l261)
array.remove(FE_l261, idx)
if idx < array.size(FE_l361)
array.remove(FE_l361, idx)
if idx < array.size(FE_l461)
array.remove(FE_l461, idx)
if idx < array.size(FE_fill)
array.remove(FE_fill, idx)
array.remove(FE_born, idx)
f_clear_all_fe() =>
int n = array.size(FE_born)
for k = 0 to n - 1
int i = n - 1 - k
f_delete_fe_index(i)
f_add_fe_set(p3Abs, y95, y105, y161, y261, y361, y461) =>
int x1 = p3Abs, x2 = p3Abs + feLenBars
color c95 = show95_105 ? colBand : color.new(colBand, 100)
color c105 = show95_105 ? colBand : color.new(colBand, 100)
color c161 = show1618 ? col1618 : color.new(col1618, 100)
color c261 = show2618 ? col2618 : color.new(col2618, 100)
color c361 = show3618 ? col3618 : color.new(col3618, 100)
color c461 = show4618 ? col4618 : color.new(col4618, 100)
line l95 = line.new(x1, y95, x2, y95, xloc=xloc.bar_index, extend=extend.none, color=c95, width=3)
line l105 = line.new(x1, y105, x2, y105, xloc=xloc.bar_index, extend=extend.none, color=c105, width=3)
line l161 = line.new(x1, y161, x2, y161, xloc=xloc.bar_index, extend=extend.none, color=c161, width=2)
line l261 = line.new(x1, y261, x2, y261, xloc=xloc.bar_index, extend=extend.none, color=c261, width=2)
line l361 = line.new(x1, y361, x2, y361, xloc=xloc.bar_index, extend=extend.none, color=c361, width=2)
line l461 = line.new(x1, y461, x2, y461, xloc=xloc.bar_index, extend=extend.none, color=c461, width=2)
linefill lf = linefill.new(l95, l105, color= show95_105 ? colBandFill : color.new(color.black, 100))
array.push(FE_l95, l95)
array.push(FE_l105, l105)
array.push(FE_l161, l161)
array.push(FE_l261, l261)
array.push(FE_l361, l361)
array.push(FE_l461, l461)
array.push(FE_fill, lf)
array.push(FE_born, bar_index)
// Snap by time (int-safe diff)
f_find_abs_by_time(t) =>
int bestAbs = na
if na(t)
na
else
int maxBack = math.min(5000, bar_index)
int bestDiff = 1000000000
for i = 0 to maxBack
int ti = time
int diff = ti > t ? (ti - t) : (t - ti)
if diff < bestDiff
bestDiff := diff
bestAbs := bar_index - i
bestAbs
//──────────────────────────────── P3 picker (แบบเดิม/คลาสสิก) ─────────────────────
f_pickP3_abs(sAbs, eAbs, isLong) =>
if na(sAbs) or na(eAbs)
else
int eInit = math.min(eAbs, bar_index)
int sInit = sAbs
int s = math.max(sInit, bar_index - 10000)
int e = eInit
if s > e
else
float levels = array.new_float()
int counts = array.new_int()
int firstI = array.new_int()
int maxRun = array.new_int()
float prevBin = na
int curRun = 0
float minLowGreen = 1e100
int minLowGreenI = na
float minLowRed = 1e100
int minLowRedI = na
float minLowAll = 1e100
int minLowAllI = na
float maxHighRed = -1e100
int maxHighRedI = na
float maxHighGreen = -1e100
int maxHighGreenI= na
float maxHighAll = -1e100
int maxHighAllI = na
for t = s to e
int tOff = bar_index - t
if tOff < 0 or tOff > 10000
continue
float bin = math.round(open / syminfo.mintick) * syminfo.mintick
int idx = array.indexof(levels, bin)
if idx == -1
array.push(levels, bin)
array.push(counts, 1)
array.push(firstI, t)
array.push(maxRun, 1)
curRun := 1
else
array.set(counts, idx, array.get(counts, idx) + 1)
if not na(prevBin) and bin == prevBin
curRun += 1
else
curRun := 1
int prevMax = array.get(maxRun, idx)
if curRun > prevMax
array.set(maxRun, idx, curRun)
prevBin := bin
bool g = close > open
bool r = close < open
if g and low < minLowGreen
minLowGreen := low
minLowGreenI := t
if r and low < minLowRed
minLowRed := low
minLowRedI := t
if low < minLowAll
minLowAll := low
minLowAllI := t
if r and high > maxHighRed
maxHighRed := high
maxHighRedI := t
if g and high > maxHighGreen
maxHighGreen := high
maxHighGreenI:= t
if high > maxHighAll
maxHighAll := high
maxHighAllI := t
int needCnt = 2
int best = -1, bestCnt = 0, bestRun = 0, bestFirst = 1000000000
int L = array.size(levels)
if L > 0
for m = 0 to L - 1
int c = array.get(counts, m)
if c >= needCnt
int r = array.get(maxRun, m)
int f = array.get(firstI, m)
if c > bestCnt or (c == bestCnt and (r > bestRun or (r == bestRun and f < bestFirst)))
best := m
bestCnt := c
bestRun := r
bestFirst := f
if best != -1
int pickAbs = array.get(firstI, best)
float pickPx = array.get(levels, best)
else
if isLong
bool redIsGlobalMin = not na(minLowRedI) and (minLowRed <= minLowAll + 0.0)
if redIsGlobalMin
int offR = bar_index - minLowRedI
[close , minLowRedI]
else
int useAbs = na(minLowGreenI) ? minLowAllI : minLowGreenI
int offU = bar_index - useAbs
[open , useAbs]
else
bool greenIsGlobalMax = not na(maxHighGreenI) and (maxHighGreen >= maxHighAll - 0.0)
if greenIsGlobalMax
int offG = bar_index - maxHighGreenI
[close , maxHighGreenI]
else
int useAbsS = na(maxHighRedI) ? maxHighAllI : maxHighRedI
int offS = bar_index - useAbsS
[open , useAbsS]
//──────────────────────────────── P1/P2/P3 (Auto; state) ────────────────
// LONG state vars
var int L_P1Abs = na
var int L_P2Abs = na
var int L_P3Abs = na
var int L_winOpenAbs = na
var float L_P1Open = na
var float L_P2Close = na
var float L_P3Px = na
var float L_P2_bodyTop = na
var float L_P2_bodyBot = na
// SHORT state vars
var int S_P1Abs = na
var int S_P2Abs = na
var int S_P3Abs = na
var int S_winOpenAbs = na
var float S_P1Open = na
var float S_P2Close = na
var float S_P3Px = na
var float S_P2_bodyTop = na
var float S_P2_bodyBot = na
// draw-set containers
var box L_SET_BOX = array.new_box()
var label L_SET_LBL = array.new_label()
var box S_SET_BOX = array.new_box()
var label S_SET_LBL = array.new_label()
// scanners
var bool L_seek = false
var bool L_confirmActive = false
var int L_runMaxAbs = na
var float L_runMaxClose = na
var int L_candAbs = na
var float L_candClose = na
var bool S_seek = false
var bool S_confirmActive = false
var int S_runMinAbs = na
var float S_runMinClose = na
var int S_candAbs = na
var float S_candClose = na
// LONG: seed/confirm P2
if not L_seek and not L_confirmActive
float __btL = math.max(open, close)
float __bbL = math.min(open, close)
float __bodyL = __btL - __bbL
float __fiveL = fiveUp_200
float __fracL = (__bodyL <= 0 or na(__fiveL)) ? 0.0 : math.max(0.0, __btL - math.max(__bbL, __fiveL)) / __bodyL
bool startLongSeed = close > open and (__fracL >= 0.60)
if startLongSeed
L_seek := true
L_runMaxAbs := bar_index
L_runMaxClose := close
if L_confirmActive
if close > L_candClose and close > open
L_seek := true
L_confirmActive := false
L_candAbs := na
L_candClose := na
L_runMaxAbs := bar_index
L_runMaxClose := close
else if bar_index >= L_candAbs + rightWinBars
array.clear(L_SET_BOX)
array.clear(L_SET_LBL)
L_P2Abs := L_candAbs
// reset momentary flags on NEW P2 (LONG)
resetReqAllL := false
resetReqP1L := false
resetReqP2L := false
resetReqP3L := false
int offP2 = bar_index - L_P2Abs
L_P2Close := close
L_P2_bodyTop := math.max(open , close )
L_P2_bodyBot := math.min(open , close )
f_draw_mark_group(L_P2Abs, false, P2BoxColor, P2BoxFillTransp, BoxBorderTransp, showP2Label, "P2", true)
L_winOpenAbs := L_P2Abs + 1
// หา P1 (ย่อ)
int bestAbs = na
float bestDist = na
for k = 1 to 50
int a = L_P2Abs - k
if a < 0
break
int off = bar_index - a
if off < 0 or off > 5000
continue
if close <= open
continue
float ema5u85 = fiveUp_85
if na(ema5u85)
continue
float bt = math.max(open , close )
float bb = math.min(open , close )
float body = bt - bb
float fracAbove = body <= 0 ? 0.0 : math.max(0.0, bt - math.max(bb, ema5u85))/body
if fracAbove >= 0.25
float d = math.abs(mid200 - (bt+bb)/2.0)
if na(bestDist) or d < bestDist or (d == bestDist and (na(bestAbs) or a < bestAbs))
bestDist := d
bestAbs := a
if not na(bestAbs)
int offb = bar_index - bestAbs
L_P1Open := open
L_P1Abs := bestAbs
f_draw_mark_group(L_P1Abs, false, P1BoxColor, P1BoxFillTransp, BoxBorderTransp, showP1Label, "P1", true)
L_seek := false
L_confirmActive := false
L_candAbs := na
L_candClose := na
L_runMaxAbs := na
L_runMaxClose := na
if L_seek and not L_confirmActive
if close > open
if close > nz(L_runMaxClose, -1e100)
L_runMaxClose := close
L_runMaxAbs := bar_index
else if close < nz(L_runMaxClose, 1e100)
L_candAbs := L_runMaxAbs
L_candClose := L_runMaxClose
L_seek := false
L_confirmActive := true
else if open < nz(L_runMaxClose, 1e100)
L_candAbs := L_runMaxAbs
L_candClose := L_runMaxClose
L_seek := false
L_confirmActive := true
// SHORT: seed/confirm P2
if not S_seek and not S_confirmActive
float __btS = math.max(open, close)
float __bbS = math.min(open, close)
float __bodyS = __btS - __bbS
float __fiveS = fiveDown_200
float __fracS = (__bodyS <= 0 or na(__fiveS)) ? 0.0 : math.max(0.0, math.min(__btS, __fiveS) - __bbS) / __bodyS
bool startShortSeed = close < open and (__fracS >= 0.60)
if startShortSeed
S_seek := true
S_runMinAbs := bar_index
S_runMinClose := close
if S_confirmActive
if close < S_candClose and close < open
S_seek := true
S_confirmActive := false
S_candAbs := na
S_candClose := na
S_runMinAbs := bar_index
S_runMinClose := close
else if bar_index >= S_candAbs + rightWinBars
array.clear(S_SET_BOX)
array.clear(S_SET_LBL)
S_P2Abs := S_candAbs
// reset momentary flags on NEW P2 (SHORT)
resetReqAllS := false
resetReqP1S := false
resetReqP2S := false
resetReqP3S := false
int offP2s = bar_index - S_P2Abs
S_P2Close := close
S_P2_bodyTop := math.max(open , close )
S_P2_bodyBot := math.min(open , close )
f_draw_mark_group(S_P2Abs, false, P2BoxColor, P2BoxFillTransp, BoxBorderTransp, showP2Label, "P2", false)
S_winOpenAbs := S_P2Abs + 1
// หา P1 (short; ย่อ)
int bestAbsS = na
float bestDistS = na
for k = 1 to 50
int a = S_P2Abs - k
if a < 0
break
int off = bar_index - a
if off < 0 or off > 5000
continue
if close >= open
continue
float ema5d85 = fiveDown_85
if na(ema5d85)
continue
float bt = math.max(open , close )
float bb = math.min(open , close )
float body = bt - bb
float fracBelow = body <= 0 ? 0.0 : math.max(0.0, math.min(bt, ema5d85) - bb)/body
if fracBelow >= 0.25
float d = math.abs(mid200 - (bt+bb)/2.0)
if na(bestDistS) or d < bestDistS or (d == bestDistS and (na(bestAbsS) or a < bestAbsS))
bestDistS := d
bestAbsS := a
if not na(bestAbsS)
int offb = bar_index - bestAbsS
S_P1Open := open
S_P1Abs := bestAbsS
f_draw_mark_group(S_P1Abs, false, P1BoxColor, P1BoxFillTransp, BoxBorderTransp, showP1Label, "P1", false)
S_seek := false
S_confirmActive := false
S_candAbs := na
S_candClose := na
S_runMinAbs := na
S_runMinClose := na
if S_seek and not S_confirmActive
if close < open
if close < nz(S_runMinClose, 1e100)
S_runMinClose := close
S_runMinAbs := bar_index
else if close > nz(S_runMinClose, -1e100)
S_candAbs := S_runMinAbs
S_candClose := S_runMinClose
S_seek := false
S_confirmActive := true
else if open > nz(S_runMinClose, -1e100)
S_candAbs := S_runMinAbs
S_candClose := S_runMinClose
S_seek := false
S_confirmActive := true
// ---------- LONG: close P3 window (classic picker) ----------
if not na(L_winOpenAbs)
int sAbs = L_winOpenAbs
int eAbs = bar_index
float rangeBody = L_P2_bodyTop - L_P2_bodyBot
float T33 = L_P2_bodyBot + rangeBody/3.0
float T75 = L_P2_bodyBot + rangeBody*0.75
int barsInWin = bar_index - L_winOpenAbs + 1
bool allowNormal = barsInWin >= 5 and close > open and close >= T33
bool allowEarly = barsInWin < 5 and close > open and close >= T75
if allowNormal or allowEarly
= f_pickP3_abs(sAbs, eAbs, true)
if not na(p3AbsL)
L_P3Abs := p3AbsL
L_P3Px := p3PxL_tmp
f_draw_mark_group(L_P3Abs, false, P3BoxColor, P3BoxFillTransp, BoxBorderTransp, showP3Label, "P3", true)
L_winOpenAbs := na
// ---------- SHORT: close P3 window (classic picker) ----------
if not na(S_winOpenAbs)
int sAbsS = S_winOpenAbs
int eAbsS = bar_index
float rangeBodyS = S_P2_bodyTop - S_P2_bodyBot
float T33d = S_P2_bodyTop - rangeBodyS/3.0
float T75d = S_P2_bodyTop - rangeBodyS*0.75
int barsInWinS = bar_index - S_winOpenAbs + 1
bool allowNormalS = barsInWinS >= 5 and close < open and close <= T33d
bool allowEarlyS = barsInWinS < 5 and close < open and close <= T75d
if allowNormalS or allowEarlyS
= f_pickP3_abs(sAbsS, eAbsS, false)
if not na(p3AbsS)
S_P3Abs := p3AbsS
S_P3Px := p3PxS_tmp
f_draw_mark_group(S_P3Abs, false, P3BoxColor, P3BoxFillTransp, BoxBorderTransp, showP3Label, "P3", false)
S_winOpenAbs := na
//──────────────────────────────── Manual Layer (+ Reset Latches) ─────────────────────
f_pick_abs_from_manual(_use, _pickMode, _time, _offset) =>
if not _use
na
else
_pickMode == PK_TIME ? f_find_abs_by_time(_time) : (bar_index + _offset)
f_pick_price_from_manual(_use, _abs, _pmode, _custom) =>
if not _use or na(_abs)
na
else
int off = bar_index - _abs
off < 0 or off > 5000 ? na : f_price_by_mode(off, _pmode, _custom)
useP1L_eff = useManP1L and not (resetReqAllL or resetReqP1L)
useP2L_eff = useManP2L and not (resetReqAllL or resetReqP2L)
useP3L_eff = useManP3L and not (resetReqAllL or resetReqP3L)
useP1S_eff = useManP1S and not (resetReqAllS or resetReqP1S)
useP2S_eff = useManP2S and not (resetReqAllS or resetReqP2S)
useP3S_eff = useManP3S and not (resetReqAllS or resetReqP3S)
// Effective ABS
int L_P1Abs_eff = useP1L_eff ? f_pick_abs_from_manual(useP1L_eff, pickP1L, manP1L_t, manP1L_of) : L_P1Abs
int L_P2Abs_eff = useP2L_eff ? f_pick_abs_from_manual(useP2L_eff, pickP2L, manP2L_t, manP2L_of) : L_P2Abs
int L_P3Abs_eff = useP3L_eff ? f_pick_abs_from_manual(useP3L_eff, pickP3L, manP3L_t, manP3L_of) : L_P3Abs
int S_P1Abs_eff = useP1S_eff ? f_pick_abs_from_manual(useP1S_eff, pickP1S, manP1S_t, manP1S_of) : S_P1Abs
int S_P2Abs_eff = useP2S_eff ? f_pick_abs_from_manual(useP2S_eff, pickP2S, manP2S_t, manP2S_of) : S_P2Abs
int S_P3Abs_eff = useP3S_eff ? f_pick_abs_from_manual(useP3S_eff, pickP3S, manP3S_t, manP3S_of) : S_P3Abs
// Effective Prices
float L_P1Open_eff = useP1L_eff ? f_pick_price_from_manual(useP1L_eff, L_P1Abs_eff, pmP1L, p1L_custom) : L_P1Open
float L_P2Close_eff = useP2L_eff ? f_pick_price_from_manual(useP2L_eff, L_P2Abs_eff, pmP2L, p2L_custom) : L_P2Close
float L_P3Px_eff = useP3L_eff ? f_pick_price_from_manual(useP3L_eff, L_P3Abs_eff, pmP3L, p3L_custom) : L_P3Px
float S_P1Open_eff = useP1S_eff ? f_pick_price_from_manual(useP1S_eff, S_P1Abs_eff, pmP1S, p1S_custom) : S_P1Open
float S_P2Close_eff = useP2S_eff ? f_pick_price_from_manual(useP2S_eff, S_P2Abs_eff, pmP2S, p2S_custom) : S_P2Close
float S_P3Px_eff = useP3S_eff ? f_pick_price_from_manual(useP3S_eff, S_P3Abs_eff, pmP3S, p3S_custom) : S_P3Px
// Redraw labels/boxes if manual in effect
bool needRedrawL = useP1L_eff or useP2L_eff or useP3L_eff
bool needRedrawS = useP1S_eff or useP2S_eff or useP3S_eff
if needRedrawL
f_delete_boxes(L_SET_BOX)
f_delete_labels(L_SET_LBL)
if not na(L_P1Abs_eff) and showP1Label
f_draw_mark_group(L_P1Abs_eff, false, P1BoxColor, P1BoxFillTransp, BoxBorderTransp, true, "P1", true)
if not na(L_P2Abs_eff) and showP2Label
f_draw_mark_group(L_P2Abs_eff, false, P2BoxColor, P2BoxFillTransp, BoxBorderTransp, true, "P2", true)
if not na(L_P3Abs_eff) and showP3Label
f_draw_mark_group(L_P3Abs_eff, false, P3BoxColor, P3BoxFillTransp, BoxBorderTransp, true, "P3", true)
if needRedrawS
f_delete_boxes(S_SET_BOX)
f_delete_labels(S_SET_LBL)
if not na(S_P1Abs_eff) and showP1Label
f_draw_mark_group(S_P1Abs_eff, false, P1BoxColor, P1BoxFillTransp, BoxBorderTransp, true, "P1", false)
if not na(S_P2Abs_eff) and showP2Label
f_draw_mark_group(S_P2Abs_eff, false, P2BoxColor, P2BoxFillTransp, BoxBorderTransp, true, "P2", false)
if not na(S_P3Abs_eff) and showP3Label
f_draw_mark_group(S_P3Abs_eff, false, P3BoxColor, P3BoxFillTransp, BoxBorderTransp, true, "P3", false)
// FE from effective points (Manual precedence)
bool canFE_L = showFE and not na(L_P1Open_eff) and not na(L_P2Close_eff) and not na(L_P3Px_eff) and not na(L_P1Abs_eff) and not na(L_P2Abs_eff) and not na(L_P3Abs_eff)
bool canFE_S = showFE and not na(S_P1Open_eff) and not na(S_P2Close_eff) and not na(S_P3Px_eff) and not na(S_P1Abs_eff) and not na(S_P2Abs_eff) and not na(S_P3Abs_eff)
if canFE_L
float W = L_P2Close_eff - L_P1Open_eff
if W > 0
float y95 = f_rt(L_P3Px_eff + 0.95 * W)
float y105 = f_rt(L_P3Px_eff + 1.05 * W)
float y1618 = f_rt(L_P3Px_eff + 1.618 * W)
float y2618 = f_rt(L_P3Px_eff + 2.618 * W)
float y3618 = f_rt(L_P3Px_eff + 3.618 * W)
float y4618 = f_rt(L_P3Px_eff + 4.618 * W)
f_clear_all_fe()
f_add_fe_set(L_P3Abs_eff, y95, y105, y1618, y2618, y3618, y4618)
else if canFE_S
float Ws = S_P2Close_eff - S_P1Open_eff
if Ws < 0
float y95s = f_rt(S_P3Px_eff + 0.95 * Ws)
float y105s = f_rt(S_P3Px_eff + 1.05 * Ws)
float y1618s = f_rt(S_P3Px_eff + 1.618 * Ws)
float y2618s = f_rt(S_P3Px_eff + 2.618 * Ws)
float y3618s = f_rt(S_P3Px_eff + 3.618 * Ws)
float y4618s = f_rt(S_P3Px_eff + 4.618 * Ws)
f_clear_all_fe()
f_add_fe_set(S_P3Abs_eff, y95s, y105s, y1618s, y2618s, y3618s, y4618s)
// FE lifespan cleanup
int nBorn = array.size(FE_born)
if nBorn > 0
for k = 0 to nBorn - 1
int idx = nBorn - 1 - k
int born = array.get(FE_born, idx)
if bar_index - born > feLife
f_delete_fe_index(idx)
// Candle coloring
bool isP1_bar = (not na(L_P1Abs_eff) and bar_index == L_P1Abs_eff) or (not na(S_P1Abs_eff) and bar_index == S_P1Abs_eff)
bool isP2_bar = (not na(L_P2Abs_eff) and bar_index == L_P2Abs_eff) or (not na(S_P2Abs_eff) and bar_index == S_P2Abs_eff)
bool isP3_bar = (not na(L_P3Abs_eff) and bar_index == L_P3Abs_eff) or (not na(S_P3Abs_eff) and bar_index == S_P3Abs_eff)
color _candleCol = na
_candleCol := isP3_bar ? colP3Candle : (isP2_bar ? colP2Candle : (isP1_bar ? colP1Candle : na))
barcolor(recolorBars ? _candleCol : na)
// Reserve style slot
plot(showFE ? na : na, title="fe-slot")
//──────────────────────────────── di (DSI; masked) ───────────────────────────
float dsi_atr = ta.atr(14)
float dsi_highestBody = open > close ? open : close
float dsi_lowestBody = open > close ? close : open
var float dsi_res1 = na
var float dsi_res2 = na
var float dsi_sup1 = na
var float dsi_sup2 = na
var bool dsi_lookForNewResistance = true
var bool dsi_lookForNewSupport = true
var float dsi_prevRes1 = na
var float dsi_prevRes2 = na
var float dsi_prevSup1 = na
var float dsi_prevSup2 = na
var float dsi_atrSaved = na
var float dsi_potR1 = na
var float dsi_potR2 = na
var float dsi_potS1 = na
var float dsi_potS2 = na
if high == ta.highest(high, lookback) and high < high and dsi_lookForNewResistance
float r1 = high
float hb2 = (open > close ? open : close )
float hb1 = (open > close ? open : close )
float hb0 = (open > close ? open : close)
float r2 = hb2 > hb1 ? hb2 : (hb0 > hb1 ? hb0 : hb1)
if (r1 - r2) / dsi_atr <= maxZoneSize
dsi_lookForNewResistance := false
dsi_potR1 := r1
dsi_potR2 := r2
dsi_atrSaved := dsi_atr
if low == ta.lowest(low, lookback) and low > low and dsi_lookForNewSupport
float s1 = low
float lb2 = (open > close ? close : open )
float lb1 = (open > close ? close : open )
float lb0 = (open > close ? close : open)
float s2 = lb2 < lb1 ? lb2 : (lb0 < lb1 ? lb0 : lb1)
if (s2 - s1) / dsi_atr <= maxZoneSize
dsi_lookForNewSupport := false
dsi_potS1 := s1
dsi_potS2 := s2
dsi_atrSaved := dsi_atr
if close > dsi_potR1 and barstate.isconfirmed
dsi_potR1 := na
dsi_potR2 := na
if close < dsi_potS1 and barstate.isconfirmed
dsi_potS1 := na
dsi_potS2 := na
if not na(dsi_potR1) and dsi_potR1 - low >= (nz(dsi_atrSaved, dsi_atr) * atrMovement)
dsi_prevRes1 := na(dsi_prevRes1) ? dsi_potR1 : dsi_prevRes1
dsi_prevRes2 := na(dsi_prevRes2) ? dsi_potR2 : dsi_prevRes2
dsi_res1 := dsi_potR1
dsi_res2 := dsi_potR2
dsi_potR1 := na
dsi_potR2 := na
if not na(dsi_potS1) and high - dsi_potS1 >= (nz(dsi_atrSaved, dsi_atr) * atrMovement)
dsi_prevSup1 := na(dsi_prevSup1) ? dsi_potS1 : dsi_prevSup1
dsi_prevSup2 := na(dsi_prevSup2) ? dsi_potS2 : dsi_prevSup2
dsi_sup1 := dsi_potS1
dsi_sup2 := dsi_potS2
dsi_potS1 := na
dsi_potS2 := na
var int dsi_supCount = 0
var int dsi_resCount = 0
if close >= dsi_res1 and barstate.isconfirmed
dsi_lookForNewResistance := true
dsi_lookForNewSupport := true
dsi_resCount += 1
if close <= dsi_sup1 and barstate.isconfirmed
dsi_lookForNewSupport := true
dsi_lookForNewResistance := true
dsi_supCount += 1
if (close > dsi_res1 and na(dsi_prevRes1) and barstate.isconfirmed) or na(dsi_prevRes1) or dsi_resCount >= newStructureReset
dsi_prevRes1 := dsi_res1
dsi_prevRes2 := dsi_res2
dsi_resCount := 0
if (close < dsi_sup1 and na(dsi_prevSup1) and barstate.isconfirmed) or na(dsi_prevSup1) or dsi_supCount >= newStructureReset
dsi_prevSup1 := dsi_sup1
dsi_prevSup2 := dsi_sup2
dsi_supCount := 0
if close < dsi_prevRes2 and barstate.isconfirmed
dsi_prevRes1 := na
dsi_prevRes2 := na
if close > dsi_prevSup2 and barstate.isconfirmed
dsi_prevSup1 := na
dsi_prevSup2 := na
dsi_r1plot = plot(showDSI and (dsi_res1 == dsi_res1 ) ? dsi_res1 : na, color=close >= dsi_res1 ? dsiBullColor : dsiBearColor, style=plot.style_linebr, title="di R1")
dsi_r2plot = plot(showDSI and (dsi_res1 == dsi_res1 ) ? dsi_res2 : na, color=close >= dsi_res1 ? dsiBullColor : dsiBearColor, style=plot.style_linebr, title="di R2")
fill(dsi_r1plot, dsi_r2plot, color=showDSI ? (close > dsi_res1 ? dsiBullColor : color.new(dsiBearColor, 50)) : color.new(color.black, 100), title="di Resistance Zone")
dsi_s1plot = plot(showDSI and (dsi_sup1 == dsi_sup1 ) ? dsi_sup1 : na, color=close < dsi_sup1 ? dsiBearColor : dsiBullColor, style=plot.style_linebr, title="di S1")
dsi_s2plot = plot(showDSI and (dsi_sup1 == dsi_sup1 ) ? dsi_sup2 : na, color=close < dsi_sup1 ? dsiBearColor : dsiBullColor, style=plot.style_linebr, title="di S2")
fill(dsi_s1plot, dsi_s2plot, color=showDSI ? (close < dsi_sup1 ? dsiBearColor : color.new(dsiBullColor, 50)) : color.new(color.black, 100), title="di Support Zone")
dsi_ps1plot = plot(showDSI and drawPreviousStructure and (dsi_prevSup1 == dsi_prevSup1 ) and (dsi_prevSup1 != dsi_sup1) ? dsi_prevSup1 : na, color=dsiBearColor, style=plot.style_linebr, title="di PS1")
dsi_ps2plot = plot(showDSI and drawPreviousStructure and (dsi_prevSup1 == dsi_prevSup1 ) and (dsi_prevSup1 != dsi_sup1) ? dsi_prevSup2 : na, color=dsiBearColor, style=plot.style_linebr, title="di PS2")
fill(dsi_ps1plot, dsi_ps2plot, color=showDSI and drawPreviousStructure ? color.new(dsiBearColor, 10) : color.new(color.black, 100), title="di Previous Support Zone")
dsi_pr1plot = plot(showDSI and drawPreviousStructure and (dsi_prevRes1 == dsi_prevRes1 ) and (dsi_prevRes1 != dsi_res1) ? dsi_prevRes1 : na, color=dsiBullColor, style=plot.style_linebr, title="di PR1")
dsi_pr2plot = plot(showDSI and drawPreviousStructure and (dsi_prevRes1 == dsi_prevRes1 ) and (dsi_prevRes1 != dsi_res1) ? dsi_prevRes2 : na, color=dsiBullColor, style=plot.style_linebr, title="di Previous Resistance Zone")
Globex Trap w/ percentage [SLICKRICK]Globex Trap w/ Percentage
Overview
The Globex Trap w/ Percentage indicator is a powerful tool designed to help traders identify high-probability trading opportunities by analyzing price action during the Globex (overnight) session and regular trading hours. By combining Globex session ranges with Supply & Demand zones, this indicator highlights potential "trap" areas where significant price reactions may occur. Additionally, it calculates the Globex session range as a percentage of the daily Average True Range (ATR), providing valuable context for assessing market volatility.
This indicator is ideal for traders in futures markets or other instruments traded during Globex sessions, offering a visual and analytical edge for spotting key price levels and potential reversals or breakouts.
Key Features
Globex Session Tracking:
Visualizes the high and low of the Globex session (default: 3:00 PM to 6:30 AM PST) with customizable time settings.
Displays a semi-transparent box to mark the Globex range, with labels for "Globex High" and "Globex Low."
Calculates the Globex range as a percentage of the daily ATR, displayed as a label for quick reference.
Supply & Demand Zones:
Identifies Supply & Demand zones during regular trading hours (default: 6:00 AM to 8:00 AM PST) with customizable time settings.
Draws semi-transparent boxes to highlight these zones, aiding in the identification of key support and resistance areas.
Trap Area Identification:
Highlights potential trap zones where Globex ranges and Supply & Demand zones overlap, indicating areas where price may reverse or consolidate due to trapped traders.
Customizable Settings:
Adjust Globex and Supply & Demand session times to suit your trading preferences.
Toggle visibility of Globex and Supply & Demand zones independently.
Customize box colors for better chart readability.
Set the lookback period (default: 10 days) to control how many historical zones are displayed.
Configure the ATR length (default: 14) for the percentage calculation.
PST Timezone Default:
All times are based on Pacific Standard Time (PST) by default, ensuring accurate session tracking for users in this timezone or those aligning with U.S. West Coast market hours.
Recommended Usage
Timeframes: Best used on 1-hour charts or lower (e.g., 15-minute, 5-minute) for precise entry and exit points.
Markets: Optimized for futures (e.g., ES, NQ, CL) and other instruments traded during Globex sessions.
Historical Data: Ensure at least 10 days of historical data for optimal visualization of zones.
Strategy Integration: Use the indicator to identify potential reversals or breakouts at Globex highs/lows or Supply & Demand zones. The ATR percentage provides context for whether the Globex range is significant relative to typical daily volatility.
How It Works
Globex Session:
Tracks the high and low prices during the user-defined Globex session (default: 3:00 PM to 6:30 AM PST).
When the session ends, a box is drawn from the start to the end of the session, capturing the high and low prices.
Labels are placed at the midpoint of the session, showing "Globex High," "Globex Low," and the range as a percentage of the daily ATR (e.g., "75.23% of Daily ATR").
Supply & Demand Zones:
Tracks the high and low prices during the user-defined regular trading hours (default: 6:00 AM to 8:00 AM PST).
Draws a box to mark these zones, which often act as key support or resistance levels.
ATR Percentage:
Calculates the Globex range (high minus low) and divides it by the daily ATR to express it as a percentage.
This metric helps traders gauge whether the overnight price movement is significant compared to the instrument’s typical volatility.
Time Handling:
Uses PST (UTC-8) for all time calculations, ensuring accurate session timing for users aligning with this timezone.
Properly handles overnight sessions that cross midnight, ensuring seamless tracking.
Input Settings
Globex Session Settings:
Show Globex Session: Enable/disable Globex session visualization (default: true).
Globex Start/End Time: Set the start and end times for the Globex session (default: 3:00 PM to 6:00 AM PST).
Globex Box Color: Customize the color of the Globex session box (default: semi-transparent gray).
Supply & Demand Zone Settings:
Show Supply & Demand Zone: Enable/disable zone visualization (default: true).
Zone Start/End Time: Set the start and end times for Supply & Demand zones (default: 6:00 AM to 8:00 AM PST).
Zone Box Color: Customize the color of the zone box (default: semi-transparent aqua).
General Settings:
Days to Look Back: Number of historical days to display zones (default: 10).
ATR Length: Period for calculating the daily ATR (default: 14).
Notes
All times are in Pacific Standard Time (PST). Adjust the start and end times if your market operates in a different timezone or if you prefer different session windows.
The indicator is optimized for instruments with active Globex sessions, such as futures. Results may vary for non-24/5 markets.
A typo in the label "Globe Low" (should be "Globex Low") will be corrected in future updates.
Ensure your TradingView chart is set to display sufficient historical data to view the full lookback period.
Why Use This Indicator?
The Globex Trap w/ Percentage indicator provides a unique combination of session-based range analysis, Supply & Demand zone identification, and volatility context via the ATR percentage. Whether you’re a day trader, swing trader, or scalper, this tool helps you:
Pinpoint key price levels where institutional traders may act.
Assess the significance of overnight price movements relative to daily volatility.
Identify potential trap zones for high-probability setups.
Customize the indicator to fit your trading style and market preferences.
Publishing Notes
This indicator is authored by SLICKRICK and is version 1.0. For feedback, suggestions, or support, feel free to comment below or contact me directly on TradingView. Happy trading!
Tips for Publishing on TradingView
Paste the Code: Copy the provided PineScript code into TradingView’s Pine Editor.
Add the Description: Use the description above in the "Description" field when publishing. This helps users understand the indicator’s purpose and usage.
Include a Screenshot: Add a chart screenshot showing the indicator in action (e.g., Globex and Supply & Demand zones with labels). Highlight the ATR percentage label for emphasis.
Set Access Permissions: Choose whether to make it public, private, or protected (requires a paid TradingView subscription for protected access).
Tags: Use relevant tags like “Globex,” “Supply and Demand,” “ATR,” “Futures,” and “Trap Zones” to improve discoverability.
Test Thoroughly: Before publishing, test the indicator on different instruments (e.g., ES, NQ) and timeframes to ensure it behaves as expected.
Fix the Typo: Consider updating the label text from "Globe Low" to "Globex Low" in the code before publishing to avoid confusion:
pinescriptlabel.new(x=mid_point_range1, y=range1_low, text="Globex Low", style=label.style_label_up, color=color.gray, textcolor=color.white)
Engage with Users: After publishing, monitor comments for feedback and respond to questions to build a community around your indicator.
Globex Trap w/ percentage [SLICKRICK]Globex Trap w/ Percentage
Overview
The Globex Trap w/ Percentage indicator is a powerful tool designed to help traders identify high-probability trading opportunities by analyzing price action during the Globex (overnight) session and regular trading hours. By combining Globex session ranges with Supply & Demand zones, this indicator highlights potential "trap" areas where significant price reactions may occur. Additionally, it calculates the Globex session range as a percentage of the daily Average True Range (ATR), providing valuable context for assessing market volatility.
This indicator is ideal for traders in futures markets or other instruments traded during Globex sessions, offering a visual and analytical edge for spotting key price levels and potential reversals or breakouts.
Key Features
Globex Session Tracking:
Visualizes the high and low of the Globex session (default: 3:00 PM to 6:30 AM PST) with customizable time settings.
Displays a semi-transparent box to mark the Globex range, with labels for "Globex High" and "Globex Low."
Calculates the Globex range as a percentage of the daily ATR, displayed as a label for quick reference.
Supply & Demand Zones:
Identifies Supply & Demand zones during regular trading hours (default: 6:00 AM to 8:00 AM PST) with customizable time settings.
Draws semi-transparent boxes to highlight these zones, aiding in the identification of key support and resistance areas.
Trap Area Identification:
Highlights potential trap zones where Globex ranges and Supply & Demand zones overlap, indicating areas where price may reverse or consolidate due to trapped traders.
Customizable Settings:
Adjust Globex and Supply & Demand session times to suit your trading preferences.
Toggle visibility of Globex and Supply & Demand zones independently.
Customize box colors for better chart readability.
Set the lookback period (default: 10 days) to control how many historical zones are displayed.
Configure the ATR length (default: 14) for the percentage calculation.
PST Timezone Default:
All times are based on Pacific Standard Time (PST) by default, ensuring accurate session tracking for users in this timezone or those aligning with U.S. West Coast market hours.
Recommended Usage
Timeframes: Best used on 1-hour charts or lower (e.g., 15-minute, 5-minute) for precise entry and exit points.
Markets: Optimized for futures (e.g., ES, NQ, CL) and other instruments traded during Globex sessions.
Historical Data: Ensure at least 10 days of historical data for optimal visualization of zones.
Strategy Integration: Use the indicator to identify potential reversals or breakouts at Globex highs/lows or Supply & Demand zones. The ATR percentage provides context for whether the Globex range is significant relative to typical daily volatility.
How It Works
Globex Session:
Tracks the high and low prices during the user-defined Globex session (default: 3:00 PM to 6:30 AM PST).
When the session ends, a box is drawn from the start to the end of the session, capturing the high and low prices.
Labels are placed at the midpoint of the session, showing "Globex High," "Globex Low," and the range as a percentage of the daily ATR (e.g., "75.23% of Daily ATR").
Supply & Demand Zones:
Tracks the high and low prices during the user-defined regular trading hours (default: 6:00 AM to 8:00 AM PST).
Draws a box to mark these zones, which often act as key support or resistance levels.
ATR Percentage:
Calculates the Globex range (high minus low) and divides it by the daily ATR to express it as a percentage.
This metric helps traders gauge whether the overnight price movement is significant compared to the instrument’s typical volatility.
Time Handling:
Uses PST (UTC-8) for all time calculations, ensuring accurate session timing for users aligning with this timezone.
Properly handles overnight sessions that cross midnight, ensuring seamless tracking.
Input Settings
Globex Session Settings:
Show Globex Session: Enable/disable Globex session visualization (default: true).
Globex Start/End Time: Set the start and end times for the Globex session (default: 3:00 PM to 6:30 AM PST).
Globex Box Color: Customize the color of the Globex session box (default: semi-transparent gray).
Supply & Demand Zone Settings:
Show Supply & Demand Zone: Enable/disable zone visualization (default: true).
Zone Start/End Time: Set the start and end times for Supply & Demand zones (default: 6:00 AM to 8:00 AM PST).
Zone Box Color: Customize the color of the zone box (default: semi-transparent aqua).
General Settings:
Days to Look Back: Number of historical days to display zones (default: 10).
ATR Length: Period for calculating the daily ATR (default: 14).
Notes
All times are in Pacific Standard Time (PST). Adjust the start and end times if your market operates in a different timezone or if you prefer different session windows.
The indicator is optimized for instruments with active Globex sessions, such as futures. Results may vary for non-24/5 markets.
A typo in the label "Globe Low" (should be "Globex Low") will be corrected in future updates.
Ensure your TradingView chart is set to display sufficient historical data to view the full lookback period.
Why Use This Indicator?
The Globex Trap w/ Percentage indicator provides a unique combination of session-based range analysis, Supply & Demand zone identification, and volatility context via the ATR percentage. Whether you’re a day trader, swing trader, or scalper, this tool helps you:
Pinpoint key price levels where institutional traders may act.
Assess the significance of overnight price movements relative to daily volatility.
Identify potential trap zones for high-probability setups.
Customize the indicator to fit your trading style and market preferences.
Publishing Notes
This indicator is authored by SLICKRICK and is version 1.0. For feedback, suggestions, or support, feel free to comment below or contact me directly on TradingView. Happy trading!
Tips for Publishing on TradingView
Paste the Code: Copy the provided PineScript code into TradingView’s Pine Editor.
Add the Description: Use the description above in the "Description" field when publishing. This helps users understand the indicator’s purpose and usage.
Include a Screenshot: Add a chart screenshot showing the indicator in action (e.g., Globex and Supply & Demand zones with labels). Highlight the ATR percentage label for emphasis.
Set Access Permissions: Choose whether to make it public, private, or protected (requires a paid TradingView subscription for protected access).
Tags: Use relevant tags like “Globex,” “Supply and Demand,” “ATR,” “Futures,” and “Trap Zones” to improve discoverability.
Test Thoroughly: Before publishing, test the indicator on different instruments (e.g., ES, NQ) and timeframes to ensure it behaves as expected.
Fix the Typo: Consider updating the label text from "Globe Low" to "Globex Low" in the code before publishing to avoid confusion:
pinescriptlabel.new(x=mid_point_range1, y=range1_low, text="Globex Low", style=label.style_label_up, color=color.gray, textcolor=color.white)
Engage with Users: After publishing, monitor comments for feedback and respond to questions to build a community around your indicator.
Swing High/Low + SFPs maps highs and lows along with SFPs
to help identify entry point to trade the market
RV_XSThis is a simple indicator designed for testing only.
Please do not take this indicator too seriously.
Just another random tool on the chart.
I made this indicator for fun and practice.
Nothing special here, just a basic script.
Use it if you like, ignore it if you don’t.
Sometimes it works, sometimes it doesn’t.
This description doesn’t explain much at all.
Made on a boring day with no big purpose.
Just a random indicator with a random description
Mouse Indicator Private V2.0The "Mouse Indicator Private" is a powerful Pine Script tool designed for XAU/USD (Gold) trading on the 1-minute (M1) timeframe. It incorporates a sophisticated set of conditions to identify potential trading opportunities, focusing on specific candlestick patterns and volume dynamics, combined with advanced capital management features.
Key Features:
1. Independent of Higher Timeframe Structure: Unlike many indicators, "Mouse Trader" operates effectively on the M1 timeframe without needing confirmation from larger timeframes. This means you get timely signals directly on the fast-moving Gold market.
2. Low Stop Loss, 1:1 Risk/Reward: This indicator is designed to identify positions with a tight, low stop loss, aiming for a 1:1 Risk-to-Reward ratio. This approach allows you to take trades with well-defined risk, maximizing your trading efficiency.
3. Opportunistic Trading: Signals are generated whenever conditions are met, giving you the flexibility to seize trading opportunities as they appear throughout the trading session.
Volume Analysis: Integrates a Volume Moving Average to spot significant volume spikes and increasing volume, adding confluence to signals.
4. Automated Capital Management: Provides real-time calculations for:
- Stop Loss (SL) Price: Dynamically calculated based on the low (for Buy signals) or high (for Sell signals) of the qualifying signal candle, aiding in risk control.
- Calculated Lot Size: Automatically determines the appropriate lot size based on your predefined risk amount per trade and the calculated stop-loss distance, helping you manage your exposure effectively.
Clean Chart View: Providing a cleaner and less cluttered visual experience.
Contact for Use:
For any questions, support, or to learn more about how "Mouse Indicator Private" can enhance your trading, please connect with us: bigmouse12568@gmail.com
Multi Candle Countdown by iNicho v2Description:
Multi Candle Countdown is a lightweight and customizable indicator that shows real-time countdowns to candle closes across multiple timeframes.
✨ Features
Up to 8 custom timeframe slots (you choose which ones to display).
Smart labels (e.g. 60 → H1, 90 → M90, 240 → H4, others → Mxx).
Customizable table position, text size, and background opacity.
Warning color when the candle is about to close (default = last 10 seconds).
Works with minutes, hours, days, and even seconds timeframes.
🔎 Use case
Designed for day traders and scalpers who want to monitor multiple timeframe closes without switching charts.
⚠️ Note
On TradingView, countdowns update with market ticks. In slow markets, the timer may appear to “jump” instead of updating every second. This is a platform limitation, not the script.
LP_Suitability_Overlay_ATR_ADX_BB_RSI_v3.2Per controllare i range, e i pattern e la collocazione dei range su grafici a 4h
Ichimoku Scanner Pro+[by Irum]Ichimoku Scanner
Clouds/lines are displayed above the chart, and the Long/Short signal is only allowed to appear when the **Score (number of conditions met)** is above the threshold.
Redundant signal suppression (ignoring same directional continuous signal), notification conditions (long/short setting, cloud break, TK cross), and ATR-based reference fingerprint/goals were also included.
It fits well with BTC/15 minutes basic operation, but operates in all stocks and cycles.
Open=High & Open=Low StrategyJUST A SIMPLE HEIKENASHI OPEN LOW STRATEGY . YOU CAN BUT SELL BASED ON SIGNALS AND THIS STRATEGY IS HAVING AN OPTION TO FURTHER REDUCE RISK WITH OPTIONAL DOJI EXIT.
Just a simple heikenashi open low strategy. You can buy and sell based on signals and this strategy is having a optional doji exit to reduce ask
MSS Boxes (close-break only)What it does
MSS Boxes detects Market Structure Shifts (MSS) and draws clean, non-repainting mitigation boxes you can trade from. When price closes through the most recent swing with momentum, the candle that caused the break is captured as a box (supply for bearish, demand for bullish) and extended to the right as objective S/R.
How it works
Swings: swing highs/lows from your chosen left/right bars.
Shift: a bullish shift when price closes above the last swing high; bearish when it closes below the last swing low.
Displacement filter: optional size/ATR filter to require an impulsive break.
Box recipe: use wick-to-wick or body-only from the last opposite-colour candle before the break. Boxes don’t move after confirmation.
Lifecycle
Active → printed and valid.
Mitigated → price trades back into the box (optional strict wick rule).
Invalidated → close through the far side.
Expired → after N bars or at your session reset (e.g., NY 18:00).
What you see
Green boxes for bullish, red for bearish.
Small tag at origin (e.g., BOS↑/BOS↓).
Optional status markers (active/mitigated/invalid).
Key options
Swing length and displacement thresholds.
Box style (wicks vs body), max height cap, auto-merge overlaps.
MTF alignment (H1/M15) for plotting or alerts only.
Session reset time, max boxes, colours/opacity/label size.
OB - MentorXOB - MentorX
Advanced OrderBlock Detection with Smart Alerts
🎯 Key Features:
- Smart OrderBlock Detection: Identifies bullish/bearish OrderBlocks using fractal breaks
- Multi-Timeframe Alerts: Get instant notifications on 1m, 3m, 5m, 15m, 30m, 1h, 4h
- Strength Filter: Only alerts on significant OrderBlocks (ATR-based strength)
- Visual Confirmation: Alerts sync perfectly with drawn OrderBlock lines
- Customizable Settings: Adjust line styles, colors, and alert preferences
🔔 Alert System:
How It Works:
- OrderBlock detected → Lines drawn → Alert triggered
- No false signals - only alerts when OrderBlock is visible on chart
- Strength filter prevents noise alerts on weak OrderBlocks
Alert Examples:
🔴 Bearish OrderBlock Created
Timeframe: 15m
High: 1.2345
Low: 1.2300
Strength: 2.45% ATR
🟢 Bullish OrderBlock Created
Timeframe: 1h
High: 1.2400
Low: 1.2350
Strength: 3.20% ATR
⚙️ Setup:
1. Enable "Enable Alerts" in settings
2. Select desired timeframes (1m, 3m, 5m, 15m, 30m, 1h, 4h)
3. Adjust "Minimum OB Strength" (0.1-5.0% ATR)
4. Create TradingView alert with "Any alert() function call"
🎨 Customization:
- Line styles: Solid, Dashed, Dotted
- Colors: Customize bearish/bullish line colors
- Fractal filters: 3-bar or 5-bar fractals
- FVG filtering: Optional Fair Value Gap confirmation
📊 Perfect for:
- Scalping
- Swing trading
- Multi-timeframe analysis
- Professional trading strategies
Perfect for scalping, swing trading, and multi-timeframe analysis!
B版本~低风险稳定版Red and yellow and pink and green,
Purple and orange and blue,
I can sing a rainbow,
Sing a rainbow,
Sing a rainbow too.
优化开仓信号~7月更新Twinkle, twinkle, little star,
How I wonder what you are.
Up above the world so high,
Like a diamond in the sky.
ATR-Filtered EMA Scale-Out v7v7
updated adjustable atr
atr upper band
scale out notifications relocated 5 atr away
ema line changed to circles for better visibility
Daily Start Vertical Lines (≤1H)This indicator automatically plots vertical lines at the start of each new trading day, based on the selected chart’s timezone. Unlike the default daily session boundaries (which often start at 17:00 New York time), this tool ensures that lines are drawn precisely at 00:00 midnight of the chart’s timezone.
🔹 Features:
Plots a vertical line at every new day start (midnight).
Fully time-zone aware → lines adjust automatically when you change the chart’s timezone.
Customizable line style, width, and color.
Option to limit plotting to specific timeframes (e.g., show only on ≤ 1H charts).
Lightweight & optimized (does not clutter higher-timeframe charts).
🔹 Use Cases:
Quickly identify daily boundaries for intraday analysis.
Helps scalpers and day traders align trades with new day opens.
Useful for strategies that depend on daily session resets.
This tool is especially helpful for traders who want clarity when working across different time zones.