Focus Bars [Kioseff Trading]Hello Traders!
🔹 Focus Bars
Focus Bars is a lower-timeframe reconstruction tool designed to break each candle into a price-based internal structure .
Instead of viewing a bar as a single OHLC print, this tool redistributes intrabar participation across price levels, showing where activity, delta, and directional pressure concentrated inside the bar itself .
Think of it as a way to look inside the candle .
intrabar participation distributed by price level
buy vs sell pressure mapped inside each bar
delta-driven visualization of internal structure
volume-based or delta-based profile sizing
stacked recent bars for direct comparison
lower timeframe reconstruction of candle internals (up to 1 tick)
🔹 What the tool shows
🔸 Focus Bar Structure
Each visible bar is reconstructed using lower timeframe data and divided into configurable price rows.
This allows the script to build an internal map of activity inside the candle, showing how participation distributed throughout its range.
This helps reveal:
where activity concentrated inside the bar
which price regions attracted the most interaction
how the bar built from low to high
🔸 Directional participation
The script estimates directional pressure using lower timeframe price movement and distributes that pressure across the bar’s traded range.
This allows you to observe:
where buying pressure was strongest
where selling pressure dominated
how directional activity distributed through the candle
Instead of treating the candle as one net result, Focus Bars breaks it into a layered participation structure .
🔸 Volume mode
In its default form, the profile width reflects total intrabar participation at each price level.
This helps identify:
high activity zones inside the bar
areas where the market spent more effort
internal high-interest regions
This mode focuses on where the bar traded most actively , regardless of which side was dominant.
🔸 Delta Bars mode
When Delta Bars mode is enabled, the visualization shifts from general activity to directional imbalance .
Positive delta levels extend one way, while negative delta levels extend the other, helping expose where directional pressure accumulated inside the bar.
This makes it easier to see:
which prices were dominated by buyers
which prices were dominated by sellers
where internal imbalance became most extreme
This mode is about pressure and imbalance , not just participation.
🔸 Recent bar stacking
The script displays multiple recent reconstructed bars side by side, allowing you to compare internal structure across the most recent candles.
This helps reveal:
whether participation is shifting higher or lower
whether recent bars are building similarly or differently
how internal pressure changes from one bar to the next
Rather than looking at candles in isolation, you get a stacked structural view of recent bar development.
🔸 Price-row resolution
Each bar is divided into a configurable number of rows.
Higher row counts provide finer structural detail, while lower row counts simplify the visualization.
This lets you control the balance between:
detail
clarity
performance
🔸 Lower timeframe reconstruction
The script uses lower timeframe data to estimate how participation distributed through each candle.
Granularity can be selected between:
1-minute
1-second
1-tick
This allows the internal structure to become more detailed as lower granularity data becomes available.
🔸 Buy / sell volume labels
Each price row includes separate displayed values for:
sell-side participation
buy-side participation
This gives a direct read on how activity distributed at each level, rather than relying only on color or profile width.
🔸 Gradient-based intensity
Color gradients help represent the magnitude of participation and directional pressure at each price level.
This makes it easier to spot:
high-intensity zones
low-interest areas
strong directional concentrations
Stronger color intensity reflects stronger internal participation or imbalance.
🔹 How to read it
Each component gives a different layer of information:
Candle body / wick → the outer structure of the bar
Profile width → where participation concentrated
Delta mode → where directional imbalance built
Buy / sell labels → how each side contributed at a level
Stacking → how internal structure changes bar to bar
🔹 Why this tool is useful
It gives you:
a way to look inside candles instead of only at candle outcomes
price-based intrabar participation mapping
clear visualization of internal volume and delta structure
context for where buying or selling pressure concentrated
a deeper structural view of recent bar development
🔹 Best use cases
analyzing internal candle structure
comparing recent bars side by side
spotting hidden participation concentrations
finding where directional pressure built inside a move
adding lower-timeframe context to bar-by-bar analysis
🔹 Important note
This tool uses lower timeframe data to reconstruct intrabar structure.
This means:
it is an approximation of internal order flow
accuracy depends on available lower timeframe data
selected granularity impacts precision
different symbols and data feeds may produce different levels of detail
🔹 Inputs you can customize
The script includes flexible controls such as:
granularity selection
bar count to display
row resolution
volume mode vs Delta Bars mode
color customization
display offset
Closing Notes
Focus Bars is built to shift the focus from how a candle finished to how it developed internally .
It helps reveal not just what the bar looked like from the outside, but where participation and pressure were concentrated inside it .
Thank you for checking it out!
Kiosefftrading
Market Structure Volume Profiles [Kioseff Trading]Hello traders and friends!
Introducing: "Market Structure Volume Profiles".
This script combines market structure with volume profiling and CVD to show how volume develops inside each structural changes of the market.
Instead of building one continuous profile across a session, this script creates a new volume profile for each completed BoS or CHoCH, allowing you to study the internal auction of each behavioral regime independently.
🔹Features
Detects and displays BoS and CHoCH
Builds a dedicated volume profile for each new structure
Displays profiles in Stacked or Split mode
Optional Mini Profile mode for a compact structure profile view
Shows buy-side and sell-side volume distribution
Displays POC for each profile
Optional extended POC and naked POC tracking
Displays Value Area (VA) for each completed structure
Tracks and plots CVD by structural leg
Optional market structure candle coloring
Optional structure statistics label
Uses lower timeframe data to build more detailed internal volume distribution
🔹How it works
This script tracks market structure and recalculates volume profiles for each structural change.
Whenever price confirms a Break of Structure (BoS) or Change of Character (CHoCH), the volume accumulated during that completed leg is organized into a profile. This allows you to examine how volume was distributed throughout the move, where the heaviest participation occurred, and whether buying or selling dominated the leg.
Rather than asking only where price moved, this script helps answer:
where volume concentrated during the move
whether the move was supported by participation
where value developed inside the structural range
how buy and sell volume were distributed across price
Each profile is built from lower timeframe data so that the structural leg can be broken into price levels and analyzed internally.
🔹What it shows
🔸Market Structure
The script identifies major structural events and labels them as:
BoS
CHoCH
Profiles to be tied directly to meaningful structural transitions.
🔸Volume Profile by Structure
Each completed structural leg gets its own profile, showing:
buy volume at each level
sell volume at each level
total participation across the leg
the internal shape of the auction
This makes it easier to compare continuation legs against reversal legs.
You can color BoS and CHoCH generated profiles distinctly. Making it easier to trach where each profile sits inside broader market action.
🔸Point of Control (POC)
The script can display the POC of each structural profile, showing the price level with the highest traded volume during that leg.
The script can also display the Value Area for each profile, helping identify where the majority of volume was concentrated during the structural move.
🔸CVD
The script tracks Cumulative Volume Delta throughout the current structure and plots it in the pane.
CVD can be reset by:
CHoCH
BoS + CHoCH
Day
Week
This makes it possible to study delta behavior in a structural context rather than only in a session-based one.
🔸Structure Stats
Optional structure statistics can be displayed, including:
Range
High
Low
Buy volume
Sell volume
Delta
Return
This gives a summary of the completed structural move.
🔸Why use it
This script is designed for traders who want to combine:
market structure
volume profiling
delta/CVD
auction logic
Because profiles are anchored to structure instead of session time, they can help reveal differences between:
strong continuation legs
weak continuation legs
reversal legs
imbalanced breakouts
balanced rotations
🔸Mini Profiles
The indicator has two separate drawing methods for each VP.
The detailed profile is used when the structural move has enough bar data to create a detailed profile.
When not enough data exists, a mini profile is used. You can select only to use mini profiles if you prefer the style.
The internal logic to calculate each volume profile is similar. However, the detailed profile "scrunches" when not enough bar data exists to calculate it on - that's when mini profile takes over.
🔸Split Profile
You can also choose to show split volume profiles.
This is more similar to how a delta profile is shown. This is a styling preference only.
Rows Limit
Detailed profiles can use up to 500 rows.
Higher values were giving a "response too large" error, so I restricted the max to 500.
🔹Summary
That’s about it!
The goal of this script is simply to combine market structure with volume profiles and CVD so you can see how volume develops inside each structural move instead of across arbitrary time windows.
By anchoring profiles to BoS and CHoCH, you can study how participation builds during continuations, reversals, and rotations - and get a better feel for how each move was actually formed internally.
Hope you find it useful (:
Thank you guys and thank you TradingView!
Stop Loss Cascades (Breakouts) [Kioseff Trading]Hello friends and traders!
🔹Introduction
This indicator " Stop-Loss Clustering (Breakouts) " attempts to model trader stop-loss placement logic and identify price areas where a large amount of stop losses might cluster.
The idea is, if stop losses are indeed highly concentrated in a specific area, price extending through that area may produce high-velocity breakout conditions via forced order flow .
I'll cover this topic more thoroughly throughout the description. For now, just know that stop loss location & size data is not publicly available . Any model of their concentration locations is highly assumptive.
However, there's some reasonable academic research we can reference to make worthwhile estimates.
Academic references supporting the concepts discussed are listed at the end of this description. To maintain readability, I won't cite individual statements inline.
🔹The Premise
🔸Liquidity, Behavior, and Stop Cascades
Markets operate through a continuous limit order book , where two fundamental order types interact:
Limit orders , which provide liquidity by resting in the book
Market orders , which consume liquidity by exhausting those resting orders
This mechanical interaction drives price movement - incoming order flow consuming available liquidity .
This begs the question.. Does liquidity distribute evenly across the LOB?
If it did : If liquidity were evenly distributed, price impact could be modeled as a relatively smooth function of incoming order flow.
But it doesn’t : Liquidity is unevenly distributed. Academic research supports this claim and, regardless, this is an intuitive conclusion most traders arrive at.
Liquidity forms localized concentrations and gaps.
Liquidity concentrations are commonly referenced as: liquidity shelves , liquidity clusters , liquidity zones .
Liquidity gaps are commonly referenced as: liquidity vacuums , thin book zones .
As a result, identical order flow can produce very different price movements depending on the state of the order book.
Let’s consider an example..
Assume price is trading at $99.
The price levels $100, $101, $102 have resting sell limit order concentrations of 100.
This is where you come in.
You execute a market order buy for 300 size.
Your order first exhausts all sell-side resting order concentrations at the $100 level.
You still have 200 size that needs to be filled, and the ask price has moved from $100 to $101.
Your order will now sequentially exhaust available liquidity at the $101 level, the ask price will increase to $102, and your final 100 size will exhaust the $102 level.
To keep the example simple, we’ll say that your order moved price from $99 to $102, and now the ask price is $103.
But, you still want to accumulate.
The nearest sell-side levels in the LOB are $103, $104, $105.
The $103 level has a sell limit order concentration of 500.
$104 and $105 both have concentrations of 50.
You execute your same market order buy for 300 size.
This time, price doesn’t move.. At all..
Instead, you consumed 300 of the 500 size at $103 with your order, and the level remains a barrier.
Your order was absorbed by available liquidity.
This example demonstrates how price movement depends on available liquidity , not simply the size of incoming orders.
In the first scenario, liquidity was thin and the order walked through multiple price levels, causing price to move quickly.
In the second scenario, a large concentration of resting liquidity absorbed the same order, preventing price from advancing.
🔸Liquidity Does Not Distribute Evenly
Alright, we understand that liquidity doesn’t distribute evenly. And we understand that high concentrations of liquidity can act as price barriers (liquidity shelves) while sparse liquidity can permit rapid price movement - we saw this in our example above.
There’s an important question we should ask next before we move on..
If liquidity distributes unevenly, then where does it tend to cluster? And where does it tend to thin?
Of course, knowing these tendencies provides multi-purpose advantages.
If price approaches a liquidity vacuum - a local block of the order book with thin resting liquidity - rapid price movement can occur without requiring unusually strong aggressive order flow.
If price approaches a liquidity shelf - a local block of the order book with thick resting liquidity - price can stall or contract even if the same level of aggressive order flow that previously moved price continues.
With this in mind, order flow intensity alone does not determine price movement . The distribution of liquidity across surrounding price levels plays a similarly important role.
So, is there any evidence of where liquidity tends to concentrate ?
🔸Empirical Observations
Empirical research on limit order books shows that liquidity does not distribute smoothly across the LOB . Instead, depth tends to concentrate at specific price levels, producing irregular profiles with localized peaks in resting liquidity.
These concentrations arise because order placement is not random . Traders frequently anchor decisions to widely observed reference prices such as:
• prior highs
• prior lows
• round numbers
• widely referenced price extremes
Because many traders monitor the same price history, order placement decisions often reference similar price levels.
This concept is simpler than it sounds.
Let’s use market structure traders for example.
Market structure traders frequently reference prior swing highs and swing lows when making decisions about entries, exits, and risk.
A trader entering a long position may place their stop-loss below a recent swing low , reasoning that if price breaks that level, the trade idea is invalidated.
A trader entering a short position may place their stop-loss above a recent swing high for the same reason.
Timeframe price aggregation may differ; however, we’re all looking at roughly the same recent highs and lows when evaluating a chart (structure).
When many traders collectively reference the same prices, orders may accumulate near those levels. This produces localized depth concentrations, which traders refer to as liquidity shelves .
Liquidity shelves act as temporary barriers where the book contains disproportionately large resting liquidity compared to surrounding prices.
🔸Research documenting liquidity clustering includes :
Bourghelle & Cellier (2007) , who find that limit orders cluster at prominent price levels (especially round numbers), creating localized depth concentrations that can act as price barriers.
Kavajecz & Odders-White (2004) , who demonstrate that prices identified as support or resistance coincide with higher resting limit order depth
These findings suggest that many commonly observed price levels may correspond to real concentrations of liquidity rather than being purely visual artifacts on a chart.
Kavajecz & Odders-White (2004) is an important observation for support/resistance traders!
Kavajecz & Odders-White (2004) show that levels traders commonly call support and resistance often align with areas where more limit orders are resting in the order book.
This suggests a plausible mechanical pathway through which support and resistance levels can emerge!
🔸Liquidity Shelves and Price Interaction
When liquidity clusters around a price level, the resulting liquidity shelf can influence how price behaves when it approaches that area.
Price interaction with these shelves is state-dependent :
If incoming order flow is absorbed, price may stall or reverse
If resting liquidity is consumed, price may transition rapidly to the next liquidity zone
Once a shelf is depleted, follow-through can accelerate due to thinner liquidity beyond the level
Research on order book dynamics supports this mechanical view of price movement.
For example:
Jean-Philippe Bouchaud, J. Doyne Farmer, and Fabrizio Lillo (2009) demonstrate that price impact emerges from the interaction between order flow and finite liquidity
From this perspective, price does not move simply because a level is crossed.
Price moves because available liquidity at that level has been consumed.
🔸Latent Liquidity and Stop Clustering
In addition to visible liquidity from limit orders, markets also contain latent liquidity .
This is where ”Stop-Loss Clustering (Breakouts)” becomes important - we’re almost done!
Latent liquidity consists of conditional orders such as stop-losses that are not visible in the order book until triggered .
Although these orders aren’t public information, empirical studies show that stop orders tend to cluster near widely referenced price levels .
Research by Carol Osler (2001, 2002) using institutional FX order data finds that stop-loss orders frequently accumulate just beyond salient price levels such as prior highs and lows.
When these stops trigger, they convert into aggressive market orders and can generate bursts of directional order flow that may accelerate price movement.
🔸Stop-Loss Cascades
Stop losses add another layer of latent order flow that isn’t visible in the order book until it triggers.
If enough of them sit around the same price area.. Think “hidden pressure” waiting to activate. Nothing happens while price trades nearby, but once that level is traded at, those stops convert into market orders and immediately begin consuming available liquidity.
This matters because stop placement is unlikely to be random in most instances. Traders frequently anchor stops to widely observed prices such as prior highs, prior lows, or other prominent structure points, or use volatility methods such as ATR, etc.
So when price approaches one of these areas, two things can happen.
If the resting liquidity there is large enough, the incoming orders can be absorbed and price may stall or reject.
But if that liquidity gets consumed, the stops sitting just beyond the level begin triggering. Those triggered stops add additional market orders, which consume more liquidity and can push price further into the next layer of stops.
This creates a cascading effect:
price reaches a stop cluster
stops trigger and convert into market orders
liquidity gets consumed faster
price moves further, triggering more stops
When this chain reaction starts, price can transition very quickly from a slow battle near the level to rapid expansion through it.
This is one of the mechanical reasons why some reference-point breaks barely move, while others accelerate rapidly.
🔹How It Works
Now that we understand the why - let’s discuss how the indicator works.
🔸Absorbtion Extremes
The image above shows the absorption extremes model.
In this model, the indicator treats recent & relevant swing points as plausible stop clustering candidates.
You can find similar swing point identification mechanics in other indicators.
However, this model assigns subsequent volume to the swing level after its formation.
There are limitations and assumptions - let’s go over them.
The images above explain how the indicator determines the intensity of a possible stop-cluster around a swing level.
There are limitations and assumptions
1: The indicator assigns all “directional volume” to a swing level after it’s formed and while it remains the closest active swing point to the current price.
“Buy volume” is assigned to the closest active swing low.
“Sell volume” is assigned to the closest active swing high.
I say “buy volume” and “sell volume” because there’s assumptions on what constitutes the relevant classification.
The indicators follow the traditional two-region tick model for classifying buy volume and sell volume.
Higher close = “buy volume” proxy
Lower close = “sell volume” proxy
Depending on the granularity you select (the indicator is capable of using tick data), this model can be more/less accurate.
However, even with tick-level data and bid/ask quotes, trade direction must still be inferred using classification rules. Because some trades occur inside the spread or involve hidden liquidity, perfect classification is not possible without exchange aggressor flags.
For assumptions..
The model assigns ALL classified volume to the swing level.
In reality, traders use a wide range of risk management methods, and not every position will place a stop loss directly at the most recent swing point. ATR-based stops, percentage-based stops, and other volatility-based methods are also common.
Because the true distribution of stop placement is unobservable, the model assumes that positions entered are structurally invalidated at the closest swing level based on their classified direction.
As a result, the values displayed by the indicator should be interpreted as relative proxies for potential stop concentration, rather than precise estimates of actual stop-loss size.
The displayed magnitudes are intentionally exaggerated and comparative, designed to highlight where stop pressure may accumulate relative to other levels.
The images above show how to interpret the indicator when using this model.
The image above shows the triggered stop-cluster graph.
Each point corresponds to a triggered stop-cluster - assuming it exists.
The greater the size attached to that cluster, the further distant the data point is placed.
Far away from zero line = large size.
Close to zero line = low size.
Radiating/glowing points indicate a potentially large cluster trigger.
🔸 Volatility-At-Entry Model (Time Scaled)
The Volatility-At-Entry model uses ATR scaled by various timeframes to predict plausible stop loss placements.
For this model, the indicator uses the same tick classification model to assign volume directionally.
Volume is then dispersed across six common timeframes (1m, 5m, 15m, 30m, 1h, 4h) and 3 common ATR multiples for risk management (1ATR, 1.5ATR, 2ATR).
This model assumes traders are entering positions across various timeframes and are scaling risk congruent with those timeframes.
For instance,
A trader using the 1-minute chart for opportunity is more likely to use a stop loss closer to entry than a trader using the 4-hour chart for opportunity.
If this assumption is reasonable to you - great, we can move forward!
The image above visualizes the model.
Purple-shaded regions indicate a price area with less opportunity for stop loss clustering. Either transaction intensity around eligible price areas was low, or position accumulation wasn’t given sufficient time.
Pink-shaded regions indicate a price area with greater opportunity for stop loss clustering. Volume was significant around these regions or price has traded within proximity for extended periods.
This model naturally shows more future opportunity than historical outcomes. You can select to show historical outcomes in the settings, this image shows examples of such outcomes.
The image above shows the triggered stop loss graph in effect for this model. Stop clustered are distributed across more price areas with this model - from low intensity to high intensity. Therefore, a cluster is almost always “triggering” to some degree.
A classification model for what’s typical and what’s unusual is used for the graph in this case. Radiating points always indicate large stop clusters triggered. Anything within the green/pink line indicates usual size.
Typical Move
The image above explains the nearest cluster information table.
The size and location of the nearest buy-stop cluster and sell-stop cluster are recorded.
Additionally, the indicator identifies whether clusters of similar size were triggered in the past, and how price behaved following those events.
Since all models here are highly assumptive, and similar sized clusters might only have one or two relative neighbors, treat these measurements as a description of history rather than a prediction.
The model takes the logarithm of the current stop-volume (buy or sell) to normalize its scale and compare it with a historical dataset of previously observed stop-volume sizes that have also been log-scaled.
It then identifies historical observations whose sizes are most similar to the current value, either by selecting all observations within a tolerance range around that value (where the range is based on the typical spacing between historical observations), or by selecting the single closest match.
Finally, the model retrieves the historical price moves associated with those matched observations, producing a sample of “typical moves” that occurred when stop-volume magnitude was similar to the current situation.
Ratio Meter
The stop-cluster ratio meter shows the current sum of active and triggered all buy-side clusters and sell-side clusters.
This meter is useful for quick scanning across assets to see if active or recently triggered stop clusters are lopsided.
Additional Features
The single most important setting outside model selection is the lower timeframe used to retrieve volume from.
This setting is set to 1-minute data by default because it works with paid and free plans. If you want better granularity, I strongly suggest changing this setting to either 1-second or 1-tick. This will sacrifice the number of identifiable cluster locations, because better granularity data has less programmatically retrievable values.
🔹Closing Remarks
Stop-loss clustering is an appealing concept because it offers a plausible explanation for why some breakouts accelerate so quickly while others stall. When a large number of conditional orders sit near the same price, a breakout through that area can trigger a cascade of market orders that rapidly consume liquidity and push price toward the next available zone.
However, it’s important to remember that the models used in this indicator are approximations, not direct measurements. True stop-loss locations and sizes are not publicly observable, and many traders use different risk management techniques that cannot be perfectly inferred from chart data alone. The goal of this indicator is therefore not to identify exact stop locations, but to highlight price areas where stop pressure may plausibly accumulate relative to surrounding levels.
Like any model based on behavioral assumptions and historical observations, results should be interpreted probabilistically. Large clusters do not guarantee breakouts, and small clusters do not guarantee quiet price behavior. Instead, the indicator is best used as a tool for context and situational awareness.
References
General Microstructure and Price Formation
Madhavan, A. (2000). Market microstructure: A survey. Journal of Financial Markets, 3(3), 205–258.
O'Hara, M. (1995). Market Microstructure Theory. Blackwell.
Biais, B., Glosten, L., & Spatt, C. (2005). Market microstructure: A survey of microfoundations, empirical results, and policy implications. Journal of Financial Markets, 8(2), 217–264.
Limit Order Books and Liquidity as Resting Orders
Gould, M. D., Porter, M. A., Williams, S., McDonald, M., Fenn, D. J., & Howison, S. D. (2013). Limit order books. Quantitative Finance, 13(11), 1709–1742.
Rosu, I. (2009). A dynamic model of the limit order book. Review of Financial Studies, 22(11), 4601–4641.
Biais, B., Hillion, P., & Spatt, C. (1995). An empirical analysis of the limit order book and the order flow in the Paris Bourse. Journal of Finance, 50(5), 1655–1689.
Liquidity Clustering and Depth Concentration
Kavajecz, K. A., & Odders-White, E. R. (2004). Technical analysis and liquidity provision. Review of Financial Studies, 17(4), 1043–1071.
Bourghelle, D., & Cellier, A. (2007). Limit order clustering and price barriers on financial markets. Working paper / SSRN.
Order Flow and Price Impact
Bouchaud, J.-P., Farmer, J. D., & Lillo, F. (2009). How markets slowly digest changes in supply and demand. In Handbook of Financial Markets: Dynamics and Evolution.
Stop Orders and Price Cascades
Osler, C. L. (2003). Currency orders and exchange-rate dynamics: Explaining the success of technical analysis. Journal of Finance, 58(5), 1791–1819.
Osler, C. L. (2005). Stop-loss orders and price cascades in currency markets. Journal of International Money and Finance, 24(2), 219–241.
Liquidity Provision and Execution
Ho, T., & Stoll, H. (1981). Optimal dealer pricing under transactions and return uncertainty. Journal of Financial Economics, 9(1), 47–73.
Almgren, R., & Chriss, N. (2000). Optimal execution of portfolio transactions. Journal of Risk, 3(2), 5–39.
Menkveld, A. J. (2013). High frequency trading and the new market makers. Journal of Financial Markets, 16(4), 712–740.
Behavioral Anchoring and Attention
Kahneman, D., & Tversky, A. (1974). Judgment under uncertainty: Heuristics and biases. Science, 185(4157), 1124–1131.
Barber, B. M., & Odean, T. (2008). All that glitters: The effect of attention and news on the buying behavior of individual and institutional investors. Review of Financial Studies, 21(2), 785–818.
George, T. J., & Hwang, C. Y. (2004). The 52-week high and momentum investing. Journal of Finance, 59(5), 2145–2176.
Mizrach, B., & Weerts, S. (2007). Highs and lows: A behavioral and technical analysis. SSRN working paper.
Monte Carlo (Polyline Traceback) [Kioseff Trading]Hello!
This script "Monte Carlo (Polyline Traceback) " performs a Monte Carlo simulation using polylines!
By using polylines, and tracing back the initial simulation to its origin point, we can better replicate the ideal output of a Monte Carlo simulation!
Such as:
The image above shows the output of a simulation (image sourced outside TV).
With this script, and polyline capabilities, we can come quite close on TradingView.
The image above shows the indicator in action! Not bad considering the ideal output.
Of course, the script is quite heavy and tries its best to circumvent limitations :D
You might run into load time errors, in which case you might try applying the built-in setting "Force Script Load". This setting will cut-off the visuals for some simulations, but has a higher chance of passing load-time limitations!
As shown in the image above, you can select to only show worst-case and best-case simulations. Using this option will reduce chart lag and improve load times.
Features
Monte Carlo Simulation: Performs Monte Carlo simulation to generate multiple future paths.
Asset Price: Can simulate future asset prices based on historical log returns.
Statistical Methods: Offers two simulation methods—Gaussian (Normal) distribution and Bootstrapping.
Adjustable Parameters: Offers numerous user-adjustable settings like number of simulations, forecast length, and more.
Historical Data Points: Option to specify the amount of historical data to be used in the simulation (price).
Best/Worst Case: Allows you to show only the best case / worst case outcome (range) for all simulations!
Thank you!
Tick CVD [Kioseff Trading]Hello!
This script "Tick CVD" employs live tick data to calculate CVD and volume delta! No tick chart required.
Features
Live price ticks are recorded
CVD calculated using live ticks
Delta calculated using live ticks
Tick-based HMA, WMA, EMA, or SMA for CVD and price
Key tick levels (S/R CVD & price) are recorded and displayed
Price/CVD displayable as candles or lines
Polylines are used - data visuals are not limited to 500 points.
Efficiency mode - remove all the bells and whistles to capitalize on efficiently calculated/displayed tick CVD and price
How it works
While historical tick-data isn't available to non-professional subscribers, live tick data is programmatically accessible. Consequently, this indicator records live tick data to calculate CVD, delta, and other metrics for the user!
Generally, Pine Scripts use the following rules to calculate volume/price-related metrics:
Bullish Volume: When the close price is greater than the open price.
Bearish Volume: When the close price is less than the open price.
This script, however, improves on that logic by utilizing live ticks. Instead of relying on time-series charts, it records up ticks as buying volume and down ticks as selling volume. This allows the script to create a more accurate CVD, delta, or price tick chart by tracking real-time buying and selling activity.
Price can tick fast; therefore, tick aggregation can occur. While tick aggregation isn't necessarily "incorrect", if you prefer speed and efficiency it's advised to enable "efficiency mode" in a fast market.
The image above highlights the tick CVD and price tick graph!
Green price tick graph = price is greater than its origin point (first script load)
Red price tick graph = price is less than its origin point
Blue tick CVD graph = CVD, over the calculation period, is greater than 0.
Red tick CVD graph = CVD is less than 0 over the calculation period.
The image above explains the right-oriented scales. The upper scale is for the price graph and the lower scale for the CVD graph.
The image above explains the circles superimposed on the scale lines for the price graph and the CVD graph.
The image above explains the "wavy" lines shown by the indicator. The wavy lines correspond to tick delta - whether the recorded tick was an uptick or down tick and whether buy volume or sell volume transpired.
The image above explains the blue/red boxes displayed by the indicator. The boxes offer an alternative visualization of tick delta, including the magnitude of buying/selling volume for the recorded tick.
Blue boxes = buying volume
Red boxes = selling volume
Bright blue = high buying volume (relative)
Bright red = high selling volume (relative)
Dim blue = low buying volume (relative)
Dim red = low selling volume (relative)
The numbers displayed in the box show the numbered tick and the volume delta recorded for the tick.
The image above further explains visuals for the CVD graph.
Dotted red lines indicate key CVD peaks, while dotted blue lines indicate key CVD bottoms.
The white dotted line reflects the CVD average of your choice: HMA, WMA, EMA, SMA.
The image above offers a similar explanation of visuals for the price graph.
The image above offers an alternative view for the indicator!
The image above shows the indicator when efficiency mode is enabled. When trading a fast market, enabling efficiency mode is advised - the script will perform quicker.
Of course, thank you to @RicardoSantos for his awesome library I use in almost every script :D
Thank you for checking this out!




