Iani SMC Sniper XAU v2.2 (Long+Short + News Countdown, v6)Iani SMC Sniper v2.6 — Anytime • Auto Pip • FVG 50% • OB • News Panel
Smart-Money Concepts made simple for intraday XAU/USD (works on any symbol).
Finds BOS, 50% FVG “sniper” entries, optional Order Blocks, London H/L, news countdown, and a mini info panel.
What it does
BOS (Break of Structure): detects bullish/bearish BOS after London sweep logic.
FVG 50% entries: plots precise long/short entry dots at the midpoint of the gap.
Auto TP/SL: TP = RR × risk, SL below/above recent swing with a small buffer.
Order Blocks (optional): marks the last opposite candle after BOS and alerts on OB revisit.
London High/Low: tracks session range; session filter is optional.
News countdown: shows next event time and minutes left (user-selectable timezone).
Mini Panel: top-left table with Trend (last BOS), Next news, R:R, Pip size.
Inputs (key)
Auto pip size: uses syminfo.mintick. Manual override available.
Risk:Reward (RR): default 2.0.
Pivot length: swing sensitivity.
Sessions: enable if you want signals only 12:00–20:00 (symbol timezone). Off = anytime.
News timezone: pick your own (e.g., Europe/Brussels, America/New_York).
Absolute & daily times: add your events (strings like 2025-09-17 20:00 or 14:30,16:00…).
Show labels/levels/OBs: toggle on/off.
Alerts included
BOS Bullish / BOS Bearish
BUY Entry / SELL Entry (return to 50% FVG)
Bullish OB revisit / Bearish OB revisit
TP Long/Short reached, SL Long/Short hit
NEWS WARNING (warning window only; does not block signals)
To use: Add Alert → Condition: this indicator → choose any of the alertconditions.
Best use
Bias: H1 for structure.
Execution: M15 (standard) or M5 (aggressive).
Works great on XAUUSD, but is symbol-agnostic (auto pip adapts).
Notes
News times display in the timezone you pick in settings.
OBs are a simple implementation meant for quick visual guidance.
Labels: BUY/SELL near entries, TP/SL on set and when hit, BOS up/down.
Risk disclaimer
This tool is for education only. Not financial advice. Backtest and manage risk.
Göstergeler ve stratejiler
KA IntradiaKA Intradia plots the current session’s Daily Open and symmetric micro-percent bands above and below it. It shows price only (no percent labels) and anchors values on the left price scale for a clean, unobtrusive read. Levels refresh automatically at the first bar of each new day and work on any symbol or timeframe. Use them to gauge intraday bias, likely reaction zones, and momentum stretches at a glance. Optional alerts fire when price crosses any active band.
Bitcoin Cycles IndicatorTrack Bitcoin's cyclical price patterns across multiple timeframes with this cycle analysis tool. The indicator automatically identifies cycle lows and highs, marking them with clear visual labels that show cycle day counts and failed cycle detection.
Key Features:
Multi-Time frame Support - Optimized settings for Daily, Weekly, Monthly, and Custom time frames
Cycle Tracking - Identifies and labels cycle lows (green) and highs (red) with day counts
Failed Cycle Detection - Highlights when cycles break below previous lows
Customizable Settings - Adjust cycle lengths, colors, and display options for each timeframe
Info Box - Real-time cycle information display with current cycle day count
Projection Boxes - Visual cycle length projections for better analysis
Perfect for Bitcoin traders and analysts who want to understand market cycles and timing. Works best on Daily charts for short-term cycles and Weekly/Monthly charts for longer-term analysis.
Reference timesThe theory behind this indicator is that sometimes the graph reaches a certain price at at a certain time according to the price it had at the same time and day in any of the previous weeks. If you could easily see what happened a few weeks ago on this day's weekday and half an hour from now, you might theoretically gain more assurance as to where the graph might go in the next half an hour.
This of course relies of the premise that some traders choose to enter or exit positions according to historical times they are referencing. Hence the name - Reference times.
Example:
it is now 08:00 ET Wednesday. I want to guess what the graph will do in the next half hour. I enter in the indicator the weekday "Wednesday", the time "8:30", and go to 30 minute candles.
I will then see all the candles the graph has been on historical Wednesdays at 8:30. If the candles are below the 08:00 price, we might guess that the graph might want to descent. If they are above the graph, we might guess that the graph might ascend.
How it works:
The user defines a weekday and time he wants to inquire on.
The script searches for past weekdays and similar hours.
It marks these bars at their wicks.
The user can also inquire "opposite hours" - 12 hours ahead or earlier.
The user can also inquire "opposite days" - Monday<->Wednesday, Tuesday<->Thursday.
In addition, the User may inquire the previous day of his selected weekday, which will mark the most recent previous day existent.
Side note: The Time zone offset is set for Jerusalem time. and so it may need future adjustment.
send debugging instances if you find any
Thank you
Assaf Fogelman 2025
Fmfm30
The Traders Trend Dashboard (fmfm30) is a comprehensive trend analysis tool designed to assist traders in making informed trading decisions across various markets and timeframes. Unlike conventional trend-following scripts,fmfm30 goes beyond simple trend detection by incorporating
Weekly Close Positive After Breaking Prior LowClosing positive after breaking prior low on weekly basis
Luxy Momentum, Trend and Breakout Indicators Suit V4ABOUT THIS INDICATOR
Purpose: Help momentum/trend/breakout traders see the market’s “regime” at a glance, get clean flip signals, manage risk with clear SL/TP rails, and scan a small symbol list for fresh flips.
________________________________________________________________________
Why this exists
Most tools do one thing (only a moving average, only a VWAP, only a “flip” line). This indicator stitches together the pieces momentum & breakout traders actually use day-to-day, so you can:
Read trend bias fast (multi-TF dashboard).
Act on ATR-based flips (UT core).
Filter noise (volume/ADX/RSI/Donchian).
Place/maintain SL/TP rails visually.
Scan up to 15 symbols for fresh flips and alert them.
No magic, no promises — just practical structure designed to reduce second-guessing.
________________________________________________________________________
What’s unique here
UT Flip Signals: An ATR trailing stop that flips when price convincingly crosses it.
Modular Moving Averages: Choose EMA/SMA/WMA/VWMA/RMA/HMA independently for Fast/Medium/Long. Logic respects your choices (crosses, bias rows, floors).
VWAP with Weighted Bands: Session or anchored to Week/Month/Quarter/Year/Earnings/Dividends/Splits, with Standard-Deviation or % bands.
ZLSMA (optional): Zero-lag flavor of LSMA as a smooth trend line (plot-only).
Supertrend with Dynamic Thickness: Optional overlay where line width scales with normalized strength for quick “how strong?” reading.
Base LONG/SHORT with Filters: You can require Relative Volume, ADX/DI alignment, RSI pullback windows, and/or Donchian breaks.
Multi-Time Frame Bias Dashboard: Rows for MA cross, Price>Long MA, VWAP, MACD, Supertrend, ZLSMA, RSI-in-zone, ADX≥min across 1m→4h with AVG column.
UT Watchlist Scanner: Scan up to 15 symbols. Shows recent flips for a user-set TTL minutes, with optional one-per-day alert throttling.
________________________________________________________________________
Quick start (3 minutes)
Pick your MA types . Simple baseline: Fast=EMA , Medium=EMA , Long=SMA(200) .
Decide on UT sensitivity : start with ATR Period 7–10 and Key 1.5–2.0 .
Tight markets → lower Key; choppy → higher Key.
Enable VWAP if you trade intraday; try Session anchor with 1×/2× bands.
Optionally switch on filters : Relative Volume, ADX/DI, RSI pullback, or Donchian break.
Open the Bias Table to see agreement across timeframes.
Use Suggested Stop Loss + optional Trailing Stop , plus TP R-levels for exits.
________________________________________________________________________
Inputs overview
Moving Averages: Choose type per lane (Fast/Medium/Long) + lengths. Used for crosses, bias table and SL floors.
UT Bot: ATR-based trailing stop that flips on cross; optional %-change, swing and 2-bar delay filters.
VWAP: Session or higher-level anchors; optional bands by Std-Dev or Percentage.
ZLSMA: Plot-only zero-lag LSMA line (trend context).
Supertrend: Standard ST with optional dynamic-thickness overlay and neutral windows after a flip.
Filters: Relative Volume, ADX/DI, RSI Pullback window, Donchian breakout.
Risk Tools: Suggested Stop Loss rails (layered floors/ceilings), optional trailing stop (Chandelier ATR or Follow UT), and Take Profit R-levels (1, 1.5, 2, 3).
Bias Dashboard: Toggle rows/position/size, background color, and which metrics to show across Time Frames.
UT Watchlist Scanner: Up to 15 symbols; dedupes; TTL minutes; one-per-day throttle.
________________________________________________________________________
How to read the chart
Green UT bars/Buy label: Price above UT stop with a fresh flip (and optional filters passed). Think “momentum turning up.”
Orange UT bars/Sell label: Price below UT stop with a fresh flip. Think “momentum turning down.”
Bias rows: More green cells across TFs = broader alignment; the AVG column summarizes each row.
Supertrend width: Thicker = stronger move (normalized by ATR).
VWAP & bands: Price relative to VWAP shows mean-reversion vs. trend. Bands help gauge stretch.
________________________________________________________________________
Alerts you can set
UT Bot — Buy/Sell: Fires when a flip occurs on the chart symbol/TF.
Base Long/Short: MA cross plus any filters you enabled.
Watchlist UT table status change: Notifies when the watchlist table receives new hits on the current bar. You can also enable “runtime alert” inside the scanner and/or throttle to one per symbol per day.
________________________________________________________________________
FAQ (short)
Does this repaint? No — signals are computed without lookahead. Flips confirm on the bar that crosses the UT stop under your active filters.
Can I use Heikin Ashi visuals? You can plot HA candles on your chart if you want, but the script’s logic stays on regular candles to respect publishing rules.
Why is my scanner empty? Check TTL minutes, list formatting, and that each symbol is valid for your data plan.
________________________________________________________________________
Hero (top): Full chart view showing UT flip, MAs, VWAP bands, Supertrend, and SL/TP rails.
Bias Table (mid): Cropped table with multiple rows enabled and a few green cells across TFs.
UT Flip Close-up (mid): Zoom on a Buy/Sell label with colored bars and the UT line.
VWAP Bands (mid): Zoom on VWAP + 1×/2× or % bands.
Settings (bottom): Screenshot of MA types + UT sensitivity tooltips, and the Watchlist input showing comma/space/newline list.
KA_anualKA_anual — Annual Open % Levels
KA_anual plots the current year’s opening price and fixed percentage bands every 10% up to ±130%. The levels update automatically at the first bar of each new year. Lines are tied to the price scale and shown only for the current year, so they move with your chart without cluttering past history. Use them to gauge momentum, potential support/resistance, and stretch zones at a glance. Works on any symbol and timeframe; no inputs required.
SMC Mapping 2.0“This script is a Smart Money Concepts (SMC) indicator that helps traders identify market structure shifts such as Break of Structure (BOS) and Change of Character (ChoCH). It also highlights Supply & Demand zones, Internal/External Liquidity sweeps, and IDM levels.
The tool is designed for price action traders who want a clean and visual way to track BOS, ChoCH, and liquidity points directly on their chart. It is fully customizable with options to show/hide different elements, change colors, and adjust sensitivity.”
🔹 Script Overview
This script is based on Smart Money Concepts (SMC).
It automatically identifies Break of Structure (BOS), Change of Character (ChoCH), Supply & Demand zones, and IDM zones on the chart.
🔹 Features
Market Structure Detection → plots HH (Higher Highs) and LL (Lower Lows)
BOS & ChoCH → quickly identify trend shifts
Auto Supply & Demand Zones → highlights potential reversal areas
IDM Zones → marks imbalance/inefficiency
Clear color-coded visuals for bullish/bearish context
🔹 How It Works
The script evaluates recent swing highs and lows (20-bar lookback by default)
When price breaks above the recent high → Bullish BOS
When price breaks below the recent low → Bearish BOS
Based on this structure, the script automatically generates labels and zones
🔹 How To Use
Add the script to your chart (works well on 15m, 1H, 4H timeframes)
Use HH/LL labels to read the market structure
Supply & Demand zones help in identifying possible entry/exit points
IDM zones confirm imbalance areas for trade validation
🔹 Note
While this script uses classic concepts (HH, LL, Supply/Demand, IDM), the calculations, visuals, and styling are customized to provide a fresh and unique tool for traders. It is designed to help traders clearly see market structure and plan trades accordingly.
Reference TimesThe theory behind this indicator is that sometime the graph will change its direction at a point that is the point it reached at that weekday on that time in the previous weeks. If you can easily see what happened a few weeks ago on this day's weekday and a half an hour from now, you might theoretically gain more assurance as to where the graph might go in the next half an hour.
This of course relies of the premise that some traders choose to enter or exit positions according to historical times they are referencing. Hence the name - Reference times.
Example:
it is now 08:00 ET Wednesday. I want to guess what the graph will do in half an hour. I enter in the indicator the weekday "Wednesday", the time "8:30", and go to 30 minute candles.
I will then see all the candles the graph has been on historical Wednesdays at 8:30. If the candles are below the 08:00 price, we might guess that the graph might want to descent. If they are above the graph, we would guess the graph might want to ascend.
How it works:
The user defines a weekday and time he wants to inquire on.
The script searches for past weekdays and similar hours.
It marks these bars at their wicks.
The user can also inquire "opposite hours" - 12 hours ahead or earlier.
The user can also inquire "opposite days" - Monday<->Wednesday, Tuesday<->Thursday.
In addition, the User may inquire the previous day of his selected weekday, which will mark the most recent previous day existent.
Side note: The Time zone offset is set for Jerusalem time. and so it may need future adjustment.
send debugging instances if you find any
Thank you
Assaf Fogelman 2025
OG OHLC MarkerDraws, OHLC for Previous day and Today with options to add alerts when any PD Array is swept
Iani SMC Sniper XAU v2.2 (Long+Short + News Countdown, v6)Iani SMC Sniper XAU (v2.2) — smart-money logic for XAUUSD.
This indicator hunts “sniper entries” using a simple SMC sequence:
Sweep → BOS → 50% FVG entry
• After London session builds its range, we wait for a liquidity sweep (price dips below London Low for longs / wicks above London High for shorts).
• A BOS confirms direction (close breaks the last swing).
• First FVG that prints after BOS gives the entry at 50% (mid-gap).
• SL anchored to the protective swing (with a small safety buffer). TP is plotted using your Risk:Reward.
News countdown (non-blocking):
The script does not auto-fetch news; you set daily times (e.g., 14:30, 16:00) and/or specific dates (“YYYY-MM-DD HH:MM”). A countdown label shows “NEWS in Xm”. Signals are not blocked—this is just a safety heads-up for prop-firm rules.
Inputs: pivot length, RR, pip size (XAU default 0.10), session filter (after London), news times (recurring & absolute), show/hide levels & labels.
Plots & labels: London High/Low (daily), Entry/SL/TP lines, BOS/Sweep/BUY/SELL markers, news badge.
Alerts: BOS Bull/Bear, BUY/SELL Entry touch, TP/SL hit, NEWS WARNING.
Notes:
• Designed for XAUUSD intraday; works on other symbols if you adjust pip size.
• Uses symbol timezone; adjust your news times for DST if needed.
• Indicator only—no orders, no backtest. Manage risk and execution in MT5/your platform.
Changelog (v2.2): Pine v6, robust time parsing, one-line logical expressions (fixed EOL errors), mirrored short logic, cleaner London H/L reset, countdown label.
Disclaimer: Educational tool, not financial advice. Past performance ≠ future results.
Tags: SMC, ICT, XAUUSD, Gold, Liquidity Sweep, BOS, FVG, London Session, News, Intraday, Scalping, DayTrading.
PSDIGreen Zone → Potential Buy Area
Price is near support.
Red Zone → Potential Sell Area
Price is near resistance.
EMA Lines
Blue (EMA50) above Orange (EMA200): Trend up → favors buys.
Blue below Orange: Trend down → favors sells.
How to Use
Look at zones and trend.
Price near green + trend up → consider long.
Price near red + trend down → consider short.
NOTE: When in uptrend, only follow green zones. When in down trend only follow red zones.
BLOCK CHARTING GROUPED ALPHATREND V4BLOCK CHARTING GROUPED ALPHATREND V4 — Script Summary
Created by ChalkBoardAnalytics
Overview
This advanced multi-tool indicator combines Block Charting, Ghost Candles, Volume Spike/Dump Detection, and a fully customizable AlphaTrend system with dashboard tables. Designed for traders who want deep market structure insights, trend signals, and visual clarity.
Key Features
1. Block Charting
Divides price action into blocks (user-defined bar count).
Automatically detects and labels block patterns (like CAPOUT, DIP, DROP, DUMP, FLAT, CAPIN, LIFT, PUMP, SPIKE).
Draws block highs/lows, vertical boundaries, and live formation labels for current/incomplete blocks.
Color-codes patterns for quick visual analysis.
Block dashboard table shows last signal, prices, averages, and live pattern.
2. Moving Averages
Customizable fast/slow moving averages (SMA, EMA, WMA, RMA).
Buy/Sell signals based on MA crossovers.
Plots all moving averages for clarity.
3. Ghost Candle Overlay
Shows a “ghost” candle based on price/volume averages for the last N bars.
Volume-weighted option for more accuracy.
Dynamic transparency based on volume spikes.
Alerts for high volume events.
4. Volume Spike/Dump Sensor
Detects and labels volume spikes/dumps (both bullish and bearish).
Alerts for unusual volume activity.
5. AlphaTrend System
Customizable AlphaTrend lines (classic trend-following logic).
Trend direction determined by majority voting of selected signals:
RSI (threshold-based)
MFI (threshold-based)
Difference between two moving averages (user-selected lengths and type; replaces MACD logic)
Plots AlphaTrend and AlphaTrend lines with area fill.
Buy/Sell signals when AlphaTrend crosses AlphaTrend .
AlphaTrend dashboard table displays price, signals, ATR, and recent trend info.
6. Dashboard Tables
Two tables: Block Charting and AlphaTrend.
Show current signals, prices, averages, and recent trend signals.
Location is user-selectable.
Customization & Settings
Block size, colors, and line styles
MA types and lengths
Pattern label display switches
Ghost candle lookback and volume weighting
Volume spike/dump sensitivity
AlphaTrend period, coefficient, and signal voting
Table location and display options
Usage
Overlay on any chart or timeframe
Use block patterns for market structure analysis
Follow MA crossovers and AlphaTrend signals for entries/exits
Spot volume spikes/dumps and ghost candle anomalies
Monitor dashboard tables for quick decision-making
Alerts
Volume spike/dump alerts
AlphaTrend buy/sell alerts
How is this different?
Combines multiple professional-grade tools into one script
Block patterns are unique to this indicator
AlphaTrend voting is customizable and not limited to MACD
Two live dashboards for instant market overview
MTF Supply and Demand Zones [MMT]Description
The MTF Supply and Demand Zones indicator is a powerful tool designed to identify and display supply and demand zones across multiple timeframes (MTF) on your TradingView chart. These zones highlight key areas where price is likely to react, based on significant price movements in higher timeframes. The indicator is highly customizable, allowing traders to adjust zone strength, timeframes, colors, and display settings to suit their trading style.
Key Features
Multi-Timeframe Analysis : Detects supply and demand zones from up to five user-defined timeframes (e.g., 30m, 1H, 4H, 1D, 1W).
Zone Strength Filter : Filters zones based on the strength of price movements, ensuring only significant zones are displayed.
Customizable Display : Toggle supply and demand zones on/off, adjust colors, border styles, and label settings for clarity.
Dynamic Zone Extension : Extends zones to the right of the chart for better visibility, with adjustable extension length.
Zone Cleanup : Automatically removes zones when price breaks through them, keeping the chart clean and relevant.
Labels : Displays timeframe labels on zones for easy identification, with customizable size, color, and alignment.
How It Works
Supply Zones : Identified when a strong bearish candle follows a bullish or neutral candle, indicating potential selling pressure.
Demand Zones : Identified when a strong bullish candle follows a bearish or neutral candle, indicating potential buying pressure.
Zones are drawn as boxes, with the top and bottom based on key price levels (e.g., highs/lows or open prices).
The indicator uses a strength filter to ensure only significant zones (based on candle size ratios) are plotted.
Zones are updated dynamically, extending to the right by a user-defined number of bars and removed when price breaks through them.
Settings
S&D Zones Settings
Zone Strength Filter : Adjust the minimum candle size ratio (default: 1.8) to filter weaker zones.
Show Supply/Demand : Enable or disable supply and/or demand zones.
Supply/Demand Colors : Customize the fill and border colors for supply (default: red) and demand (default: green) zones.
Timeframes : Enable up to five timeframes (e.g., 30m, 1H, 4H, 1D, 1W) to analyze zones. Only zones from timeframes higher than the chart’s timeframe are displayed.
Display Settings
Zone Extension : Set how far zones extend to the right (in bars, default: 15).
Show Label: Toggle timeframe labels on zones.
Label Style : Customize label color, size (tiny, small, normal, large, huge), and alignment (horizontal/vertical).
Usage Tips
Use higher timeframes (e.g., 4H, 1D) for stronger, more reliable zones.
Combine with other indicators (e.g., support/resistance, trendlines) to confirm trade setups.
Adjust the Zone Strength Filter to reduce noise in volatile markets.
Enable labels to quickly identify the timeframe of each zone.
Notes
The indicator is overlayed on the price chart and supports up to 500 zones.
Zones are removed when price breaks above (supply) or below (demand), ensuring only active zones remain.
Works best on markets with clear price action, such as futures, forex, stocks, or cryptocurrencies.
Happy trading! 🚀
Higher High Lower Low Higher High Lower Low 🦉{Phanchai} — TradingView Description
Structure detector with dynamic Support/Resistance, customizable labels, and ready-made alerts (Pine v6).
This script marks market structure turning points — HH (Higher High), HL (Higher Low), LH (Lower High), LL (Lower Low) — and builds segmented Support/Resistance lines from those turns. Labels and colors are fully customizable and the script ships with multiple alert conditions.
What it does
Detects swing pivots using left/right bar windows, then classifies each confirmed swing as HH/HL/LH/LL.
Plots compact labels at the confirmed pivot bars with tooltips (English).
Derives dynamic Support / Resistance : every time structure flips, the previous level is closed and a new segment starts, extending to the right .
Provides alert conditions for any label and for specific first-occurrence shifts (e.g., first HH after a bearish label).
How it works (in short)
A pivot high/low confirms only after Right Bars candles have closed; labels and S/R appear at that confirmation bar.
An internal backbone (zigzag-like) is built from confirmed pivots, with light consistency checks to avoid contradictory sequences.
Structure rules compare the recent five pivots (A…E) to decide HH/HL/LH/LL.
S/R is updated from structure: e.g., in an up leg, new HLs refresh Support; in a down leg, new LHs refresh Resistance.
Alerts included
Any structure label (HH/HL/LH/LL) — Fires on any new label.
First LL after HL/HH — First bearish break after a bullish label.
First HH after LL/LH — First bullish break after a bearish label.
LL or HL formed — Any low-side label.
LH or HH formed — Any high-side label.
HL formed
HH formed
LL formed
LH formed
How to use (quick start)
Add the indicator to your chart.
Choose Left/Right Bars for your timeframe (e.g., 5–10 for intraday; larger for higher timeframes).
Pick your label colors/sizes and S/R style.
Right-click the chart → Add alert… → Condition: this indicator → select the desired alert.
Notes & tips
Because pivots require Right Bars to confirm, labels and S/R appear with a natural delay of that many bars. This avoids repainting.
Raising Left/Right Bars reduces noise and increases the average distance between pivots; lowering them increases sensitivity.
Structure is strict: sometimes you may see two HL (or two LH) in a row if the intermediate opposite swing didn’t qualify as HH/LH (or LL/HL).
S/R segments are drawn with line objects ; they are controlled via Inputs (style/width/color), not the Style tab.
This tool highlights structure; it’s not a standalone entry/exit system. Combine with volume, trend, or risk management rules.
Built with Pine v6. Clean, compact labels; segmented S/R that updates only on confirmed changes; comprehensive alerts ready for automation.
BSL/SSL Sweep + FVG Strategy Jobin (c) The New York ATM Model is a structured intraday strategy designed to capture algorithmic stop-hunts and reversals during the New York session open. It focuses on liquidity sweeps—either Buy-Side or Sell-Side—followed by a confirmation using Fair Value Gaps (FVGs).
📊 RSI Swing Reversal Strategy with Volume Spike FilterHi , i did test that on Hbar time frame 5min. please let me know if i did miss something .85% win rate. please get back test.
What Will This Strategy Do?
Use RSI cross over/under its MA + Swing High/Low + optional Trend Filter.
Enter long on bullish signals.
Enter short on bearish signals.
Exit on opposite signals or optional take-profit/stop-loss.
ZigZag++ + 4 EMA89 Trend Candles + BUY/SELL LabelsThis script combines ZigZag patterns, EMA89 trend detection, and custom buy/sell scalp signals. It helps identify trend direction and potential entry points in trending markets.
Features:
- ZigZag structure points
- EMA89 as dynamic trend filter
- Buy/Sell scalp markers
- HL/HH swing labels
- Works best on 15m–4h timeframes
EITS - Market StructureThis script marks the Swing Lows and Highs of a chosen pair. H,HH,L,LL,HL,LH will be marked on chart. Have fun!!
PRIMO+ (dc_77)PRIMO+ (dc_77) - Advanced Multi-Session Trading System
Overview
This comprehensive trading indicator combines market structure analysis, Fair Value Gap (FVG) detection, and multi-timeframe bias assessment to identify high-probability trading opportunities during key market sessions. The system operates on a sophisticated framework that evaluates market sentiment across multiple reference points and provides complete trade management projections.
Core Features
Multi-Timeframe Bias System
The indicator establishes directional bias by analyzing price action relative to four critical reference points:
- 18:00 NY Open: Previous day's market opening level
- 00:00 Midnight: Daily reset reference price
- 09:30 NY Open: Current session market opening
- 09:45 NY Open: Key institutional entry timeframe
Bias Logic:
- LONGS Bias: Price trading below ALL reference levels (institutional accumulation zone)
- SHORTS Bias: Price trading above ALL reference levels (institutional distribution zone)
- BEWARE: Mixed signals across reference points (avoid trading)
Four-Session Architecture
The system monitors four distinct trading sessions, each representing different market participant activities:
1. Session 1 (09:45-10:20): London/NY overlap - high liquidity period
2. Session 2 (10:45-11:30): NY continuation - institutional positioning
3. Session 3 (13:50-14:10): Pre-close positioning - smart money moves
4. Session 4 (15:50-16:05): Market close - final institutional plays
Each session can be individually enabled/disabled with custom time ranges.
Advanced Fair Value Gap Detection
The indicator identifies three-candle imbalances using sophisticated filtering:
FVG Classification:
- Bullish FVGs: Gaps between candle 3 high and candle 1 low (upward imbalance)
- Bearish FVGs: Gaps between candle 1 high and candle 3 low (downward imbalance)
Dynamic Filtering System:
- Bias alignment filtering (only shows FVGs aligned with overall market bias)
- Trend direction filtering (FVGs must align with market structure)
- Session-based activation/deactivation
- Real-time gap validation and invalidation
Market Structure Shift (MSS) Detection
Proprietary swing-based algorithm identifies significant market structure changes:
- Bullish MSS: Price breaks above previous significant high with trend confirmation
- Bearish MSS: Price breaks below previous significant low with trend confirmation
- Dynamic Lookback: Configurable swing detection sensitivity (4-5 bar pivots)
Comprehensive Risk Management System
When conditions align, the indicator projects complete trade setups:
Entry Methodology:
- FVG center point calculated using mathematical precision
- Entry triggered only when MSS occurs with aligned bias
- Confirmation timer prevents false signals (22-second default validation)
Stop Loss Calculation:
- Dynamic SL placement based on FVG displacement
- 1.15x multiplier applied to gap distance for optimal risk positioning
- Adaptive to market volatility and gap size
Take Profit Projections:
- Five sequential TP levels (1:1 through 1:5 risk-reward ratios)
- Mathematical progression based on initial risk calculation
- Visual projection lines extend into future bars
Visual Signal System
Trade Signals:
- Green up arrows for bullish setups (positioned below stop loss level)
- Red down arrows for bearish setups (positioned above stop loss level)
- Optional date stamps showing signal generation time
Projection Lines:
- Entry level (gray dotted line)
- Stop loss level (red line)
- Multiple take profit levels (green lines with ratio labels)
- Customizable line styles and widths
Alert Integration
Real-time notifications when complete setups form:
- Bar-close confirmation prevents false alerts
- Separate bull/bear alert messages
- Integration with TradingView's alert system
- Optional sound notifications
Configuration Options
Display Settings
- Session Anchor Lines: Visual markers for session starts
- MSS Lines: Market structure shift visualization
- Trend Lines: ZigZag pattern display
- Signal Arrows: Entry point indicators
- Date Labels: Timestamp display for signals
Color Customization
- Bullish FVG color and transparency
- Bearish FVG color and transparency
- MSS line colors (separate bull/bear)
- Projection line colors
- Stop loss and take profit colors
Risk Parameters
- Confirmation time adjustment (prevents false signals)
- Risk-reward multiplier customization
- Projection line extension length
- Label and arrow size options
Usage Guidelines
Trading Sessions
Best performance during specified session times when institutional activity is highest. The system automatically adjusts for New York timezone.
Entry Criteria
All conditions must align for signal generation:
1. Appropriate market bias established
2. FVG present and validated within session
3. Market structure shift in aligned direction
4. Confirmation timer validation passed
Risk Management
- Always respect projected stop loss levels
- Consider partial profit-taking at projected TP levels
Important Disclaimers
This indicator is for educational and analytical purposes. All trading involves risk, and past performance does not guarantee future results. Users should:
- Practice proper risk management
- Backtest thoroughly before live trading
- Understand all system components before use
- Never risk more than affordable loss amounts
The system provides analysis tools and projections but does not guarantee profitable trades. Market conditions change rapidly, and no indicator can predict future price movements with certainty.
Additional Risk Warnings and Disclaimers
Trading Addiction and Mental Health: Trading can become psychologically addictive and may lead to compulsive behavior, financial ruin, and severe emotional distress. If you find yourself unable to stop trading, risking money you cannot afford to lose, neglecting personal relationships or responsibilities, or experiencing extreme emotional swings based on trading outcomes, please seek help from a qualified mental health professional. The excitement of potential profits can mask serious underlying issues with impulse control and risk-taking behavior.
No Guarantee of Performance: This indicator has not been independently verified or audited. Backtesting results may not reflect actual trading conditions due to market slippage, execution delays, spread variations, and changing market dynamics. Historical performance is not indicative of future results, and all trading strategies can and do lose money.
Market Risk Acknowledgment: Financial markets can experience extreme volatility, flash crashes, liquidity crises, and unprecedented events that render technical analysis ineffective. Economic announcements, geopolitical events, and central bank policies can cause rapid price movements that invalidate technical setups instantly.
Position Sizing and Capital Preservation: Never risk more than 1-2% of your total account on any single trade. Proper position sizing is more important than any trading signal. Multiple consecutive losses are normal and expected - ensure your account can withstand extended drawdown periods without impairing your ability to continue trading or meet personal financial obligations.
Educational Purpose Only: This tool is designed for educational analysis and should not be construed as personalized financial advice. Consult with qualified financial advisors before making investment decisions. The creators assume no responsibility for any financial losses incurred through use of this indicator.
FiniteStateMachine🟩 OVERVIEW
A flexible framework for creating, testing and implementing a Finite State Machine (FSM) in your script. FSMs use rules to control how states change in response to events.
This is the first Finite State Machine library on TradingView and it's quite a different way to think about your script's logic. Advantages of using this vs hardcoding all your logic include:
• Explicit logic : You can see all rules easily side-by-side.
• Validation : Tables show your rules and validation results right on the chart.
• Dual approach : Simple matrix for straightforward transitions; map implementation for concurrent scenarios. You can combine them for complex needs.
• Type safety : Shows how to use enums for robustness while maintaining string compatibility.
• Real-world examples : Includes both conceptual (traffic lights) and practical (trading strategy) demonstrations.
• Priority control : Explicit control over which rules take precedence when multiple conditions are met.
• Wildcard system : Flexible pattern matching for states and events.
The library seems complex, but it's not really. Your conditions, events, and their potential interactions are complex. The FSM makes them all explicit, which is some work. However, like all "good" pain in life, this is front-loaded, and *saves* pain later, in the form of unintended interactions and bugs that are very hard to find and fix.
🟩 SIMPLE FSM (MATRIX-BASED)
The simple FSM uses a matrix to define transition rules with the structure: state > event > state. We look up the current state, check if the event in that row matches, and if it does, output the resulting state.
Each row in the matrix defines one rule, and the first matching row, counting from the top down, is applied.
A limitation of this method is that you can supply only ONE event.
You can design layered rules using widlcards. Use an empty string "" or the special string "ANY" for any state or event wildcard.
The matrix FSM is foruse where you have clear, sequential state transitions triggered by single events. Think traffic lights, or any logic where only one thing can happen at a time.
The demo for this FSM is of traffic lights.
🟩 CONCURRENT FSM (MAP-BASED)
The map FSM uses a more complex structure where each state is a key in the map, and its value is an array of event rules. Each rule maps a named condition to an output (event or next state).
This FSM can handle multiple conditions simultaneously. Rules added first have higher priority.
Adding more rules to existing states combines the entries in the map (if you use the supplied helper function) rather than overwriting them.
This FSM is for more complex scenarios where multiple conditions can be true simultaneously, and you need to control which takes precedence. Like trading strategies, or any system with concurrent conditions.
The demo for this FSM is a trading strategy.
🟩 HOW TO USE
Pine Script libraries contain reusable code for importing into indicators. You do not need to copy any code out of here. Just import the library and call the function you want.
For example, for version 1 of this library, import it like this:
import SimpleCryptoLife/FiniteStateMachine/1
See the EXAMPLE USAGE sections within the library for examples of calling the functions.
For more information on libraries and incorporating them into your scripts, see the Libraries section of the Pine Script User Manual.
🟩 TECHNICAL IMPLEMENTATION
Both FSM implementations support wildcards using blank strings "" or the special string "ANY". Wildcards match in this priority order:
• Exact state + exact event match
• Exact state + empty event (event wildcard)
• Empty state + exact event (state wildcard)
• Empty state + empty event (full wildcard)
When multiple rules match the same state + event combination, the FIRST rule encountered takes priority. In the matrix FSM, this means row order determines priority. In the map FSM, it's the order you add rules to each state.
The library uses user-defined types for the map FSM:
• o_eventRule : Maps a condition name to an output
• o_eventRuleWrapper : Wraps an array of rules (since maps can't contain arrays directly)
Everything uses strings for maximum library compatibility, though the examples show how to use enums for type safety by converting them to strings.
Unlike normal maps where adding a duplicate key overwrites the value, this library's `m_addRuleToEventMap()` method *combines* rules, making it intuitive to build rule sets without breaking them.
🟩 VALIDATION & ERROR HANDLING
The library includes comprehensive validation functions that catch common FSM design errors:
Error detection:
• Empty next states
• Invalid states not in the states array
• Duplicate rules
• Conflicting transitions
• Unreachable states (no entry/exit rules)
Warning detection:
• Redundant wildcards
• Empty states/events (potential unintended wildcards)
• Duplicate conditions within states
You can display validation results in tables on the chart, with tooltips providing detailed explanations. The helper functions to display the tables are exported so you can call them from your own script.
🟩 PRACTICAL EXAMPLES
The library includes four comprehensive demos:
Traffic Light Demo (Simple FSM) : Uses the matrix FSM to cycle through traffic light states (red → red+amber → green → amber → red) with timer events. Includes pseudo-random "break" events and repair logic to demonstrate wildcards and priority handling.
Trading Strategy Demo (Concurrent FSM) : Implements a realistic long-only trading strategy using BOTH FSM types:
• Map FSM converts multiple technical conditions (EMA crosses, gaps, fractals, RSI) into prioritised events
• Matrix FSM handles state transitions (idle → setup → entry → position → exit → re-entry)
• Includes position management, stop losses, and re-entry logic
Error Demonstrations : Both FSM types include error demos with intentionally malformed rules to showcase the validation system's capabilities.
🟩 BRING ON THE FUNCTIONS
f_printFSMMatrix(_mat_rules, _a_states, _tablePosition)
Prints a table of states and rules to the specified position on the chart. Works only with the matrix-based FSM.
Parameters:
_mat_rules (matrix)
_a_states (array)
_tablePosition (simple string)
Returns: The table of states and rules.
method m_loadMatrixRulesFromText(_mat_rules, _rulesText)
Loads rules into a rules matrix from a multiline string where each line is of the form "current state | event | next state" (ignores empty lines and trims whitespace).
This is the most human-readable way to define rules because it's a visually aligned, table-like format.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_rulesText (string)
Returns: No explicit return. The matrix is modified as a side-effect.
method m_addRuleToMatrix(_mat_rules, _currentState, _event, _nextState)
Adds a single rule to the rules matrix. This can also be quite readble if you use short variable names and careful spacing.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_currentState (string)
_event (string)
_nextState (string)
Returns: No explicit return. The matrix is modified as a side-effect.
method m_validateRulesMatrix(_mat_rules, _a_states, _showTable, _tablePosition)
Validates a rules matrix and a states array to check that they are well formed. Works only with the matrix-based FSM.
Checks: matrix has exactly 3 columns; no empty next states; all states defined in array; no duplicate states; no duplicate rules; all states have entry/exit rules; no conflicting transitions; no redundant wildcards. To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the rules and states are ready.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_a_states (array)
_showTable (bool)
_tablePosition (simple string)
Returns: `true` if the rules and states are valid; `false` if errors or warnings exist.
method m_getStateFromMatrix(_mat_rules, _currentState, _event, _strictInput, _strictTransitions)
Returns the next state based on the current state and event, or `na` if no matching transition is found. Empty (not na) entries are treated as wildcards if `strictInput` is false.
Priority: exact match > event wildcard > state wildcard > full wildcard.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_currentState (string)
_event (string)
_strictInput (bool)
_strictTransitions (bool)
Returns: The next state or `na`.
method m_addRuleToEventMap(_map_eventRules, _state, _condName, _output)
Adds a single event rule to the event rules map. If the state key already exists, appends the new rule to the existing array (if different). If the state key doesn't exist, creates a new entry.
Namespace types: map
Parameters:
_map_eventRules (map)
_state (string)
_condName (string)
_output (string)
Returns: No explicit return. The map is modified as a side-effect.
method m_addEventRulesToMapFromText(_map_eventRules, _configText)
Loads event rules from a multiline text string into a map structure.
Format: "state | condName > output | condName > output | ..." . Pairs are ordered by priority. You can have multiple rules on the same line for one state.
Supports wildcards: Use an empty string ("") or the special string "ANY" for state or condName to create wildcard rules.
Examples: " | condName > output" (state wildcard), "state | > output" (condition wildcard), " | > output" (full wildcard).
Splits lines by , extracts state as key, creates/appends to array with new o_eventRule(condName, output).
Call once, e.g., on barstate.isfirst for best performance.
Namespace types: map
Parameters:
_map_eventRules (map)
_configText (string)
Returns: No explicit return. The map is modified as a side-effect.
f_printFSMMap(_map_eventRules, _a_states, _tablePosition)
Prints a table of map-based event rules to the specified position on the chart.
Parameters:
_map_eventRules (map)
_a_states (array)
_tablePosition (simple string)
Returns: The table of map-based event rules.
method m_validateEventRulesMap(_map_eventRules, _a_states, _a_validEvents, _showTable, _tablePosition)
Validates an event rules map to check that it's well formed.
Checks: map is not empty; wrappers contain non-empty arrays; no duplicate condition names per state; no empty fields in o_eventRule objects; optionally validates outputs against matrix events.
NOTE: Both "" and "ANY" are treated identically as wildcards for both states and conditions.
To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the map is ready.
Namespace types: map
Parameters:
_map_eventRules (map)
_a_states (array)
_a_validEvents (array)
_showTable (bool)
_tablePosition (simple string)
Returns: `true` if the event rules map is valid; `false` if errors or warnings exist.
method m_getEventFromConditionsMap(_currentState, _a_activeConditions, _map_eventRules)
Returns a single event or state string based on the current state and active conditions.
Uses a map of event rules where rules are pre-sorted by implicit priority via load order.
Supports wildcards using empty string ("") or "ANY" for flexible rule matching.
Priority: exact match > condition wildcard > state wildcard > full wildcard.
Namespace types: series string, simple string, input string, const string
Parameters:
_currentState (string)
_a_activeConditions (array)
_map_eventRules (map)
Returns: The output string (event or state) for the first matching condition, or na if no match found.
o_eventRule
o_eventRule defines a condition-to-output mapping for the concurrent FSM.
Fields:
condName (series string) : The name of the condition to check.
output (series string) : The output (event or state) when the condition is true.
o_eventRuleWrapper
o_eventRuleWrapper wraps an array of o_eventRule for use as map values (maps cannot contain collections directly).
Fields:
a_rules (array) : Array of o_eventRule objects for a specific state.