INVITE-ONLY SCRIPT

Liquidity Dependent Price Movement

Updated
Liquidity-Dependent Price Movement (LDPM) is a metric designed to directly measure liquidity on a stock through the use of nominal data, such as price and volume. There are no other similar metrics available to the retail trader.

Liquidity can be characterized as a way of measuring how smoothly things are running in the market. When things are running smoothly – such as when there is good agreement as to the price of an asset, then things are considered liquid. Conversely, when things are not running smoothly, just as when the bid or the ask do not agree with each other, then things are considered not liquid.

In a liquid environment, a stock can trade a lot of shares without moving the price. On the other hand, when a stock is not liquid, even small volumes can move the price substantially.

It is therefore helpful to know when a stock is liquid to the upside or to the downside, or even, when a stock is not liquid to the upside or the downside. These data have statistical associations with future price movement and volatility.

LDPM indicates both where liquidity is, and how the liquidity is changing. Thankfully, in order to do that, we only need to keep track of two lines:

  • LDPM-Granular (LDPMg) is the real-time calculation of LDPM and is used to determine if liquidity is “improving” or “worsening” based on how much it moves towards or away from the equity’s price.
  • LDPM-Smoothed (LDPMs) is the averaged, or smoothed, LDPMg, and is used to give a general sense of the overall liquidity environment on a stock.


Using these two lines together, one can get an accurate reading of the overall liquidity (via LDPMs) and if that liquidity is improving or deteriorating (via LDPMg).

This translates to a rather straightforward interpretation scheme:
- If the price is below LDPMs, then it is said that liquidity is poor, and downside is the most likely outcome.
- If the price is above LDPMs, then it is said that liquidity is abundant, and upside is the most likely outcome.

Technical Specifics

LDPM-Smoothed has a default back-window of 10. The author of the script utilizes 7 as it seems to be a good match of accuracy and sensitivity.

The color of the lines can be manually changed as well as color-coded based on if LDPM is above or below the price. This is the “Color by price” option.

Empirical studies and back-testing have demonstrated a strong correlation between LDPM and future price behaviors, with future price direction (liquidity), and with future price range (volatility). More information can be found in the “Author’s Notes” with a link to the LDPM Primer.

LDPM’s value is dependent on the interval chosen. This is a feature not a bug. Different “views” of liquidity will provide different readings, as LDPM is not like most traditional metrics in that it utilizes no past data in its calculations. The feature of time-dependent values from LDPM allow liquidity to be assessed at different “vantage points” which can be tailored and chosen based on the trade’s expected time-horizon or the trader’s individual trading styles or preferences.

Author’s Techniques

The author of the script utilizes a hands-off technique when trading with LDPM. Based on the interval that is chosen, the author of the script either goes long or short depending on the Price, and LDPM’s relationship.

Utilizing a back-window of 7, if LDPM-Smoothed is above the price, the author goes short. If LDPM-Smoothed is below the price, the author goes long.

The author then completely ignores the market until a cross-over occurs at the start of the next interval.

Additional Notes

More dynamic and aggressive trading is possible with LDPM that incorporates LDPMg and monitoring as well as incorporation into more sophisticated algorithmic trading.

Trial
If you would like to try LDPM out, comment, message, or email me with the link provided below and I will add you to the access list for 1 month.

Why Chose LDPM
There are no other Liquidity-measuring indicators available to the retail investor. Measuring liquidity often requires the use of expensive data and high-throughput computing to be used in real-time. Neither of these requirements apply to utilizing LDPM.

The rationale for LDPM is strongly rooted in both market mechanics and mathematics (see LDPM Primer).

There are no analogues or similar metrics available that the author is aware of at-large nor on T.V. either with respect to what LDPM measures or the empirical accuracy that is demonstrated from LDPM. LDPM is straight-forward and easy to interpret. This flexibility also extends towards the breadth of trading styles for which LDPM can provide insight. Deep Dive Stocks is committed to providing high quality, impactful market data and has an established track-record of producing metrics that adhere to Deep Dive Stocks’ goals, of which LDPM is only one of the more recent.
Release Notes
There are some changes to the Liquidity-Dependent Price Movement Metric. For more information, please see YT channel for a complimentary video here shortly. (Thank you to the LDPM subscribers who suggested these changes!).

- LDPM-Smoothed Calculation Change
A slight change to the LDPM-s’ calculation has been performed in order to keep LDPM values more consistent across different platforms (Data Dashboard, Reports, TradingView, etc.). There shouldn’t be too noticeable of a change other than the increased consistency.

- LDPM Box
LDPM now comes with a box that will display 8 additional LDPM values from different time intervals.

There are two different time intervals that can be chosen:
o Standard Interval: contains the 1-Month (1M), 1-Week (1W), 1-Day, 4-Hour (4H), 1-Hour (1H), 30-Minute (30Min), 15-Minute (15-Min), 5-Minute (5-Min).

o Non-Standard (Day Trading) Intervals: 4-Hour (4H), 1-Hour (1H), 30-Minute (30Min), 15-Minute (15Min), 10-Minute (10Min), 5-Minute (5Min), 2-Minute (2Min), 1-Minute (1Min).

The window-length for the LDPMs calculations on those intervals is 5.

The different intervals can be selected with the “Standard LDPM Values” box. If the box is checked, you will see the Standard, and if unchecked, you will see the Non-Standard (Day Trading) intervals.

Each value in the box is that interval’s LDPM. It is also colored based on if LDPM is below the price on that interval (bullish) or if LDPM is above the price on that interval (bearish).

The color of the box can be modified by selecting the color “Box color”. Default is white.

The color of the row labels (4H, 1H, 30Min, etc.) can be selected clicking the “Box label text colors” box and then choosing which color you want. Default is black.

The bullish and bearish colors can be chosen by selecting the “Box text color” box and then selecting the two colors desired for the bullish and bearish text. Default is green for bullish and red for bearish.

Finally, the box position has two options: in the upper-right and in the lower-right. This can be chosen by clicking “Box position”. When “Box position” is clicked, the box will be in the upper-right, and when it is un-clicked, it will be in the lower right.

If you have any questions, concerns, comments or feedback and suggestions, please don’t hesitate to reach out.

Justin
Release Notes
Fixed Syntax Errors
Release Notes
Several important updates to note:

– The LDPM settings panel has undergone organizational improvements.
– LDPM-Smooth can now be calculated with one of four different averaging styles: Simple, Exponential, Weighted and a Relative Moving Average (RMA). The default has been set to EMA.
– The LDPM values listed in the LDPM Box will now reflect the LDPM lookback period and LDPM-Smooth averaging type selected.
– The LDPM Box now has an expanded selection of location choices.

As well, the Liquidity-Dependent Price Movement indicator now comes with the Liquidity-Dependent Price Movement Crossover Scanner.
Release Notes
A large update to LDPM with the goal of expanding and improving the functionality of LDPM. The following changes have been made to LDPM:
- LDPM-Granular is turned off by default.

o LDPM-Granular can still be toggled on if desired within the settings.
o LDPM-Granular coloring settings can be set as previous (color by price, etc)

- Default lookback period for LDPM has been expanded from 5 to 20.
The increase helps balance LDPM’s reactivity with its predictiveness. At times, a lookback of 5 was too reactive on various timeframes. Expanding it to 20 helps alleviate this disequilibrium on lower timeframes.

- LDPM now contains the LDPM Fib loadout
This loadout utilizes 5 LDPMs with lookbacks of 13, 21, 34, 55, 89.
o The different LDPMs can have their colors manually set within the settings.
o The individual LDPMs for the LDPM Fib loadout can have their different thicknesses changed.
o The LDPM Fib Loadout is the default loadout.

- LDPM now contains the Standard loadout
The Standard Loadout is the classic LDPM loadout with a singular LDPM line.
o The color of the Standard LDPM Loadout can be changed within the settings.

- LDPM now contains a Reference LDPM loadout
A Reference LDPM can be used to visualize what a higher-order LDPM would look like on a given chart. The Reference LDPM must be greater in time than the current chart’s timeframe. That means, if a chart is set to the 30minute interval, the Reference LDPM must reference a timeframe greater than 30 minutes.
o Reference LDPM color can be set within the Settings
o Two Reference LDPMs can be active per LDPM Indicator

- The LDPM Box can now be toggled off from within the Settings
Disabling the LDPM box from within the settings can help alleviate some speed issues when multiple LDPM indicators are on a single chart.
o Standard editing and stylization available for the LDPM Box as before.
Release Notes
- LDPM's maximum lookback allowed has been expanded to 5,000 for LDPM standard.
Release Notes
Patch Notes 2024-02-08 Version 2.0.0

Core Algorithm Changes

LDPM’s core algorithm has been updated for improved sensitivity to changing liquidity conditions.

The changes to LDPM’s core algorithm enhance the utility of LDPM’s ability to represent liquidity depth via the distance from the equity’s price. This improvement will produce a greater level of response from LDPM during moments of rapidly shifting liquidity.

As before, price action that brings LDPM closer to the equity’s current price promote a cross-over (poor liquidity) and price-action that moves LDPM further away from the equity’s current price indicate good or improving liquidity.

Additional Smoothing Algorithm

LDPM can now be calculated through Kalman Filtering. This new algorithm allows LDPM to develop a system for filtering out noise versus signal. This process is fed the raw data from LDPM’s core algorithms to produce the final LDPM value.

Default Configuration Changes - Functional Changes
- LDPM Standard's default lookback period has been increased to 55.
- KF Filtering has been set as the default smoothing choice.
- Some changes for setting Reference LDPMs:
- - The default "Time Value to Reference" has been set to 1 to avoid crashing LDPM when checking the box without setting the parameter first.
- - The default "Timeframe Unit to Reference" has been set to "Day" to avoid crashing LDPM when checking the box without setting the parameter first.

Default Configuration Changes - Aesthetic Changes

The simple truth in life has two parts:
1] Dark mode is superior, and
2] LDPM-Fib can get messy.

As such, the default aesthetic settings have been adjusted to better reflect this truth and to help increase readability of LDPM-Fib.

For best results, set to dark mode and set the chart background to #191d2e

Bug Fixes

There was a bug producing NA values within the LDPM values box. This has been patched to instead display "-", which looks nicer.
Release Notes
Hot Fix 2024-02-08
- Adding some changes that were erroneously left out of previous patch.
- LDPM is now more sensitive.

To ensure that you have the most up-to-date LDPM, it is recommend to remove LDPM from any charts and re-apply.
Release Notes
Note: No critical functionality affected.
- Fixed text formatting for the LDPM values box.
- Fixed issue preventing LDPM values box from being moved in certain circumstances.
Release Notes
Updates for 2024-08-25:
- Fixed an issue with the LDPM Box creation location. It can now be placed everywhere!
- LDPM Box creation default set to false.
- Some renaming done in the settings for clarification.
- LDPM-144 was added to the default load-out set for the LDPM-Fib load-out.

Chart displays LDPM (lines) and LDPS (colored bars).
Release Notes
CRITIAL UPDATE:

This update will change how the algorithm functions.

- Replaced "EMA" as a smoothing algorithm; accidentally deleted on last update.
- Updated the smoothing aspect of the algorithm to maintain greater sensitivity through the smoothing process. The results should be very notable.
Release Notes
** Quick Fix **

Last update broke LDPM. Fixed.
Release Notes
The Liquidity-Dependent Price Stability algorithm underwent some structural and algorithmic changes to help facilitate a greater dynamacism with regards to handling greater ranges of liquidity environments. Namely, I wasn’t satisfied with how the various `Sensitivity Modes` were adapting and managing the data streams between settings. In order to help these modes adapt and maintain fidelity, the following changes, and others, were made:

- Key Algorithmic Changes
 One of the main focuses in improvements was allowing LDPS to maintain its sensitivity even on larger-scales such as above LDPM-233. This was accomplished such that the higher-order LDPMs do not degrade into one another anymore, but rather, the algorithm works to keep the data streams appropriate per LDPM order so as to not loose sensitivity on said order.

 Liquidity Flow has been revamped to Liquidity Levels .

 Another mode for LDPS has been introduced: Diamond Mode.

- Liquidity Condition

 Liquidity Conditions can now be toggled via the `LDPS Reporting Style` between `Interpretive` and `Declarative`.
 Interpretive: This is the traditional reporting method and includes `Bullish` and `Bearish` designators.
 Declarative: This reporting method simply reports where LDPS is detecting the majority of the transactions. The options are:
• At Ask: the majority of the transactions seem to be occurring at or very near the ask.
• Ask~Mid: The majority of the transactions seem to be occurring between the ask and the mid-point between the bid and the ask.
• At Mid: The majority of the transactions seem to be occurring between the bid and the ask near the mid-point.
• Mid~Bid: The majority of the transactions seem to be occurring seem to be between the mid-point and the bid.
• At Bid: The majority of the transactions seem to be occurring at the bid.

• Note: The `Simplified` Detail Amount will simply use either `At Ask` or `At Bid`
 Sensitivity Mode Addition: Diamond Mode
The new algorithm allows for greater breadth and depth of analysis, and as such, LDPS received its first expansion via the `Diamond Mode`.
 Calibrated to minimize non-long-term (time-interval dependent)-significant indicates via a more robust noise-removal algorithm.

- Liquidity Flow has been changed to Liquidity Levels
The current state of representing the Liquidity Flow was not intuitive and in conjunction with the color-scheme, was often-times was giving the wrong interpretation of the data to its users. As such, the Liquidity Flow has been changed to Liquidity Levels to better demonstrate the liquidity situation’s changing conditions.

The new Liquidity Levels tell us how the liquidity is at the organic side. However: please note that this may be independent of your assessment of the organic side as per LDPM’s invertedness or not. In other words, if you see inverted LDPMs, consider that LDPS is still reporting Liquidity Levels at the inverted organic (i.e.: the absent) side until sufficient conditions change to suggest the real organic side has swapped.

 Algorithm Improvements allow for more granular assessment with regards to overall liquidity levels.

 Liquidity Flow can be: `Increasing`, `Decreasing` or `Neutral`
 These designate if liquidity is increasing its flow towards the organic side or decreasing.

 Liquidity Flow: Increasing or Decreasing
The old `Improving` and `Worsening` designators were confusing and replaced with `Increasing` and `Decreasing`.
 `Increasing` indicates that liquidity is improving at the organic side.
 `Decreasing` indicates that liquidity is deteriorating at the organic side.

 Text Display – Colors
To minimize mixed messages, the Liquidity Level text-output display color is no longer intrinsically tied to the `Bullish` or `Bearish` color choices.
 Liquidity Level text output color can be selected in the Settings.

- General Changes

 Updates performed to the Settings and Configurations panel.
 The default location for LDPS’ text output has been changed to `Bottom Center`.
 The default size for LDPS’ text output has bene changed to `Large`.
 The `Simplified` detail amount will now use the `Strong Bullish` and `Strong Bearish` color schemes, respectively.
 The setting `Sensitivity and Specificity` has been renamed `Sensitivity Mode`.
 The setting `LDPS Reporting Style` has been renamed `LDPS Detail Amount`
 The default `LDPS Detail Amount` has been changed to `Simplified`.
Release Notes
I was not satisfied with the range of LDPM capabilities with regards to being able to adjust to different liquidity environments – most notable during extreme liquidity withdrawals. As such, LDPM underwent two main structural changes in order to help it capture meaningful changes with greater capacity over these larger environments and conditions. These developments have led to the following changes:

- General Upgrades
 Reformatting and optimizations allow for faster processing – you should notice a significant increase in speed when loading LDPM onto a chart. This will make it easier to have multiple sets of LDPM running on a single chart if needed.

 The Smoothing processes underwent some changes to ensure that they were not removing too much of LDPMs original behavior for the sake of smoothing. You should notice more of a difference between the smoothing algorithms now along with a touch more reactivity throughout.

 LDPM Text Box is now off by default.

- LDPM-Fib
 The individual lines within the LDPM-Fib loadout can now be manually selected and modified. The available choices are: 5, 8, 13, 21, 34, 55, 89, 144, 377, and 610.

 Note: The larger values were originally unavailable prior to the algorithm changes due to the loss of fidelity at the higher order LDPMs (the eventually would “merge” into one). This is no longer the case.

 Note: Due to these changes, the individual lines’ short-titles had to be changed from `LDPM-8…` to `L1 … L7`. Unfortunately, there does not currently seem to be a way to dynamically change the short-titles to be able to show what the value is set for that particular LDPM-Fib line.

 Default choices for LDPM-Fib loadout are: LDPM-8, LDPM-21, LDPM-34, LDPM-89, LDPM-144, LDPM-377, LDPM-610.

- Aesthetics
 Minor aesthetic changes throughout
 Default size for the lines has been decreased.
 Settings / Menu saw some reconstruction.

Release Notes
Updates for 2024-11-06:
  • LDPM Updates
  • LDPM’s Settings underwent reconfiguration once again for clarity:
  • Aesthetic changes for choosing the Fib sequence.
  • “Lookback” has been changed to “Order”
  • Fixed a bug causing the LDPM table’s LDPM-order to be set via the LDPM Standard lookback.
  • `LDPM Standard` has been renamed to `Manual LDPM`
  • `LDPM Reference` has been renamed to `Time-Based LDPM`.
  • LDPM-Fib default line-width for the lower-order LDPMs increased from 1 → 2.
  • Various updates on descriptions.
  • Alerts have been configured:
  • Is Bullish / Bearish : This will alert at the close of the candle as the chosen type. This is useful if you want to set up casual “reminders” that something is still what it was periodically.
  • Becomes Bullish / Bearish: This will alert if LDPM (of the chosen order) changes from either bullish to bearish, or vice-versa. This can activate at any time in the bar, not just at close.
  • Aggressive Bid Cascade / Aggressive Ask Cascade: These alerts will attempt to capture (and alert) you to a developing ABC or AAC, and will alert at any time, not just at the bar-close.

Release Notes
- Quick update fix for manual LDPM placement. Fixed bug causing limit.
forecastingldpmliquidityVolatilityVolume

Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact DeepDiveStocks for more information, or follow the author's instructions below.

Please note that this is a private, invite-only script that was not analyzed by script moderators. Its compliance to House Rules is undetermined. TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases, you can find a good open-source alternative for free in our Community Scripts.

Author's instructions

Access to LDPM can be obtained at: https://deepdivestocks.com/membership . Then, Email support@deepdivestocks.com with your T.V. username to be added.

Want to use this script on a chart?

Warning: please read before requesting access.

Deep Dive Stocks
Also on:

Disclaimer