OPEN-SOURCE SCRIPT
Actualizado Liquidity & Trend: Spot Buy/Sell

Liquidity & Trend: Spot Buy/Sell

A spot position tool for the daily chart. Long or cash only, no shorting, no leverage. It answers one question: should I be holding this asset right now, or sitting in cash? It does that by reading the global liquidity tide and, for alts, the asset's own price trend, then printing plain BUY and SELL signals.
The idea
Global liquidity is usually drawn as a line laid over Bitcoin, but the level of money supply next to price is noisy and the relationship drifts in and out. What holds up better is the impulse: the rate of change of liquidity, normalized. This indicator is built entirely on that impulse, and on the long-observed tendency for it to lead Bitcoin by roughly a quarter.
How it works
Global M2 is built from the M2 money supply of the US, Eurozone, Japan, China, UK and Canada, each converted to USD by its FX rate, then summed.
The impulse: Global M2 is smoothed with a 10-day average, its 90-day rate of change is taken, and that is z-scored against the trailing 365 days. That single z-line is the engine.
Regime: liquidity turns bullish when the impulse z crosses above +0.4 standard deviations and bearish below −0.4, with hysteresis in between and a 14-day confirmation before any flip commits. It is deliberately slow. It is built for cycles, not for days.
Trend leg (for alts): a dual smoothed moving average (Wilder/RMA) cross, lengths 15 and 29, on the chart's own price. It captures the asset's own momentum, which the macro data cannot see.
Minimum hold: one uniform rule for every asset. A position is held at least 2 bars before the opposite signal can fire, which removes next-day round-trip whipsaw on volatile names. It is a structural setting, identical across assets, not tuned per coin.
Three modes
Liquidity: hold when the liquidity regime is bullish. Best fit for Bitcoin, which tracks the global tide closely.
Trend (SMMA): hold when the price trend is bullish. A pure trend follower for the charted asset.
Combined (OR): hold when either liquidity or price trend is bullish, and move to cash only when both are bearish. Built for altcoins, where the macro read alone is too slow to catch asset-specific moves.
Suggested use: Liquidity mode on BTC, Combined mode on alts.

On the chart

BUY and SELL markers where the position state changes.
Background shading: green when the model says hold, red when it says cash. These signals and the shading always cover the entire chart.
The two trend SMMA lines, colored by direction (optional).
A forward projection ribbon to the right of price: it slides the recent liquidity impulse forward by the lead and paints green for a projected tailwind, red for a projected headwind. It runs on a lightly smoothed version of the raw impulse so it stays earlier than the confirmed signal without flickering. It is context only, since price itself cannot be projected, and it is not a trade trigger.
A live-state table: the active mode, current action, the liquidity state, the price-trend state, the current impulse z, the short-term impulse direction, a three-week z trail, the projected tide, the signal-health status, and days in state.
Signal-health monitor
Every liquidity relationship eventually decays, so the indicator watches its own edge. It tracks the one-year correlation between the lead-shifted impulse and price momentum, and the two-year gap between average daily returns on liquidity-bullish days versus liquidity-bearish days. If that gap stays negative for a month it flags the model as degraded. The aim is to be told when the relationship stops working, not flattered by it.

Optional backtest
A simple long-or-cash spot backtest can be switched on in the table (off by default). It shows trades, return, buy-and-hold and max drawdown, measured from a configurable start date (default 2017, the live-data era). It is a basic simulation for context, not a performance promise, and it never affects the buy/sell signals.
Alerts
BUY signal, SELL signal, liquidity impulse upturn or downturn confirmed (early context, not a trigger), and signal health degraded or recovered.
How to use it
Run it on the 1D timeframe. Read the green/red state as a position regime, not a precise top or bottom timer. The model confirms turns rather than predicting them, so it tends to be a little late to the exact low and the exact high, by design, in exchange for not whipsawing.
Settings reference
Impulse window 90 days, smoothing 10 days, z-score window 365 days.
Regime band ±0.4 standard deviations, liquidity confirmation 14 days.
Trend SMMA lengths 15 and 29.
Minimum hold 2 days (uniform anti-whipsaw).
Projection lead 91 days (about 13 weeks), projection smoothing 3 days.
Backtest off by default, with start date, start capital and a per-trade cost.
What it does not do
It does not call tops or bottoms, it does not short or use leverage, and it cannot dodge a one-day shock because the confirmation logic needs more than one bar. It is built for gradual, liquidity-driven cycles and it will sit through deep drawdowns, especially on alts. The macro data updates monthly and on a lag, so treat the liquidity read as a backdrop, not a high-frequency timer.
Originality
Most liquidity tools overlay the level of Global M2 on price. This one works off the impulse, normalizes it into a confirmed regime, fuses that with the asset's own trend for alts, projects the leading edge forward, and monitors whether the liquidity-to-price relationship is still alive. The combination, and the self-check, are the point.
For education and research only. Not financial advice and not a recommendation to buy or sell any asset. Markets are risky and you can lose money. Do your own research.
A spot position tool for the daily chart. Long or cash only, no shorting, no leverage. It answers one question: should I be holding this asset right now, or sitting in cash? It does that by reading the global liquidity tide and, for alts, the asset's own price trend, then printing plain BUY and SELL signals.
The idea
Global liquidity is usually drawn as a line laid over Bitcoin, but the level of money supply next to price is noisy and the relationship drifts in and out. What holds up better is the impulse: the rate of change of liquidity, normalized. This indicator is built entirely on that impulse, and on the long-observed tendency for it to lead Bitcoin by roughly a quarter.
How it works
Global M2 is built from the M2 money supply of the US, Eurozone, Japan, China, UK and Canada, each converted to USD by its FX rate, then summed.
The impulse: Global M2 is smoothed with a 10-day average, its 90-day rate of change is taken, and that is z-scored against the trailing 365 days. That single z-line is the engine.
Regime: liquidity turns bullish when the impulse z crosses above +0.4 standard deviations and bearish below −0.4, with hysteresis in between and a 14-day confirmation before any flip commits. It is deliberately slow. It is built for cycles, not for days.
Trend leg (for alts): a dual smoothed moving average (Wilder/RMA) cross, lengths 15 and 29, on the chart's own price. It captures the asset's own momentum, which the macro data cannot see.
Minimum hold: one uniform rule for every asset. A position is held at least 2 bars before the opposite signal can fire, which removes next-day round-trip whipsaw on volatile names. It is a structural setting, identical across assets, not tuned per coin.
Three modes
Liquidity: hold when the liquidity regime is bullish. Best fit for Bitcoin, which tracks the global tide closely.
Trend (SMMA): hold when the price trend is bullish. A pure trend follower for the charted asset.
Combined (OR): hold when either liquidity or price trend is bullish, and move to cash only when both are bearish. Built for altcoins, where the macro read alone is too slow to catch asset-specific moves.
Suggested use: Liquidity mode on BTC, Combined mode on alts.
On the chart
BUY and SELL markers where the position state changes.
Background shading: green when the model says hold, red when it says cash. These signals and the shading always cover the entire chart.
The two trend SMMA lines, colored by direction (optional).
A forward projection ribbon to the right of price: it slides the recent liquidity impulse forward by the lead and paints green for a projected tailwind, red for a projected headwind. It runs on a lightly smoothed version of the raw impulse so it stays earlier than the confirmed signal without flickering. It is context only, since price itself cannot be projected, and it is not a trade trigger.
A live-state table: the active mode, current action, the liquidity state, the price-trend state, the current impulse z, the short-term impulse direction, a three-week z trail, the projected tide, the signal-health status, and days in state.
Signal-health monitor
Every liquidity relationship eventually decays, so the indicator watches its own edge. It tracks the one-year correlation between the lead-shifted impulse and price momentum, and the two-year gap between average daily returns on liquidity-bullish days versus liquidity-bearish days. If that gap stays negative for a month it flags the model as degraded. The aim is to be told when the relationship stops working, not flattered by it.
Optional backtest
A simple long-or-cash spot backtest can be switched on in the table (off by default). It shows trades, return, buy-and-hold and max drawdown, measured from a configurable start date (default 2017, the live-data era). It is a basic simulation for context, not a performance promise, and it never affects the buy/sell signals.
Alerts
BUY signal, SELL signal, liquidity impulse upturn or downturn confirmed (early context, not a trigger), and signal health degraded or recovered.
How to use it
Run it on the 1D timeframe. Read the green/red state as a position regime, not a precise top or bottom timer. The model confirms turns rather than predicting them, so it tends to be a little late to the exact low and the exact high, by design, in exchange for not whipsawing.
Settings reference
Impulse window 90 days, smoothing 10 days, z-score window 365 days.
Regime band ±0.4 standard deviations, liquidity confirmation 14 days.
Trend SMMA lengths 15 and 29.
Minimum hold 2 days (uniform anti-whipsaw).
Projection lead 91 days (about 13 weeks), projection smoothing 3 days.
Backtest off by default, with start date, start capital and a per-trade cost.
What it does not do
It does not call tops or bottoms, it does not short or use leverage, and it cannot dodge a one-day shock because the confirmation logic needs more than one bar. It is built for gradual, liquidity-driven cycles and it will sit through deep drawdowns, especially on alts. The macro data updates monthly and on a lag, so treat the liquidity read as a backdrop, not a high-frequency timer.
Originality
Most liquidity tools overlay the level of Global M2 on price. This one works off the impulse, normalizes it into a confirmed regime, fuses that with the asset's own trend for alts, projects the leading edge forward, and monitors whether the liquidity-to-price relationship is still alive. The combination, and the self-check, are the point.
For education and research only. Not financial advice and not a recommendation to buy or sell any asset. Markets are risky and you can lose money. Do your own research.
Notas de prensa
Liquidity & Trend: Spot Buy/SellA spot position tool for the daily chart. Long or cash only. No shorting, no leverage. It answers one question: should I be holding this asset right now, or sitting in cash? It does that by reading the global liquidity tide and, for altcoins, the asset's own price trend, then printing plain BUY and SELL signals.
The idea
Global liquidity is usually drawn as a line laid over Bitcoin, but the level of money supply next to price is noisy and the relationship drifts in and out. What holds up better is the impulse: the rate of change of liquidity, normalized. This indicator is built entirely on that impulse, and on the long-observed tendency for it to lead Bitcoin by roughly a quarter.
How it works
Global M2 is built from the M2 money supply of the US, Eurozone, Japan, China, UK and Canada, each converted to USD by its FX rate, then summed.
The impulse: Global M2 is smoothed with a 10-day average, its 90-day rate of change is taken, and that is z-scored against the trailing 365 days. That single z-line is the engine.
Regime: liquidity turns bullish when the impulse z crosses above +0.4 standard deviations and bearish below −0.4, with hysteresis in between and a 14-day confirmation before any flip commits. It is deliberately slow. It is built for cycles, not for days.
Trend leg (for alts): a dual smoothed moving average (Wilder/RMA) cross, lengths 15 and 29, on the chart's own price. It captures the asset's own momentum, which the macro data cannot see.
Minimum hold: one uniform rule for every asset. A position is held at least 2 bars before the opposite signal can fire, which removes next-day round-trip whipsaw on volatile names. It is structural, identical across assets, and not tuned per coin.
Three modes
Liquidity: hold when the liquidity regime is bullish. Best fit for Bitcoin, which tracks the global tide closely.
Trend (SMMA): hold when the price trend is bullish. A pure trend follower for the charted asset.
Combined (OR): hold when either liquidity or price trend is bullish, and move to cash only when both are bearish. Built for altcoins, where the macro read alone is too slow to catch asset-specific moves.
Suggested use: Liquidity mode on Bitcoin, Combined mode on alts.
On the chart
BUY and SELL markers where the position state changes.
Background shading: green when the model says hold, red when it says cash. The signals and shading always cover the entire chart.
The two trend SMMA lines, colored by direction (optional).
A compact live-state table: the active mode, current action, the liquidity state, the price-trend state, the current impulse z, the impulse trend, a three-week z trail, the signal-health status, and days in state.
The "Impulse trend" row (your forward read)
The liquidity impulse turns before the confirmed regime does, so this row is the early tell. It shows the impulse direction, how many days it has persisted, and exactly how far the impulse is from the band that would flip the regime. For example, "RISING 7d, 0.57 to +0.4" means the impulse has been rising for seven days and needs to climb another 0.57 sigma to flip the regime bullish. It carries the leading information in words, without a forecast overlay to misread.
Signal-health monitor
Every liquidity relationship eventually decays, so the indicator watches its own edge. It tracks the one-year correlation between the lead-shifted impulse and price momentum, and the two-year gap between average daily returns on liquidity-bullish days versus liquidity-bearish days. If that gap stays negative for a month, it flags the model as degraded. The aim is to be told when the relationship stops working, not flattered by it.
Optional backtest
A simple long-or-cash spot backtest can be switched on in the table (off by default). It shows trades, return, buy-and-hold and max drawdown, measured from a configurable start date (default 2017, the live-data era). It is a basic simulation for context, not a performance promise, and it never affects the buy/sell signals.
Alerts
BUY signal, SELL signal, liquidity impulse upturn or downturn confirmed (early context, not a trigger), and signal health degraded or recovered.
How to use it
Run it on the 1D timeframe. Read the green/red state as a position regime, not a precise top or bottom timer. The model confirms turns rather than predicting them, so it tends to be a little late to the exact low and the exact high, by design, in exchange for not whipsawing.
Settings reference
Impulse window 90 days, smoothing 10 days, z-score window 365 days.
Regime band ±0.4 standard deviations, liquidity confirmation 14 days.
Trend SMMA lengths 15 and 29.
Minimum hold 2 days (uniform anti-whipsaw).
Backtest off by default, with a start date, start capital and a per-trade cost.
What it does not do
It does not call tops or bottoms, it does not short or use leverage, and it cannot dodge a one-day shock because the confirmation logic needs more than one bar. It is built for gradual, liquidity-driven cycles and it will sit through deep drawdowns, especially on alts. Macro data updates monthly and on a lag, so treat the liquidity read as a backdrop, not a high-frequency timer.
Originality
Most liquidity tools overlay the level of Global M2 on price. This one works off the impulse, normalizes it into a confirmed regime, fuses that with the asset's own trend for alts, and monitors whether the liquidity-to-price relationship is still alive. The combination, and the self-check, are the point.
Disclaimer
For education and research only. Not financial advice and not a recommendation to buy or sell any asset. Markets are risky and you can lose money. Do your own research.
Notas de prensa
Liquidity & Trend: Spot Buy/SellA spot position tool for the daily chart. Long or cash only. No shorting, no leverage. It answers one question: should I be holding this asset right now, or sitting in cash? It does that by reading the global liquidity tide and, for altcoins, the asset's own price trend, then printing plain BUY and SELL signals.
The idea
Global liquidity is usually drawn as a line laid over Bitcoin, but the level of money supply next to price is noisy and the relationship drifts in and out. What holds up better is the impulse: the rate of change of liquidity, normalized. This indicator is built entirely on that impulse, and on the long-observed tendency for it to lead Bitcoin by roughly a quarter.
How it works
- Global M2 is built from the M2 money supply of the US, Eurozone, Japan, China, UK and Canada, each converted to USD by its FX rate, then summed.
- The impulse: Global M2 is smoothed with a 10-day average, its 90-day rate of change is taken, and that is z-scored against the trailing 365 days. That single z-line is the engine.
- Regime: liquidity turns bullish when the impulse z crosses above +0.4 standard deviations and bearish below -0.4, with hysteresis in between and a 14-day confirmation before any flip commits. It is deliberately slow. It is built for cycles, not for days.
- Trend leg (for alts): a dual smoothed moving average (Wilder/RMA) cross, lengths 15 and 29, on the chart's own price. It captures the asset's own momentum, which the macro data cannot see.
- Minimum hold: one uniform rule for every asset. A position is held at least 2 bars before the opposite signal can fire, which removes next-day round-trip whipsaw on volatile names. It is structural, identical across assets, and not tuned per coin.
Three modes
- Liquidity: hold when the liquidity regime is bullish. Best fit for Bitcoin, which tracks the global tide closely.
- Trend (SMMA): hold when the price trend is bullish. A pure trend follower for the charted asset.
- Combined (OR): hold when either liquidity or price trend is bullish, and move to cash only when both are bearish. Built for altcoins, where the macro read alone is too slow to catch asset-specific moves.
Suggested use: Liquidity mode on Bitcoin, Combined mode on alts.
On the chart
- BUY and SELL markers where the position state changes.
- Background shading: green when the model says hold, red when it says cash. The signals and shading always cover the entire chart.
- The two trend SMMA lines, colored by direction (optional).
- A compact live-state table: the active mode, current action, the liquidity state, the price-trend state, the current impulse z, the impulse trend, a three-week z trail, the signal-health status, and days in state.
The "Impulse trend" row (your forward read)
The liquidity impulse turns before the confirmed regime does, so this row is the early tell. It shows the impulse direction, how many days it has persisted, and exactly how far the impulse is from the band that would flip the regime. For example, "RISING 7d, 0.57 to +0.4" means the impulse has been rising for seven days and needs to climb another 0.57 sigma to flip the regime bullish. It carries the leading information in words, without a forecast overlay to misread.
Signal-health monitor
Every liquidity relationship eventually decays, so the indicator watches its own edge. It tracks the one-year correlation between the lead-shifted impulse and price momentum, and the two-year gap between average daily returns on liquidity-bullish days versus liquidity-bearish days. If that gap stays negative for a month, it flags the model as degraded. The aim is to be told when the relationship stops working, not flattered by it.
Optional backtest
A simple long-or-cash spot backtest can be switched on in the table (off by default). It shows trades, return, buy-and-hold and max drawdown, measured from a configurable start date (default 2017, the live-data era). It is a basic simulation for context, not a performance promise, and it never affects the buy/sell signals.
Alerts
- BUY signal and SELL signal.
- Liquidity impulse upturn or downturn confirmed (early context, not a trigger).
- Signal health degraded or recovered.
How to use it
Run it on the 1D timeframe. Read the green/red state as a position regime, not a precise top or bottom timer. The model confirms turns rather than predicting them, so it tends to be a little late to the exact low and the exact high, by design, in exchange for not whipsawing.
Settings reference
- Impulse window 90 days, smoothing 10 days, z-score window 365 days.
- Regime band plus or minus 0.4 standard deviations, liquidity confirmation 14 days.
- Trend SMMA lengths 15 and 29.
- Minimum hold 2 days (uniform anti-whipsaw).
- Backtest off by default, with a start date, start capital and a per-trade cost.
What it does not do
It does not call tops or bottoms, it does not short or use leverage, and it cannot dodge a one-day shock because the confirmation logic needs more than one bar. It is built for gradual, liquidity-driven cycles and it will sit through deep drawdowns, especially on alts. Macro data updates monthly and on a lag, so treat the liquidity read as a backdrop, not a high-frequency timer.
Originality
Most liquidity tools overlay the level of Global M2 on price. This one works off the impulse, normalizes it into a confirmed regime, fuses that with the asset's own trend for alts, and monitors whether the liquidity-to-price relationship is still alive. The combination, and the self-check, are the point.
Disclaimer
For education and research only. Not financial advice and not a recommendation to buy or sell any asset. Markets are risky and you can lose money. Do your own research.
Notas de prensa
- Added the ability to move the table to different positions on the chart.Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.