Value Area Trail [MarkitTick]

2 397

More exclusive indicators from MarkitTick

Subscribe to MarkitTick for $43.75/month to get exclusive indicators by this author. You pay right on TradingView and can use them on your charts straight away.

Explore MarkitTick
💡 Value Area Trail builds a rolling volume profile from recent bars, finds the price zone where most of that volume traded (the value area) and turns the edge of that zone into a one-way trailing line. In an uptrend the line sits at the value area low and can only rise. In a downtrend it sits at the value area high and can only fall. When a close ends on the other side of the line, the trend flips and a BULL or BEAR label is drawn. Optional ADX strength filtering, price smoothing, a higher timeframe mode, risk-multiple trade levels, a dashboard and webhook-ready alerts are built around that core.

✨ Originality and Utility
Most trailing-line tools place their line from volatility or from a moving average. This script places it from volume acceptance: the line follows the price area where the window's volume was actually concentrated, and the trend changes only when price closes outside that area on the wrong side of the line.
  • The trailing level is not a fixed multiple of range. It is the edge of the value area, so it moves with the shape of the volume distribution rather than with a volatility estimate.
  • The line can only ratchet in the direction of the trend. Pullbacks inside the value area do not loosen it.
  • The profile can be rebuilt every bar from a fixed number of bars, or anchored to the latest confirmed swing high or swing low so the profile always starts at a meaningful pivot.
  • Every number the script draws, from the line to the targets, is shown in the dashboard with a tooltip that explains where it comes from.

● Why the Components Belong Together
The script combines three ideas, and each one answers a different question.
  • Volume profile and value area: where did the market accept price? This gives the location of the line.
  • Ratchet trailing rule: how long should that location matter? This gives the line its memory, so it only tightens with the trend.
  • Optional ADX filter and close smoothing: is the move strong enough, and is the close noisy? These act only on whether a flip becomes a signal and on which close is compared with the line. They never change how the profile is built.

The profile always uses the raw bars. Smoothing is applied only to the close that is compared with the value area and the trailing line.

🔬 Methodology and Concepts
• Step 1: The window
The profile is built from a window of bars that includes the current bar.
  • Fixed Bars mode uses the last Window (bars) bars, 10 by default, up to a maximum of 500. Nothing forms until the chart holds that many bars.
  • Swing mode starts the window at the latest confirmed swing high or swing low, whichever is newer, and runs it through the current bar. Each new confirmed swing restarts the window.
  • A swing high is a pivot high over Swing Left bars before it and Swing Right bars after it. A swing low is the same for lows. A swing is therefore confirmed Swing Right bars after its own bar.
  • A swing older than 500 bars is capped to the last 500 bars, and the dashboard says so.

• Step 2: Rows and volume distribution
The highest high and the lowest low of the window define the profile range. That range is split into Rows equal price rows, 24 by default. Each row is at least one tick tall, so on a very narrow range fewer rows are used and the dashboard shows the capped count.
Each bar's volume is spread evenly across the bar's own high-low range. A row receives the share of the bar's volume that matches how much of the bar's range overlaps that row. A bar that sits entirely inside one row adds all of its volume to that row. This is an approximation: the script has only bar data, not trade-by-trade prices, so it assumes volume was spread evenly inside each bar.
• Step 3: Point of control
The row holding the most volume is the point of control (POC), and the POC level is the middle of that row. If several rows tie, the row nearest the middle of the range wins, and the lower one wins if two are equally near.
• Step 4: Value area
The value area starts at the POC row and grows one row at a time. At each step it adds the larger of the next row above and the next row below. It stops when it holds at least Value Area % of the window's volume, 70 by default. The top of the highest included row is the value area high (VAH) and the bottom of the lowest included row is the value area low (VAL). Because whole rows are added, the value area can hold slightly more than the requested share, and the dashboard shows the exact share.
• Step 5: Trailing line and trend
  1. With no trend yet, the first close above VAH starts an uptrend with the line at VAL. The first close below VAL starts a downtrend with the line at VAH.
  2. In an uptrend the line is the higher of its previous value and the current VAL, so it can only rise. A close below the line flips the trend down and moves the line to the current VAH.
  3. In a downtrend the line is the lower of its previous value and the current VAH, so it can only fall. A close above the line flips the trend up and moves the line to the current VAL.
  4. If the profile becomes undefined while a trend exists, the trend is cleared, the line disappears and any open signal is closed.

• Step 6: Smoothing and the strength filter
  • Smoothing can be None, SMA, EMA, RMA, WMA or HMA, with a length of 5 by default. The smoothed close is the value compared with the value area and the line.
  • The Strength Filter reads ADX with the chosen length, 14 by default. When it is on, a flip becomes a BULL or BEAR signal only if ADX is at or above the threshold, 20 by default.
  • A flip that fails the strength check still changes the trend, the line and the candle colour. It just draws no label and opens no trade. If it flips against an open signal, that signal is still closed.

• Step 7: Trade levels
When a signal passes the filters, the script builds a trade from it.
  • The entry is the close of the signal bar and the stop is the trailing line on that bar.
  • The risk is the distance from entry to stop. Three targets sit at multiples of that risk, 1, 2 and 3 by default, and are sorted from nearest to farthest.
  • A target counts when price touches it. The stop counts when a bar closes beyond it.
  • A signal whose stop is not on the losing side of the entry by more than one tick, or whose farthest target would not be above zero, opens no trade and sends no entry alert.

• Higher timeframe mode
With HTF Filter on, the whole indicator runs on the chosen higher timeframe as if it were added to a chart of that timeframe. The profile, the line, the trend, the signals, the Strength Filter, the trade levels and the dashboard all use that timeframe's bars with the same settings, so every bar count (Window, Swing Left, Swing Right, Smoothing Length, ADX Length) counts higher timeframe bars. A timeframe equal to the chart's changes nothing. A timeframe lower than the chart's is skipped, the indicator runs on the chart timeframe and the dashboard says so.
• Data requirements and limits
  • The script needs volume. On a symbol that reports none, or where no bar in the window carries volume, no profile forms and the dashboard says why.
  • Where a feed reports tick volume, the profile counts trades rather than units traded.
  • It runs only on standard candle charts. On Heikin Ashi, Renko, Kagi, Point and Figure, Range or Line Break charts it shows a message instead, because those chart types show synthetic prices.
  • A window holding a price at or below zero is skipped.
  • A short window reacts quickly but builds the profile from few bars, so the value area can be narrow and the line can flip often. A longer window is steadier and reacts later.


🎨 Visual Guide
  • Trail line, green: the uptrend line, drawn at the value area low. It can only rise or stay flat.
  • Trail line, red: the downtrend line, drawn at the value area high. It can only fall or stay flat.
  • Line breaks: the line is not drawn where there is no trend or no profile.
  • Candle colouring: when Color Candles is on, each candle's body, wicks and border take the trend colour, green in an uptrend and red in a downtrend. With no trend, the chart's own candle shows.
  • BULL label: a green label below the bar, drawn when an uptrend flip passes the filters.
  • BEAR label: a red label above the bar, drawn when a downtrend flip passes the filters.
  • Stop line: a solid red line, two pixels wide, with a label showing the stop price.
  • Entry line: a dashed blue line with a label showing the entry price.
  • Target lines: three dashed green lines, with TP1 the faintest and TP3 the strongest, each with a label showing its price. If two targets round to the same price, they share one label.
  • Hit labels: when a target or the stop is reached, its label changes to show that it was hit together with the percentage move from the entry.
  • Level extension: the trade lines run ten bars past the latest bar while the trade is open, and stop at the bar where the trade closed.
  • Warning message: on non-standard chart types, a red message in the middle of the chart asks you to switch to candles.

● Dashboard
The table sits in the corner you choose and uses a header row showing the ticker and the timeframe it runs on. Every cell has a tooltip.
  • Lock, HTF and Strength: the state of the lock, the higher timeframe mode and the last ADX reading with its pass or fail colour.
  • Smoothing: the method and length, shown only when smoothing is on.
  • Trend and Trail Line: the live trend and the current line value.
  • Last Signal, Signal Status and Bars Since Signal: the last BULL or BEAR, whether it is still active and how many bars ago it was registered.
  • Entry, Stop, TP1, TP2 and TP3: the levels of the last trade, shown only while Trade Levels is on. A Targets row marks when the multiples were reordered.
  • POC, VAH and VAL: the three profile levels.
  • VA Share: a ten-step bar showing the share of the window's volume that the value area holds, coloured on a gradient between two chosen colours.
  • Profile High and Profile Low: the extremes of the window.
  • Rows, Window, Window Volume and POC Volume: how the profile was built.
  • Warning rows: a row turns amber when the profile is still building, volume is missing, a setting was capped or the higher timeframe was skipped. If the dashboard is hidden, active warnings are still listed.


📖 How to Use
  1. Add the indicator to a standard candle chart on a symbol with volume. Wait until the profile forms. The dashboard shows how many bars are still needed.
  2. Read the line colour first. Green means price has been holding above the value area low of the profile. Red means price has been holding below the value area high.
  3. A BULL or BEAR label marks the bar where the line changed side and the trend flipped.
  4. Use the profile levels in the dashboard as context. The POC is where the window traded most, and the value area is where most of its volume was accepted.
  5. For a more responsive line, shorten the window. For a steadier one, lengthen it or switch to Swing mode so the profile starts at the latest pivot.
  6. Raising Value Area % widens the zone and moves the line farther from price. Lowering it narrows the zone and brings the line closer.
  7. Turn on the Strength Filter if you want to ignore flips that happen while ADX is below your threshold.
  8. Turn on Smoothing if single noisy closes cause unwanted flips. A smoothed close reacts later than the raw close.
  9. With Trade Levels on, treat the entry, stop and targets as the script's own risk framework. The stop is the line, the targets are multiples of the distance to it, and you decide the position size and whether to use the levels at all.
  10. Use Lock Signal to freeze the current signal and block new ones on the chart's last bar.
  11. Set up alerts from the alert dialog. Eight conditions are available: BUY Signal, SELL Signal, Close Long Signal, Close Short Signal, TP1 Hit, TP2 Hit, TP3 Hit and SL Hit.

● Webhook Payload
Each alert message can carry a JSON payload with these fields: action, ticker, tf, direction, trend, reason, poc, vah and val. When trade levels apply, the payload also carries entry, sl, tp1, tp2 and tp3. The reason field reads trend_flip, reversal, profile_undefined, tp1_hit, tp2_hit, tp3_hit or stop_hit. The action words are set in the inputs.

⚙️ Inputs and Settings
• Filters
  • HTF Filter and HTF Timeframe: run the whole indicator on a higher timeframe, 240 by default. Off by default.
  • Strength Filter, ADX Threshold and ADX Length: require ADX at or above the threshold, 20 by default, for a flip to become a signal. ADX Length is 14 by default.
  • Smoothing and Smoothing Length: choose how the compared close is smoothed. None by default, length 5.

• Volume Profile
  • Window (bars): bars in the profile in Fixed Bars mode, 10 by default, maximum 500.
  • Window Mode: Fixed Bars or Swing.
  • Swing Left and Swing Right: pivot strength used in Swing mode, 5 and 2 by default, up to 50.
  • Rows: number of price rows, 24 by default, up to 500.
  • Value Area %: share of window volume the value area holds, 70 by default.

• Trade Tools
  • Lock Signal: freezes the current signal and blocks new ones.
  • Trade Levels: turns the entry, stop and target logic on or off. It is on by default. Off removes the levels while signals and alerts stay as they are.
  • TP1 Multiple, TP2 Multiple and TP3 Multiple: target distances as multiples of the risk, 1, 2 and 3 by default.

• Visuals and Dashboard
  • Show Trail Line, Show Signal Markers, Color Candles and Show Trade Levels: each hides only its drawing. The trend, signals and alerts keep running.
  • Show Dashboard and Position: show the table and choose one of four corners.

• Alerts
  • Long, Short, Close Long, Close Short, Partial Close Long and Partial Close Short action words: the text sent in the payload. Defaults are long, short, closelong, closeshort, partialcloselong and partialcloseshort.

• Colors
  • Bullish, Bearish, Marker Text, Entry, Stop, Targets and Level Text colours for the chart, and Background, Header, Text, Warning Row, Bar Low End and Bar High End colours for the dashboard.


🔍 Deconstruction of the Underlying Scientific and Academic Framework
• Market Profile and the value area
The idea of a value area comes from Market Profile, developed by J. Peter Steidlmayer at the Chicago Board of Trade. Market Profile organises trading activity by price level and defines the value area as the range where roughly 70 percent of the activity took place. This script applies the same logic to bar volume instead of time-at-price.
• Why 70 percent
In a normal distribution, about 68.3 percent of observations fall within one standard deviation of the mean. The 70 percent value area is commonly explained as an approximation of that one-standard-deviation band. Real volume distributions are rarely perfectly normal, so the value area is better read as the zone holding most of the volume than as a statistical confidence band.
• Mode of the distribution
The point of control is the mode of the volume-by-price distribution: the price row with the highest frequency. Growing the value area outward from the mode, always adding the heavier neighbour, is a greedy method that produces a contiguous zone around the peak.
• Volume-at-price from bar data
Without tick data, volume must be allocated to price rows by an assumption. Spreading each bar's volume evenly over its own range is a uniform-distribution assumption. It is simple and transparent, but it is an estimate, and it treats a bar's volume as equally likely at every price inside the bar.
• Ratchet trailing logic
The line follows a monotone rule: in an uptrend it equals the running maximum of the value area low, and in a downtrend the running minimum of the value area high. This is the same structural idea as other trailing-stop and trend-following lines. The reference level is what changes here: it comes from volume concentration, not from average true range.
• Directional movement and ADX
ADX comes from J. Welles Wilder Jr., who introduced it in 1978. It smooths the difference between positive and negative directional movement into a single strength reading with no direction. A common reading treats values below roughly 20 as weak trend conditions. That is a convention, not a law, which is why the threshold is an input.
• Smoothing methods
The simple, exponential and weighted moving averages are standard linear filters. RMA is Wilder's smoothing. The Hull moving average, by Alan Hull, combines weighted averages to reduce lag. Every smoothing method trades noise reduction against delay.
• Risk multiples
Expressing targets as multiples of the initial risk follows the R-multiple idea popularised by Van Tharp. It keeps targets proportional to the distance between entry and stop, so a wide stop produces proportionally distant targets.

⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.