Penunjuk

Inside Bar [scriptedge]Overview
Inside Bar looks for a higher timeframe candle that trades entirely within the range of the one before it. Throughout this description the larger candle is called the mother candle , the contained one is the inside bar , and the one that follows is the trading candle .
The indicator is designed so that the whole setup can be visualised from the lower timeframe you intend to trade. The higher timeframe is read in the background and its structure is drawn onto your chart, so there is no need to switch timeframes to see where the range sits or how the trading candle is developing.
The tool draws structure and context. It does not generate buy or sell signals, and it does not manage entries, exits, stops, or position size. Those decisions are left to the trader.
The Higher Timeframe Pattern
An inside bar is a two candle pattern. The second candle's high is at or below the first candle's high, and its low is at or above the first candle's low — the whole candle sits within the range of the one before it. That is compression. Range has contracted, and unlike most patterns it carries no direction of its own. Both boundaries of the mother candle are live, and the market decides which one matters.
What Gets Drawn
Once the inside bar closes, the mother candle's high and low are drawn as solid lines. These are the levels a break has to clear, and they are what almost every published treatment of this pattern uses for entries and stops.
A shaded box spans the compression itself: from the mother candle through every inside bar, ending where the trading candle opens. The box shows the coil, the lines carry the levels forward through the trading candle.
Two target lines are projected at one times the mother candle's range, one above the high and one below the low. This is the measured move, the conventional objective for a range break. They are drawn from the trading candle's open, since that is when a target first becomes relevant. Every line stops when price trades through it, or when the trading candle ends, whichever comes first.
Nested Inside Bars
Inside bars often arrive in runs. When the trading candle turns out to be another inside bar — still entirely within the mother's range — the coil has not resolved, so nothing is reset. The mother candle's levels stay exactly where they are, the box extends, and the next candle takes over as the trading candle. A label on the box counts the inside bars whenever there is more than one, so a deep coil is visible at a glance.
Higher Timeframe Panel
The mother candle, every inside bar and the trading candle are redrawn to the right of the live chart, with the mother's levels marked across them. The trading candle updates live. On a long coil the mother candle is often well off the left of your screen. The panel is what lets you see the whole pattern without scrolling or switching timeframes.
Stats Dashboard
The table counts how past breaks on the selected higher timeframe resolved. A break is recorded the moment price trades outside the mother candle's range during the trading candle.
Breakout — after breaking, price reached the target before reaching the opposite boundary.
Failed breakout — after breaking, price reached the opposite boundary first.
Those two levels sit exactly one mother range either side of the break, so this is a symmetrical test rather than an arbitrary pairing.
A trading candle can break both boundaries, in which case both breaks are counted separately with their own outcomes. Breaks that have not yet resolved are excluded until they do, and setups still coiling are not counted at all, so the two percentages always sum to one hundred.
There is deliberately no win rate here. A failed breakout is a losing outcome to one trader and the entire premise to another, and it is not the indicator's place to decide which.
Please read this table for what it is. It is a count of what price did on the bars loaded in your chart. It is not a backtest and not a strategy report. No entry price, exit price, stop, commission, or slippage is assumed, because the indicator does not place trades. Past behaviour of a market does not indicate future behaviour.
Settings
Chart Theme — light or dark colour palette.
Stats Dashboard — show or hide the table.
Higher Timeframe — 15m, 1h, 4h, D, W or M.
HTF Candle Separators — vertical line at each higher timeframe open.
Show Target Lines — the measured move projections.
Alerts
An alert fires the first time price trades outside the mother candle's range in each direction, with a message naming the timeframe and the side, for example 1h inside bar broken up . A trading candle that breaks both boundaries produces two alerts. To use them, create an alert on the indicator and choose Any alert() function call as the condition.
Repainting
Historical bars are never restated. Specifically:
Higher timeframe candles are built by aggregating completed chart bars, so the pattern is only known once the inside bar has closed. request.security() with lookahead is not used anywhere in the script.
Levels come from candles that have already closed. Nothing is drawn at a price that could still change.
A break occurs once price trades through a level, which cannot be undone within a bar — once price has traded outside the range it has traded outside the range.
The box and the lines extend to the right as the trading candle progresses. That is a drawing being lengthened, not a value being changed.
Limitations
The mother candle defines the levels . Some traders use the inside bar's own high and low instead, for a tighter trigger and smaller risk. This tool does not draw those.
A break is any trade outside the range, wick or close . A candle that pokes through and closes back inside counts as a break. If you think of a break as requiring a close, the counts here will run higher than you expect.
On the higher timeframe itself , target lines, the inside bar count and the stats table are not shown. There the trading candle is a single bar, which cannot say whether a break or its outcome came first. The pattern, its levels and the box are still drawn.
Above the higher timeframe , nothing is drawn. Select a chart timeframe lower than the higher timeframe setting.
The panel is capped at twelve candles . A coil deeper than that still tracks correctly, but the panel shows the mother candle and the most recent inside bars rather than all of them.
Drawing objects are capped by the platform . On very long histories the oldest drawings will drop off the chart.
The stats table depends on how much history your plan loads , so the counts will differ between account types on the same instrument.
This is an indicator, not a strategy . It offers no entries, exits, stop levels, position sizing, or risk management, and makes no claim about profitability.
Disclaimer
This script is for informational and educational purposes only. It is not financial advice and not a recommendation to buy or sell anything. Trading involves substantial risk of loss. Test any tool thoroughly and make your own decisions. Penunjuk

Volume Profile Fixed/Range [1CG]Fixed Range Volume Profile (Open Source)
This open-source indicator serves a dual purpose: it is a highly customizable, high-performance volume profile tool for traders, and it acts as the official implementation guide for developers looking to integrate the Volume Profile Library into their own indicators and strategies.
Leveraging intrabar arrays for volume accuracy, this tool provides precise Point of Control (POC) and Value Area calculations alongside box and polyline visuals.
Why This Indicator Is Necessary
The volume profile in Pine Script is not accessible programmatically. By reviewing the source code of this indicator, developers can see exactly how to integrate the library engine into their own projets:
Setup the `VolumeProfileLibrary` engine state using `var`.
Fetch 1-minute intrabar data efficiently using `request.security_lower_tf()`.
Safely pass data into the engine for accurate volume distribution.
Extract the calculated POC and Value Area levels for external logic.
Traditional vs. Polyline Rendering
This indicator breaks away from the limitations of standard histograms by offering multiple rendering modes:
Traditional (Boxes) : The classic stacked volume row display, with options to split each row into estimated buy/sell volumes and dim areas outside the Value Area.
Modern (Polylines) : Render the profile as Polylines or Curved Polylines. This modern aesthetic connects row endpoints with sleek lines and fills the internal regions with stunning spatial color gradients.
Use As An External Input Source
You do not need to fork this code to use its data! This indicator plots the most recent POC, Value Area High, and Value Area Low invisibly to the chart.
Because these plots are exposed to the Data Window, you can use this script as a direct "Source" input for other indicators and strategies in your workflow. This allows you to trigger alerts or build strategies based on exact Volume Profile levels without writing a single line of code.
Additional Features
Flexible Range Anchoring : Select between absolute ranges ('From Time', 'Between Times') or recurring windows ('Daily Anchor', 'Daily Session') that automatically reset every day.
Intrabar Accuracy : Dives into 1-minute intrabar data to distribute volume accurately within the chart's bars.
Session History : Keep historical sessions alive on the chart, allowing you to instantly visually backtest how the volume profile evolved day over day.
How to Use
Add the indicator to your chart.
Open the settings menu and configure your preferred Timezone . All fixed time pickers and session windows respect this timezone automatically.
Select your Range Mode (e.g. 'Daily Session' for the RTH open).
Customize your resolution (`Rows`), rendering styles, and gradients.
Penunjuk

Volume Profile Library [1CG]Volume Profile Library
A high-performance fixed range volume profile engine bundled with an embedded renderer. This library handles volume accumulation, core analytics (Point of Control and Value Area), and complex visual rendering natively. It features robust box and polyline display modes, handles absolute and recurring time ranges, and accepts lower-timeframe intrabar arrays to construct highly accurate volume profiles.
Supported Configurations (As Seen in Example)
By wrapping the engine in your own script, you can expose a wide array of configurations to the user. The library natively supports processing all of the following parameters:
Time zone & Range Modes : Support for 'From Time' (single anchored profile), 'Between Times', 'Daily Anchor' (recurring at a specific time), and 'Daily Session' (recurring inside a specific session).
Profile Fidelity : Configure the number of price rows (up to 49), define the Value Area percentage, and optionally split each row into estimated buy/sell volumes based on intrabar close locations.
Visual Modes : Choose between traditional 'Boxes' (stacked volume rows), 'Polylines' (straight connective bands), and 'Curved Polylines', or disable all drawings while calculations continue.
Appearance & Gradients : Natively handles coloring for bull/bear/total volume, fading volume out outside the Value Area, rendering gradient color bands within polylines, and highlighting the Range Box and Point of Control (POC) line/label.
History Retention : Retain multiple historical recurring profiles on the chart at once without constantly recalculating them.
How to Use Correctly
To use this library effectively, the consuming indicator or strategy must handle three critical tasks:
Declare Engine State : Create a persistent state instance using `var profileState = VP.createState()`. The engine requires this state to manage arrays, recycle drawings, and persist historical sessions across bars.
Allocate Limits : Because the library manages drawing native Pine boxes, lines, and polylines, your main script must provide it with a large enough budget. You must add these limits to your `indicator()` or `strategy()` declaration (e.g., `max_boxes_count = 500`, `max_polylines_count = 100`).
Fetch Intrabar Data : Pine Script restricts `request.security_lower_tf()` inside loops and libraries. You must fetch these arrays (High, Low, Close, Volume) at the global scope of your consumer script and pass them directly into `VP.update()`.
Example Integration
import OneCleverGuy/VolumeProfileLibrary/ as VP
// 1. Declare persistent state and assemble config
var VP.ProfileState profileState = VP.createState()
var VP.ProfileConfig profileConfig = VP.ProfileConfig.new()
// 2. Fetch lower-timeframe data for volume accuracy
string ltf = timeframe.in_seconds() > 60 ? "1" : timeframe.period
= request.security_lower_tf(syminfo.tickerid, ltf, )
// 3. Update the engine on every bar
profileState := VP.update(profileState, profileConfig, true, ltfHighs, ltfLows, ltfCloses, ltfVolumes)
// 4. Retrieve statistics for your own logic
= VP.getMostRecentLevels(profileState)
Important Notes
Bars without lower-timeframe coverage will automatically fall back to the chart bar's data during accumulation.
Ensure you guard against missing volume in your main script (e.g., `if not na(volume)`), as the engine strictly requires volume data to function.
Perpustakaan

Volatility Position Risk Planner [Pineify]Volatility Position Risk Planner
Overview
This indicator converts a trade idea into a stress-sized quantity. Its corridor separates target, nominal risk, and reserve; a ledger identifies the binding constraint.
Problem Definition
A basic position size calculator divides account risk by entry-to-stop distance. It ignores fills beyond a stop during gaps, slippage, and per-unit cash costs. A tight stop can also produce notional exposure disproportionate to the account. The result may satisfy nominal loss math while violating another capital limit. This script instead asks what quantity fits both a stated stress-loss budget and an exposure ceiling under the units supplied by the user.
Design Rationale
Technical invalidation and execution uncertainty are separate. The stop says where the setup fails; ATR gap allowance and tick slippage extend a stress boundary. Cash cost remains in currency units. This replaces inflating one ATR multiplier, which would mix stop logic and reserve.
Risk and notional capacity are calculated independently. The smaller candidate is rounded down, leaving some budget unused but avoiding either limit. The target uses stress price distance for a consistent visual scale; it is not a forecast.
Key Features
ATR, structure, or wider-of-both stop logic.
Separate gap, slippage, and cash-cost reserves.
Risk and exposure candidates with a binding constraint.
Step rounding plus utilization and headroom diagnostics.
How It Works
Current close rolls with price; Manual price fixes entry. ATR comes from chart OHLC. Stop distance is ATR times its factor, directional distance to structure, or the wider valid distance. The stop is tick-normalized.
The reserve adds ATR times Gap reserve and slippage ticks, producing a stress edge. Nominal unit risk is stop distance times point value plus cash cost; stress unit risk uses the full distance to that edge. Account size times risk percent, divided by stress unit risk, gives the risk candidate.
Entry times point value estimates unit notional. Account size times Maximum notional exposure, divided by unit notional, gives the exposure candidate. The smaller quantity is rounded down by step. Nominal risk, stress risk, reserve cash, both utilizations, and unused budget are then reconciled. Warm-up, wrongly sided stops, invalid units or prices, and sub-step quantities are rejected.
How Multiple Indicators Work Together
This is a causal chain, not a signal stack. ATR scales stop and gap allowance; structure supplies price invalidation. Point value converts distance into cash risk. Risk budget limits stress loss; exposure limits concentration. Removing ATR ignores current range, removing structure loses chart context, and removing either capital constraint leaves one dimension unchecked. Corridor and ledger expose each link.
Trading Ideas and Insights
Compare the same setup under different volatility, reserve, and exposure assumptions. RISK means stress-loss capacity is tighter; EXPOSURE means concentration controls size; BOTH means candidates are close within half a quantity step. A large amber zone relative to red shows that execution assumptions materially reduce size. Headroom is cash left after rounding, not permission to exceed the constraint.
Unique Aspects
The structural contribution is a two-stage constraint lattice. Technical invalidation and execution overrun first become auditable loss layers. The stress-loss candidate then competes with an independent exposure candidate before step rounding. The ledger reconciles final quantity to both budgets and names the binding one, showing how much risk belongs to the stop, how much to reserve, and when exposure overrides them.
How to Use
Choose direction and a rolling or manual entry.
Select ATR, structure, or combined stop logic; verify stop direction.
Enter reserve, cost, account, point value, step, and exposure data from broker specifications.
Proceed only at PLAN READY; note quantity and binding constraint.
Read amber as a stress boundary, not another order or a guaranteed fill limit.
Customization
ATR length and multiple control the volatility stop. Gap reserve adds a scaled allowance; slippage ticks add a fixed allowance. Cash cost must share the account-currency and quantity convention. Exposure above 100% should be deliberate leverage, not assumed margin. Visual switches hide corridor, candidates, labels, or ledger without altering calculations or alerts. Projection bars change drawing length only.
Assumptions and Limitations
This calculator omits liquidity, partial fills, spreads, rejection, margin tiers, liquidation, currency conversion, financing, tax, and minimum notional. A gap can exceed reserve, so stress risk is a scenario, not maximum loss. Point value, cost, step, currency, and exposure need compatible units; metadata may differ from a broker contract.
Current close, ATR, corridor, and quantity can change intrabar. Manual entry is fixed, but ATR values still move. Confirmed-bar alerts can miss a reversed intrabar touch, and gaps can cross boundaries before processing. Drawings show only the latest plan. The script estimates no probability, return, win rate, or stop quality. Nonstandard charts and illiquid markets can make ATR a poor execution proxy.
Conclusion
This planner separates risk, reserve, and exposure. Reliability still depends on verified units, stop logic, and realistic stress assumptions.
Penunjuk

PIPSHUSTLE GOLD OPTION FLOW DEALER The **PIPSHUSTLE Gold Dealer Flow Indicator** is a liquidity-and-volume-based trading indicator designed specifically for **Gold (XAUUSD)**. Its purpose is to identify areas where price may be trapping traders, reacting to liquidity, or showing signs of stronger institutional-style activity.
The indicator focuses on six main components:
* **Sweep Trap Zone:** Detects when Gold runs above a previous high or below a previous low, then closes back inside the level. This can indicate a liquidity grab or false breakout. Bullish sweep traps form below previous lows, while bearish sweep traps form above previous highs.
* **Active Dealers Zone:** A dynamic area around VWAP that uses ATR and relative volume to highlight periods where trading activity is unusually strong. This is intended to act as a proxy for areas where larger market participants may be most active.
* **Reclaim Pivot:** Marks the key price level that was swept and then reclaimed. A bullish reclaim pivot appears after downside liquidity is taken and price closes back above the level. A bearish reclaim pivot appears after upside liquidity is taken and price falls back below it.
* **Main Dealer Ceiling:** A dynamic resistance level created from important upper-side liquidity sweeps and rejection points. If Gold repeatedly fails around this area, it can act as a major resistance or potential SELL zone.
* **Main Dealer Floor:** The bullish equivalent of the Dealer Ceiling. It tracks important lower-side liquidity sweeps and reclaim points, acting as a potential support or BUY zone.
* **BUY / SELL Signals:** The indicator does not generate a signal from a liquidity sweep alone. It combines several conditions such as liquidity sweep, reclaim, VWAP position, volume, EMA trend, displacement, and dealer-zone activity. A signal is printed only after enough conditions align.
A typical **BUY setup** is:
**Sell-side liquidity sweep → bullish trap → reclaim pivot → Dealer Floor holds → price confirms above VWAP → BUY**
A typical **SELL setup** is:
**Buy-side liquidity sweep → bearish trap → Dealer Ceiling rejection → reclaim pivot fails → price confirms below VWAP → SELL**
The signal system also uses a **confirmation score**, allowing stronger setups to require more conditions before a BUY or SELL appears.
It is best viewed as a **dealer-flow/liquidity proxy indicator**, not a true institutional options-feed indicator. Pine Script does not directly provide dealer gamma positioning or full options order-flow data, so the indicator estimates these areas using price action, liquidity behavior, VWAP, volatility and volume.
Penunjuk

Penunjuk

Volatility-Scaled Range Level with Term Structure FilterWHAT IT DOES
This indicator plots a single volatility-scaled price level and evaluates three independent market-condition filters against it. The level sits one Average True Range below the prior period's close, so it widens automatically when realized volatility expands and tightens when volatility contracts. A summary table reports the level, its distance from current price as a percentage, and the state of each filter.
It is a reference and condition-monitoring tool. It does not generate buy or sell orders, does not connect to a broker, and takes no position on whether any particular trade should be placed.
HOW IT WORKS
The level is computed on a higher timeframe than the chart:
level = close of higher timeframe − ATR(14) of higher timeframe
ATR here is Wilder's RMA of True Range, which is what ta.atr() returns. Both components are pulled with request.security(..., lookahead = barmerge.lookahead_off) and referenced at index , so the value is drawn from the last completed higher timeframe bar and does not repaint. Setting the timeframe input to W produces a weekly-anchored level; D produces a daily-anchored one.
The level is then floored to a user-defined increment (default 5). This is optional rounding for users who want the level snapped to a round number rather than an arbitrary decimal.
Three filters are evaluated independently:
Term structure. The ratio of a short-dated volatility index to a longer-dated one (default CBOE:VIX over CBOE:VIX3M). A ratio below the threshold indicates contango, the normal state. A ratio above it indicates backwardation, which historically coincides with volatility clustering and trending decline. Both symbols are user inputs and can be swapped for other instruments.
Absolute volatility floor. A minimum level on the short-dated volatility index. Below this, the distance implied by ATR is small in absolute terms.
Optional trend filter. Price above its 21-period EMA.
The table reads GATES PASS only when all enabled filters are satisfied. An alert() call fires on the first bar of each new higher-timeframe period, with the level, the distance, and the filter states embedded in the message text.
HOW TO USE IT
Add to a daily chart. Set the ATR timeframe input to match the horizon you care about: W for a weekly-anchored level, D for a daily one. Confirm your data plan resolves both volatility symbols; substitute alternatives in the Symbols group if not.
The panel position is adjustable through the "Panel offset right of centre (%)" input, from 0 for centred through 45 for the right edge.
For notifications: right-click the chart, Add alert, select this indicator as the condition, choose "Any alert() function call", and set the frequency to Once Per Bar so it fires at the start of a new period rather than at its close.
The "Anchor on forming period" input switches the level to use the in-progress higher-timeframe bar rather than the last completed one. This produces a value that updates continuously through the period. It is intended as a preview of where the next period's level is forming, not as a signal, and it will change intrabar.
ORIGINALITY
Prior-close-minus-ATR levels are a well-established concept and several published indicators plot them, most notably Saty Mahajan's ATR Levels, which plots a full Fibonacci ladder of them across six timeframe modes. This script is not a republication of that work and does not reuse its code. It differs in scope and purpose:
It plots one level rather than a ladder, to keep the chart readable when the level is the only thing being monitored.
It adds volatility term structure and absolute volatility as explicit gating conditions, which existing ATR level indicators do not evaluate.
It rounds the level to a user-defined increment.
It emits a dynamic alert message containing the computed values, so the notification is self-contained and requires no chart lookup.
The arithmetic that produces the level is standard and deliberately matches the conventional definition so that values are comparable with other implementations.
LIMITATIONS AND SHORTCOMINGS
The level is descriptive, not predictive. It describes a distance in volatility units. Price reaching or not reaching it carries no guarantee of any kind.
The term structure filter depends on external symbols. If your data plan does not provide them, the filter cannot be evaluated and the table will not populate correctly. Verify both symbols resolve before relying on it.
Volatility index data is daily. The filter therefore updates on a slower cadence than the chart and can be stale relative to fast intraday moves.
The absolute volatility floor is a coarse proxy. It says nothing about the actual pricing of any instrument.
On index CFD feeds, the underlying value can differ slightly from the cash index. Where the level is near a rounding boundary, the rounded output may differ between feeds.
The forming-period preview mode updates continuously and is not a fixed reference.
No backtest or performance statistics are presented, because this is an indicator and not a strategy. Nothing here has been tested as a system.
CREDITS
The prior-close-minus-ATR level concept is widely used. Saty Mahajan's open-source ATR Levels indicator is the best-known implementation on TradingView and is worth reviewing for a fuller treatment of the concept across multiple timeframe modes and Fibonacci ratios.
DISCLAIMER
This script is provided for educational and analytical purposes. It is not financial, investment, or trading advice, and it is not a recommendation to buy or sell anything. Volatility-based levels describe historical range behaviour and carry no predictive guarantee. Any use of this tool is at your own risk.# TradingView publication description Penunjuk

Pattern Atlas : Candlestick [AxeAlgo]Pattern Atlas : Candlestick
WHAT THIS LIBRARY IS
This is a Pine Script v6 library of 23 candlestick pattern detectors — one exported function per pattern family, each doing pure open/high/low/close arithmetic against the current or a specified historical bar. There is no plotting, no alerts, and no inputs in this script by design: a library's job is to hand other scripts a clean, reusable, well-documented API, not to draw on a chart itself (Pine doesn't allow a library to plot anything anyway). If you're looking for a ready-to-use indicator built on top of this library, see the companion "Pattern Atlas : Candlestick Scanner " script, which imports every function here and turns it into on-chart signals, a live scanner table, and alerts.(will be published soon)
Candlestick reading is one of the oldest and most widely taught tools in technical analysis, going back to Steve Nison's work bringing Japanese candlestick charting to Western traders. The patterns in this library follow that standard catalog (cross-checked against TA-Lib's CDL* function list, the closest thing to an industry-standard reference), so anyone who already knows what a Morning Star or a Bullish Engulfing bar looks like will recognize exactly what each function is checking for.
WHY A LIBRARY INSTEAD OF ONE MONOLITHIC INDICATOR
Splitting detection logic out as an importable library means:
- Any Pine coder building their own strategy, indicator, or screener can pull in exactly the pattern checks they need without copy-pasting candlestick math into every new script.
- The detection logic is tested and maintained in one place. When a threshold gets refined, everything importing this library benefits from the update by bumping one version number.
- It keeps the math separate from presentation — how a pattern gets drawn, colored, or alerted on is a completely separate decision from whether the pattern is actually present, and different users want different presentations.
HOW TO IMPORT AND USE IT
Add this line near the top of your script (adjust the version number to whatever the current published version is):
import AxeAlgo/PatternCandlestick/1 as cdl
Then call any function directly. Every function returns the same structure, called CandleMatch, so the calling pattern is identical no matter which of the 23 you use:
match = cdl.detectDoji()
if match.found
label.new(bar_index, low, match.patternName)
CandleMatch has six fields:
- found — true if the pattern matched at the evaluated bar, false otherwise.
- patternName — the specific name of what matched (e.g. "Hanging Man"), na when not found.
- direction — "bullish", "bearish", or "neutral".
- barIndex — the bar_index the pattern completes on.
- barsUsed — how many bars the pattern spans (1, 2, 3, or 5 for the one continuation pattern that needs a 5-bar read).
- description — a full sentence naming the pattern and the actual measured values that triggered it (body size as a percent of range, wick-to-body multiples, or the specific price levels involved, depending on the pattern) — genuinely useful for a tooltip or an alert message, not just a repeat of the pattern name.
Every function also accepts an optional offset parameter (default 0, meaning the current/most recent bar) if you want to check a pattern further back in history, plus its own set of tunable threshold parameters — how strict the "small body" or "long wick" cutoffs are — all exposed with sensible defaults so you don't have to touch them unless you want to tighten or loosen a specific pattern's sensitivity for a particular instrument.
THE 23 PATTERNS
Single-bar patterns (9) — each reads one candle's own open/high/low/close shape:
- Doji — detectDoji(). Body is negligible relative to the bar's range; open and close land almost on top of each other. Neutral.
- Long-Legged Doji — detectLongLeggedDoji(). A doji with long wicks on both sides — both directions were pushed and rejected in the same bar. Neutral.
- Dragonfly Doji — detectDragonflyDoji(). A doji with a long lower wick and almost no upper wick — buyers rejected the lows. Bullish.
- Gravestone Doji — detectGravestoneDoji(). A doji with a long upper wick and almost no lower wick — sellers rejected the highs. Bearish.
- Hammer / Hanging Man — detectHammerHangingMan(). Small body, long lower wick, negligible upper wick — the same shape read two ways depending on the prior trend: a Hammer after a decline (bullish), a Hanging Man after an advance (bearish). The function infers the prior trend automatically from a lookback window, or you can supply your own trend context.
- Inverted Hammer / Shooting Star — detectInvertedHammerShootingStar(). The mirror shape (long upper wick, negligible lower wick), same trend-dependent split: Inverted Hammer after a decline (bullish), Shooting Star after an advance (bearish).
- Marubozu — detectMarubozu(). A full-bodied candle with negligible wicks on either side — one side was in complete control from open to close. Direction follows the body color.
- Spinning Top — detectSpinningTop(). Small body with real wicks on both sides, roughly balanced — pushes both up and down failed. Neutral.
- Belt Hold — detectBeltHold(). Opens at (or almost at) one extreme with almost no wick on the opening side, then closes strongly the other way — one side controlled the entire session from the opening bell.
Two-bar patterns (6) — each compares the current bar against the one before it:
- Engulfing — detectEngulfing(). The current bar's body fully covers the prior bar's opposite-colored body.
- Harami — detectHarami(). The current bar's body sits fully inside the prior bar's opposite-colored body — the inverse of Engulfing, read as the move stalling.
- Harami Cross — detectHaramiCross(). A Harami where the contained bar is also a doji — a stronger version of the stall.
- Piercing Line / Dark Cloud Cover — detectPiercingDarkCloud(). The current bar opens beyond the prior bar's extreme and closes back past its midpoint — Piercing Line is the bullish version after a decline, Dark Cloud Cover the bearish version after an advance.
- Tweezer Top / Bottom — detectTweezer(). Two consecutive bars sharing a near-identical high (Tweezer Top, bearish) or low (Tweezer Bottom, bullish) — the level held on both attempts.
- Kicker — detectKicker(). A gap between two opposite-colored bars with zero overlap between their bodies — an abrupt, no-transition reversal in sentiment.
Three-bar-and-longer patterns (8) — each reads a short sequence of bars together:
- Morning Star / Evening Star — detectStar(). A large bar, a small bar gapped away from it, then a third bar closing back past the midpoint of the first — the classic three-bar reversal, bullish (Morning) at the bottom or bearish (Evening) at the top.
- Morning Doji Star / Evening Doji Star — detectDojiStar(). The same structure as the Star pattern above, but the middle bar is specifically a doji — a stronger version of the signal.
- Three White Soldiers / Three Black Crows — detectThreeSoldiersCrows(). Three consecutive same-direction bars, each opening inside the prior body and closing beyond the prior close — steady, sustained buying or selling.
- Three Inside Up / Down — detectThreeInside(). A Harami followed by a third bar closing beyond the first bar's open, confirming the stall seen in the Harami actually turned into a reversal.
- Three Outside Up / Down — detectThreeOutside(). An Engulfing followed by a third bar extending the same move, confirming the reversal.
- Abandoned Baby — detectAbandonedBaby(). A Doji Star with a genuine price gap (not just a wick gap) on both sides of the middle bar — a rare, high-conviction reversal.
- Rising / Falling Three Methods — detectThreeMethods(). A strong trend bar, three small counter-trend bars fully contained inside its range, then a bar resuming the original direction beyond the first bar's close — the trend paused without reversing. This is the one pattern spanning 5 bars rather than 1-3.
- Stick Sandwich — detectStickSandwich(). Two bearish bars with matching closes sandwiching one bullish bar in between — sellers failed to push the close any lower on the second attempt.
WHAT THIS LIBRARY DELIBERATELY DOES NOT DO
No plotting, no drawing, no alertcondition() calls, and no inputs — Pine doesn't allow any of those inside a library in the first place, since a library can never be added to a chart on its own. If you want signals, a scanner table, or alerts, import this library into your own script (or use the companion "Pattern Atlas : Candlestick Scanner " indicator, which does exactly that) rather than expecting this script to render anything by itself.
This library also does not evaluate multi-timeframe data, volume, or broader market structure — it's candlestick shape and price-only, on purpose, so its behavior is easy to reason about and easy to reuse as one building block among several.
PART OF A LARGER SERIES
This is Library #1 in the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (this library), classical chart/geometric patterns (trendline-based structures like triangles, head and shoulders, flags), harmonic patterns (Fibonacci-ratio XABCD structures), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library is independent and useful on its own; together they're meant to cover technical pattern analysis without forcing unrelated detection methods into the same function.
A NOTE ON REPAINTING
Every function here evaluates whatever bar you point it at (the current bar by default, via the offset parameter) using that bar's own open/high/low/close. On the currently-forming bar, those values are still changing tick to tick — that's inherent to reading live price action, not a defect in this library. If you're building persisted signals, drawings, or alerts on top of these functions (rather than a live "what's happening right now" readout), gate your usage on barstate.isconfirmed so a signal only fires once the bar it describes has actually closed, exactly like the companion scanner indicator does.
DISCLAIMER
This library is a technical analysis tool for identifying classical candlestick shapes in historical and live price data. It does not predict future price movement, and a detected pattern is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
Perpustakaan

Penunjuk

Custom Key LevelsCustom Key Levels
Simple tool for plotting your own price levels — support/resistance, liquidity zones, order blocks, whatever you're tracking. Set up to 10 levels, name them yourself, get alerted when price hits them. No auto-detection, no fancy calculations — just your levels, on your chart, the way you want them to look.
What it does
10 level slots, each with its own on/off switch, name, price, and color
Pick short tags near the current price or full lines across the whole chart
Solid/dashed/dotted, adjust width and label size
Turn labels off if you just want clean lines with no text
Crossing alerts built in — get pinged when price crosses a level, and the alert message tells you which one
Penunjuk

Change of Character (CHoCH) Alert System [algotim]Change of Character (CHoCH) Alert System is a market structure signal tool focused on a single event: a confirmed shift in directional bias. Rather than labeling every Break of Structure and CHoCH the way many public structure scripts do, this indicator deliberately ignores continuation breaks and limits both the chart and the alert feed to the moments where the prevailing character of the market actually flips.
Problem Statement
Most public CHoCH implementations classify a character change purely on the direction of a swing break, with no measure of how convincing that break actually was. This creates two practical issues for anyone building alerts around structure. Every minor swing wobble can trigger a notification, producing alert fatigue, and there is no way to separate a decisive character change from one that barely closed beyond the swing level. This script addresses both issues with a close-confirmed CHoCH-only detection engine and a built-in confidence grading step applied to every signal.
Methodology
The script maintains a single structure register holding the most recent confirmed swing high and swing low, located with standard pivot detection over a user-defined pivot length. When the adaptive swing filter is enabled, a newly confirmed pivot only replaces the stored swing if its distance from the last opposite-type pivot exceeds a configurable ATR-relative threshold, which keeps insignificant micro-swings out of the structure register before they can influence a signal.
A Change of Character is only evaluated on a confirmed candle close, so nothing in the detection logic repaints once a signal has printed. A bullish CHoCH requires a close above the last swing high while the tracked bias is bearish or undefined. A bearish CHoCH requires a close below the last swing low while the tracked bias is bullish or undefined. A break that occurs while the bias already agrees with the break direction is treated as ordinary continuation and is not flagged.
Two optional filters gate confirmation further. A displacement filter requires the breaking close to clear the swing level by a minimum ATR multiple, removing marginal breaks. A momentum filter requires the breakout candle's body to represent a minimum percentage of its total range, removing breaks driven mostly by wick with little real conviction behind the close.
Once a CHoCH is confirmed, the broken swing level is projected forward on the chart as an active structure line. If a later confirmed close moves back through that level, the structure is marked invalidated and the projection line is dimmed, separately from the detection of any new CHoCH.
Signal Workflow
Track the most recent confirmed swing high and swing low using pivot detection.
Apply the adaptive swing filter to reject pivots too close to the last opposite-type pivot.
On each confirmed candle close, test for a close beyond the stored swing level against the current bias.
Apply the displacement filter to confirm the close cleared the level by a minimum ATR multiple.
Apply the momentum filter to confirm the breakout candle's body-to-range ratio meets the minimum threshold.
Score the confirmed breakout candle on displacement in ATR units and body-to-range ratio to produce a Weak, Moderate, or Strong confidence grade.
Flip the tracked bias, plot the CHoCH label with its grade, and project the broken level forward as an active structure line.
Continue monitoring the active structure line and mark it invalidated if a later confirmed close moves back through it.
Why This Indicator Is Different
Many structure tools plot every Break of Structure alongside every CHoCH, leaving the trader to filter out which events represent an actual change in character.
This script omits BOS events entirely and reports only confirmed CHoCH signals, which are the events that correspond to a bias flip.
Each confirmed CHoCH is scored using two independent factors measured on the breakout candle itself, its ATR-normalized displacement past the level and its body-to-range ratio, rather than being treated as a single undifferentiated event.
The confidence grade is written into the alert message text at the moment the event fires, which requires composing the message dynamically rather than relying on a fixed template.
The swing level broken by a CHoCH remains tracked after the signal fires, so a later close back through that level produces a distinct invalidation alert rather than silently vanishing into the next structure calculation.
Detection is restricted to confirmed candle closes throughout, so the bias, the grade, and the invalidation state cannot change intrabar once printed.
Inputs
Structure Engine
Swing Pivot Length
Adaptive Swing Filter
Filter Threshold (ATR multiple)
Break Confirmation
Displacement Filter
Displacement Multiplier
Momentum Filter
Minimum Body % of Range
ATR Length
Visual Settings
Show Swing Points
Show Structure Projection
Projection Extension
Show Trend Background Wash
Color Candles After CHoCH
Show Confidence Grade
Label Size
Bullish, Bearish, and Projection colors
Status Panel
Show Status Panel
Panel Position
Alerts
Alert: Bullish CHoCH
Alert: Bearish CHoCH
Alert: Bullish Structure Invalidated
Alert: Bearish Structure Invalidated
Alerts
Alerts are available for:
Bullish CHoCH confirmed on a closed candle, with the confidence grade included in the alert message
Bearish CHoCH confirmed on a closed candle, with the confidence grade included in the alert message
Bullish structure invalidated after a confirmed close back below an active bullish level
Bearish structure invalidated after a confirmed close back above an active bearish level
Practical Usage
Use a shorter pivot length on intraday charts to react to structure earlier, combined with the displacement and momentum filters to avoid marginal breaks.
Use a longer pivot length on higher timeframes to isolate structurally significant character changes only.
Treat a Strong-grade CHoCH as a higher-conviction event than a Weak-grade CHoCH when weighing entry timing or position sizing.
Watch for a structure invalidated alert shortly after a CHoCH, since it indicates price has returned through the level that produced the signal.
Use the status panel as a quick reference for the current bias and the most recent CHoCH grade without needing to scan the chart for labels.
Limitations
Swing highs and lows depend on confirmed pivots, which require the full pivot length of bars to close on both sides before becoming available, introducing a disclosed confirmation lag.
The displacement and momentum filters reduce signal frequency by design, which means fewer but more selective CHoCH events compared to unfiltered structure break detection.
Structure invalidation reflects a return through a previously broken level and does not attempt to forecast subsequent price direction.
This indicator identifies structural events only and does not constitute financial advice or a complete trading system on its own.
Notes
All structural state, including the tracked bias, the active levels, and the confidence grade, is evaluated only on a confirmed candle close, so nothing in this script repaints once printed.
The only lag in the system is the standard pivot confirmation lag inherent to pivot-based swing detection, which is disclosed above rather than hidden.
Designed for dark theme charts. On light themes, consider darkening the projection line color for improved contrast. Penunjuk

MACD Pullback Validation with Divergence Filters [algotim]MACD Pullback Validation with Divergence Filters is a momentum confirmation indicator designed to identify continuation opportunities after temporary pullbacks rather than generating signals from every MACD crossover.
Instead of relying on a single event, the script evaluates multiple stages of market behavior. It begins by detecting pullbacks within an existing momentum cycle, waits for momentum recovery, confirms that price and the MACD histogram are no longer weakening, and optionally verifies that the setup occurs near significant price locations using pivot-derived support/resistance levels or Bollinger Band extremes.
The objective is to reduce low-quality MACD signals by requiring several independent conditions to align before a bullish or bearish signal is displayed.
Problem Statement
Traditional MACD crossover signals frequently occur during ranging markets or immediately after short-lived momentum fluctuations. Likewise, divergence signals alone often appear too early and do not necessarily indicate that momentum has already shifted back in the anticipated direction.
This indicator addresses that limitation by requiring multiple confirmation stages rather than treating each condition as an independent trading signal.
Instead of responding to isolated events, it evaluates whether a pullback has occurred, whether momentum is rebuilding, whether a recent divergence supports the move, and whether price is located in an area where reversals may be more meaningful.
Methodology
The analytical framework consists of several sequential validation layers.
First, MACD crossover events occurring above or below the zero line are monitored to identify temporary pullbacks within an existing momentum cycle. These crossover events establish the recent pullback state.
Next, the script monitors the MACD histogram. Bullish momentum requires the histogram to remain above zero while increasing relative to the previous bar. Bearish momentum requires the histogram to remain below zero while decreasing.
The indicator then waits for the MACD line itself to cross the zero line, treating this as evidence that momentum has shifted back in the direction of the prevailing move.
Histogram divergence is calculated using confirmed pivot highs and pivot lows. Regular bullish divergence requires price to form a lower low while the histogram forms a higher low. Regular bearish divergence requires price to form a higher high while the histogram forms a lower high. Hidden divergence calculations are also available for users who wish to visualize continuation-type divergence.
Finally, optional contextual filters may be enabled.
The Support/Resistance filter checks whether the current price is interacting with recently confirmed pivot-based levels.
The Bollinger Band filter requires bullish setups to occur after closing below the lower band and bearish setups after closing above the upper band, helping identify momentum reversals from statistically extended price conditions.
Signals are generated only after every enabled validation layer has been satisfied.
Signal Workflow
Bullish workflow
1. Detect a recent bearish MACD crossover occurring above the zero line to identify a pullback.
2. Confirm a regular bullish MACD histogram divergence using pivot comparisons.
3. Require the MACD histogram to begin strengthening.
4. Wait for the MACD line to cross back above the zero line.
5. Optionally require interaction with recent pivot-based support.
6. Optionally require price to close below the lower Bollinger Band.
7. Display a bullish signal.
Bearish workflow
1. Detect a recent bullish MACD crossover occurring below the zero line.
2. Confirm a regular bearish MACD histogram divergence.
3. Require bearish histogram acceleration.
4. Wait for the MACD line to cross below the zero line.
5. Optionally require interaction with recent pivot-based resistance.
6. Optionally require price to close above the upper Bollinger Band.
7. Display a bearish signal.
Why This Indicator Is Different
Many MACD indicators generate signals immediately after crossovers, while divergence indicators typically evaluate price and momentum independently.
This script integrates these concepts into a sequential validation framework where each condition serves a different analytical purpose.
The pullback logic identifies temporary counter-trend momentum.
The histogram evaluates whether momentum is rebuilding.
The zero-line crossover confirms broader momentum alignment.
Divergence provides evidence that momentum and price are no longer moving in agreement.
Optional pivot interaction and Bollinger Band filters add market-location confirmation before a signal is produced.
Rather than displaying every crossover or every divergence, the indicator waits until multiple independent conditions align before producing a trading signal.
Inputs
The script includes configurable parameters for:
* MACD fast, slow, and signal periods
* Pullback lookback window
* Divergence pivot lengths
* Divergence range settings
* Optional hidden divergence display
* Optional Support/Resistance validation
* Pivot sensitivity
* Optional Bollinger Band confirmation
* Bollinger Band length and standard deviation
Alerts
Built-in alert conditions are available for:
* Bullish Signal
* Bearish Signal
* Regular Bullish Divergence
* Hidden Bullish Divergence
* Regular Bearish Divergence
* Hidden Bearish Divergence
Practical Usage
The indicator is intended for traders who prefer waiting for momentum confirmation after temporary pullbacks instead of reacting to every MACD crossover.
Optional Support/Resistance and Bollinger Band filters can be enabled to make signal selection more restrictive when additional price-location confirmation is desired.
Limitations
MACD histogram divergence relies on confirmed pivot highs and lows, so divergence signals are only confirmed after the required pivot bars have formed.
Support and resistance levels are derived from pivot calculations and represent algorithmically identified swing points rather than manually drawn market structure.
Like any momentum-based indicator, performance may vary across different market conditions and should be evaluated alongside a broader trading plan and appropriate risk management.
Notes
This indicator is intended as an analytical decision-support tool. It combines momentum analysis, pullback recognition, divergence detection, and optional contextual filters into a structured confirmation process rather than relying on any individual condition as a standalone trading signal. Penunjuk

Penunjuk

CRT TCTCRT TCT — Market Structure & Liquidity Toolkit
CRT TCT is a complete price action and market structure indicator designed to help traders identify key liquidity areas, structural shifts, session ranges, and potential liquidity sweeps directly on the chart.
The indicator combines multiple concepts into one clean and customizable trading toolkit, allowing traders to analyze market structure and liquidity without overcrowding their charts.
Key Features
• BOS & CHoCH Detection
Automatically identifies Break of Structure (BOS) and Change of Character (CHoCH) to help visualize bullish and bearish market structure.
• Liquidity Levels
Automatically detects and tracks relevant swing highs and swing lows as potential liquidity areas. Levels remain visible until price trades through them.
• Liquidity Sweeps
Identifies potential bullish and bearish liquidity sweeps where price takes a previous high or low and rejects the level.
• Multi-Timeframe Key Levels
Displays important previous highs and lows from:
H4
Daily
8:00 AM New York H1
9:00 AM New York H1
• Trading Sessions / Kill Zones
Visualizes the main institutional trading sessions:
Asian Session
London Session
New York Session
Session highs and lows can also be extended forward as potential liquidity targets until they are reached.
• Custom Market Structure Timeframe
BOS and CHoCH analysis can use the current chart timeframe or a fixed timeframe such as 5m, 15m, 30m, 1H, 4H, or Daily.
• Market Structure Dashboard
A compact dashboard provides a quick overview of:
Current structural bias
Selected structure timeframe
Active liquidity above price
Active liquidity below price
• Fully Customizable
Traders can independently enable or disable market structure, liquidity, sweeps, higher-timeframe levels, sessions, and other visual elements.
How It Can Be Used
CRT TCT is designed as a confluence and market-reading tool rather than a standalone buy/sell signal system.
It can help traders identify:
Where liquidity may be resting
When liquidity has been swept
Changes in market structure
Continuation through BOS
Important higher-timeframe levels
Session highs and lows
Potential areas of interest during key trading sessions
The indicator can be used across different markets and timeframes depending on the trader's methodology.
Important: This indicator is intended for educational and analytical purposes only. It does not provide financial advice or guarantee profitable trades. Always use proper risk management and combine the information provided by the indicator with your own trading plan and analysis. Penunjuk

Gypsy VWAP Map v0.30 Premium TradingView Req.Gypsy VWAP Map is a descriptive spatial map built around session-anchored VWAP. It is designed to show how price occupies and traverses recurring VWAP-relative displacement regions—not to generate buy/sell signals or predict reactions.
VWAP can reset at the Globex, London, and/or New York session anchors. I personally use all three, there is also an option for just NY + Globex.
The automatic map learns four independent relationships:
• Above VWAP — Adaptive
• Above VWAP — Persistent
• Below VWAP — Adaptive
• Below VWAP — Persistent
Adaptive relationships emphasize newer evidence and can migrate more quickly when recent excursion behavior changes. Persistent relationships retain more historical evidence and adjust more slowly. Adaptive does not necessarily mean nearer, and Persistent does not necessarily mean farther; the relationships may converge, diverge, overlap, or cross.
There are manual entries for static lines away from VWAP, I change these every once in a while to match current price action (like once a day maybe) but the defaults are a good starting point. Previously the top and bottom lines were locked into the same interval, but separating them allows mapping of nonidentical relationships relative to vwap.
Compare mode combines the automatic relationships with independently configured Manual boundaries. All available boundaries are sorted by their actual distance from VWAP. The colored fields represent fixed spatial intervals between those boundaries, rather than the identity of any particular line or a directional market opinion.
You can use only manual, only auto, or compare mode. Ironically Compare was made for testing, but I ended up liking both sets of lines so I use Compare exclusively.
Candle highs and lows determine which portions of the field have physically been reached. Automatic evidence is admitted only after its selected calculation bar closes. The indicator does not project future structures or complete shapes beyond observed price action.
The 1-second build uses a one-second main calculation stream, with Adaptive defaulting to 30-second evidence and Persistent defaulting to 1-minute evidence. It requires access to TradingView second-based data.
The 1-minute build requires no second-data access. Both Adaptive and Persistent relationships use confirmed one-minute evidence, producing a slower and more conservative map.
Changing indicator inputs causes TradingView to recalculate the loaded history using the new configuration. For consistent comparison, leave the native Calculation timeframe at the build’s designated value: 1 second for the 1S version or 1 minute for the 1M version. Personally I find 1s too busy, I generally use the 5s on a 5s and 5m chart.
This indicator is intended as a neutral framework for studying VWAP-relative market behavior alongside the user’s own structure and analysis.
v0.30
• Promoted the tested Adaptive/Persistent research model to the production 1S and 1M builds.
• Replaced the earlier Near/Far automatic model with four independently learned relationships.
• Added stable spatial color ranking in Compare mode.
• Overlapping boundaries now retain their ranking positions without recoloring or stretching farther zones.
• Added separate high-resolution 1S and broadly compatible 1M versions. Penunjuk
