Macro Regime Headwind Oscillator

WHAT THIS SCRIPT DOES
This indicator measures whether the macroeconomic environment is currently working for or against the asset on your chart, and it expresses that measurement as a single oscillator running from zero to one hundred. Readings below fifty are supportive conditions, which the script calls tailwind. Readings above fifty are obstructive conditions, which the script calls headwind. The distance from fifty expresses how strong that obstruction or support is.
The script does not study the price of the chart symbol in order to reach its conclusion. It studies nine external macroeconomic series, compresses each of them into a standardised score, decides whether inflation pressure or financial stress is the dominant force behind the current reading, and then blends the two into one number. A separate daily moving average of the chart symbol is used only as a direction filter on the trade signals, never as an input to the oscillator itself.
A dashboard table reports the current regime, the oscillator value, the correlation that drives the regime decision, the inflation weight, the stress index, the internal agreement of the basket, the state of the deflation flip, the last signal fired, and the active symbol and timeframe. Nine alert conditions are provided.
WHY MACRO REGIME INSTEAD OF PRICE MOMENTUM
Most trend tools answer the question of what price has been doing. They are therefore descriptive. A momentum reading on an equity index in the middle of a violent inflation shock will look strong right up to the point where the shock breaks it, because the macroeconomic cause of the move was deteriorating the entire time while the price was still rising.
This script is built on a different premise. Asset prices are discounted expectations, and expectations are constrained by the cost of money, the price of energy, the level of implied inflation, the state of the credit market, and the level of implied volatility. When those constraints tighten, the set of prices that can be sustainably supported narrows. When they ease, it widens. The oscillator attempts to measure the width of that set rather than the position of price inside it.
The second premise is that the same macro reading does not mean the same thing in every environment. A falling yield is bullish for equities when it reflects easing inflation expectations. It is bearish when it reflects collapsing growth expectations during a credit event. A fixed interpretation of any macro series is therefore wrong at least part of the time. This script resolves that problem explicitly rather than ignoring it, through the correlation based regime switch and the deflation flip described below.
HOW THE ENGINE A BASKET IS BUILT
Engine A measures inflation and tightening pressure. It uses four components, each of which is individually standardised so that they can be averaged meaningfully despite having completely different scales.
The four default components are the US Dollar Index, the ten year Treasury yield, West Texas Intermediate crude oil, and the ten year breakeven inflation rate. Each represents a distinct transmission channel through which tightening reaches risk assets. A stronger dollar tightens financial conditions for any borrower or earner in another currency and compresses the translated earnings of multinational revenue. A higher long end yield raises the discount rate applied to every future cash flow and competes directly with risk assets for capital. Higher energy prices are a tax on consumption and an input cost on production that arrives before it appears in any published inflation figure. The breakeven rate is the market priced expectation of inflation itself and represents the component of nominal yield that is not real return.
Each component is converted into a z score, which subtracts the rolling mean of the series over the lookback window and divides by the rolling standard deviation of the same window. The result expresses where the series currently sits relative to its own recent behaviour, in units of its own typical variation. This is what makes a yield measured in percent and an index measured in points comparable. A yield at two standard deviations above its recent mean and a dollar index at two standard deviations above its recent mean are both equally unusual events in their own terms.
The raw z score is then passed through a hyperbolic tangent squashing function, applied at half the raw value. This is a deliberate and important design choice. A z score is unbounded, so a single extreme print in one component could dominate the entire basket and produce an oscillator pinned at its limit. Hyperbolic tangent compresses any input into a range strictly between minus one and plus one, approaches those limits smoothly rather than abruptly, and preserves sign and relative ordering. Dividing the z score by two before squashing means that a one standard deviation deviation maps to roughly forty six percent of full scale rather than seventy six percent, which keeps the middle of the distribution responsive and reserves the extremes of the scale for genuinely exceptional conditions. The effect is that the basket saturates gracefully instead of clipping.
The four squashed scores are then averaged with equal weight, with any disabled or unavailable component excluded from both the sum and the weight total. The output is a signed value between minus one and plus one, where positive means tightening pressure and negative means easing pressure.
DIRECTIONAL VOTES AND THE AGREEMENT MULTIPLIER
A standardised average has a known weakness. It can produce a confident looking reading from components that are pointing in opposite directions, because opposing contributions partially cancel and leave a small residual that is then treated as a genuine signal. Engine A addresses this with a separate agreement calculation that runs alongside the score.
Each component is also compared against its own simple moving average of the directional moving average length. A component above its average casts a vote of plus one, meaning tightening. A component below casts minus one, meaning easing. The agreement figure is then computed as the number of components plus the absolute value of the vote sum, divided by twice the number of components. This formula returns exactly fifty percent when the votes are perfectly split, and exactly one hundred percent when every component agrees.
The agreement figure is compared against the minimum agreement threshold. If it meets or exceeds the threshold, the basket score is multiplied by the agreement figure itself, which gently scales the score by how convincing the component set is. If it falls below the threshold, the score is multiplied by the disagreement multiplier instead, which at the default of zero point three five cuts the basket contribution to roughly a third of its calculated value. The basket is therefore not silenced during disagreement, but it is materially muted, and the dashboard reports the live agreement percentage so the user can see when that is happening.
The practical meaning is that a reading built on four aligned components is trusted at close to full strength, while a reading built on two components pulling one way and two the other is treated as a weak hypothesis.
HOW THE STRESS INDEX IS BUILT
Engine B measures acute financial stress and growth shock. It produces an unsigned value between zero and one where zero is calm and one is severe stress. It is built from four independently meaningful stress indicators.
The first is the level and behaviour of implied volatility. This is split into two separate terms. The percentile term ranks the current VIX against every VIX reading in the percentile lookback window, which answers the question of how elevated volatility is relative to its own history regardless of the absolute level. The shock term applies the same z score and squash treatment used in Engine A, but keeps only the positive part, so it responds specifically to abrupt upward moves in volatility and ignores calm ones. The two terms are averaged equally. The purpose of combining them is that a high but stable volatility percentile describes an environment, while a sudden spike describes an event, and both are stressful in different ways.
The second is the VIX term structure. The ratio of spot VIX to three month VIX is measured. Under normal conditions the three month contract trades above spot, because uncertainty compounds over longer horizons, and the ratio sits below one. When spot rises above the three month the curve has inverted into backwardation, which is the market pricing that the immediate present is more dangerous than the medium term future. The ratio is rescaled so that a ratio of one point one zero and above maps to full stress, a ratio of zero point nine zero and below maps to no stress, and the space between is linear. This component is deliberately fast and is one of the most reliable early stress signals available, because term structure inversion typically precedes the corresponding move in realised volatility.
The third is high yield credit. The option adjusted spread of US high yield debt is treated the same way as VIX, with a percentile term weighted at forty percent and a positive only shock term weighted at sixty percent. Credit is weighted toward shock because the credit market is where insolvency risk is priced directly by participants with capital at stake, and sudden spread widening is a more informative event than a gradually elevated but stable spread. Credit stress is also the mechanism through which financial conditions convert into real economic damage, since it is the channel through which refinancing becomes impossible.
The fourth is the yield curve bull steepener. The two year and ten year yields form the curve, and the change in the curve and the change in the two year yield are measured over the curve change length. The component activates only when both conditions hold together, specifically when the two year yield has fallen and the curve has steepened over the same window. That combination is the signature of a market repricing the policy path downward because it expects growth to weaken, and it is a growth scare signal rather than an inflation signal. When it activates, the squashed z score of the curve change contributes positively. When either condition fails, the component contributes exactly zero. It is weighted at half the weight of the two full components because it is the narrowest and most conditional of the four.
These four are combined with weights of one, zero point seven five, one and zero point five respectively. The result is the stress index.
THE STRESS GATE
The stress index is not applied to the final blend as a constant. It passes through a gate that controls how much influence it is permitted to have.
The gate is closed below the stress gate starts level, opens linearly between that level and the stress gate full level, and is fully open above it. At the defaults this means stress below thirty five percent of full scale has no effect on the blend, stress between thirty five and sixty five percent progressively takes control, and stress above sixty five percent has maximum effect.
This design reflects the fact that low level background volatility is not information. Every market has noise, and treating ordinary variation as stress would make the oscillator permanently restless. The gate ensures that stress only begins to influence the output once it is genuinely unusual, and that its influence scales with how unusual it is.
REGIME SWITCHING BY ROLLING CORRELATION
This is the component that separates the script from a static macro dashboard, and it is the reason the same basket score can produce opposite conclusions in different market environments.
The script computes the rolling correlation between the daily log return of the benchmark symbol and the change in the raw basket score, over the correlation length. That correlation is then smoothed with an exponential moving average of the correlation smoothing length to remove the instability that raw short window correlation is known for.
The interpretation is direct. A positive correlation means the basket and the benchmark are rising together, which is a reflation environment, where the macro pressure being measured is accompanied by risk appetite rather than risk aversion. A negative correlation means the basket is rising while the benchmark falls, which is the classic inflation shock, where tightening is actively destroying valuation.
The smoothed correlation is converted into the inflation weight through a linear transform of the form half minus half the regime sharpness multiplied by the correlation, clamped to the range zero to one. At the default sharpness the weight reaches zero when the correlation is at or above one third, and reaches one when the correlation is at or below minus one third. Between those points it moves continuously. The regime sharpness input controls the slope of that conversion, so raising it makes the switch behave more like a binary decision and lowering it makes the transition more gradual.
THE DEFLATION FLIP
The inflation weight alone is not sufficient, because a second failure mode exists. In a growth scare the basket can fall, not because conditions are easing, but because yields and energy are collapsing for the same reason that equities are collapsing. Interpreting that falling basket as supportive would produce a long signal directly into the worst part of the drawdown.
The deflation flip is the mechanism that handles this. It is the product of the stress gate and one minus the inflation weight. It can only become active when stress is elevated and the benchmark is not positively correlated with the basket, which is precisely the condition under which falling macro readings are bad news rather than good news.
When the flip is active, the treatment of a negative basket score changes. Instead of being taken at face value as an easing of pressure, the score is inverted in proportion to the flip value, so a strongly negative basket during an active flip contributes as a negative rather than a positive. The dashboard reports whether the flip is active, and dedicated alerts fire when it turns on and off.
The reflation mute floor handles the opposite side. When the benchmark and the basket are rising together in a positive correlation regime, a rising basket is not read at full strength, because reflation driven tightening is historically far less damaging than shock driven tightening. The floor sets the minimum weight that a positive basket retains in that environment, preventing the script from either ignoring reflation entirely or treating it as an emergency.
AUTOMATIC SYMBOL ADAPTATION
The script adjusts itself to the character of the symbol on the chart without any user configuration.
It calculates a beta between the benchmark return and the basket change over the correlation length, which is the ratio of the covariance of the two to the variance of the basket change, expressed through the correlation and the ratio of their volatilities. This measures how violently the basket swings relative to the benchmark. The absolute value is clamped to a range of one half to two and applied as a multiplier to the blended score. A symbol whose macro sensitivity is low gets a damped oscillator that will not produce false extremes from irrelevant macro noise. A symbol with high macro sensitivity gets an amplified oscillator that reaches the signal zones at macro moves that actually matter to it.
A second term measures divergence. The benchmark price is converted to a z score over the lookback and the basket score is scaled to a comparable range, and the difference between them is scaled and clamped to a narrow band. When price has run far beyond what macro conditions justify, this term subtracts from the score, and when price has lagged macro conditions it adds. It acts as a valuation sanity adjustment on top of the macro reading.
Both terms are computed continuously and are not exposed as inputs, because they are properties of the symbol rather than preferences of the user.
THE FINAL BLEND AND THE ZERO TO ONE HUNDRED SCALE
The stress weight applied to the blend is the base stress weight plus one minus the base stress weight multiplied by the stress gate. At the defaults this means stress carries thirty percent of the blend when markets are calm, and carries everything when the gate is fully open. The inflation engine carries the remainder.
The stress index is converted to a signed form spanning minus one to plus one so that it can be added to rather than merely subtract from. The two contributions are then formed, with the inflation contribution being one minus the stress weight multiplied by the effective basket score, and the stress contribution being the stress weight multiplied by the signed stress.
Their sum is multiplied by the symbol adaptation beta, the divergence term is subtracted, and the result is clamped to minus one and plus one. Fifty is added to fifty times that value, producing the raw oscillator. A final exponential moving average of the output smoothing length is applied to remove residual bar to bar jitter without materially delaying the turning points.
Because of the clamps applied at every stage, the oscillator is bounded. It cannot produce invalid values from an extreme macro print, and a reading of ninety five or of five is by construction a rare event.
TYPE A AND TYPE B REGIMES
The script classifies every reading above the neutral band as one of two distinct regimes, and this distinction changes the colour of the oscillator and the wording on the dashboard.
Type A is inflation or tightening driven headwind. The dominant contribution to the reading comes from the basket engine, which means the obstruction is a cost of money and inflation problem. This type of headwind typically resolves through policy accommodation or through a fall in the dollar, energy or breakevens, and it tends to develop and decay relatively slowly.
Type B is stress or growth shock driven headwind. The dominant contribution comes from the stress engine, which means the obstruction is a credit, volatility or growth scare. This type develops far faster, is usually already visible in the term structure and credit spreads before it is visible in price, and historically has been the more dangerous of the two because it can compound.
The comparison is made on the magnitude of the two contributions rather than on their signed values, so that a strongly negative inflation contribution during an active deflation flip cannot be misread as the dominant driver when the stress term is the actual force in control. The regime alerts fire when the dominant driver changes, which tells the user not just that conditions changed but why they changed.
THE DAILY EMA
A separate exponential moving average of the chart symbol is available as a visual and as a signal filter. It is calculated on its own configurable timeframe, defaulting to the daily chart, and is fetched using the previous closed bar of that timeframe so that it does not repaint.
The line is coloured by its own slope, measured as the percentage change over the slope lookback bars relative to price. A slope above the flat threshold is bullish, below negative flat threshold is bearish, and anything inside the threshold is flat. Users should be aware that a long length moving average moves slowly in percentage terms, so the default flat threshold is rarely exceeded and the flat state will be the common one. Raising the threshold makes flat rarer and the directional states more common.
The EMA is used in two ways. As a visual, it gives the macro reading a price context, so a supportive macro reading into a price above a rising long average reads differently from the same reading into a price below a falling one. As a filter, it gates three of the four signals.
THE FOUR SIGNALS
Four signals are plotted directly on the chart.
The long signal fires when the oscillator crosses under fifty, meaning macro obstruction has eased back through neutral, and the chart symbol is trading above the daily EMA. The strong long signal fires when the oscillator crosses under the strong tailwind threshold, meaning macro conditions have become genuinely supportive rather than merely neutral, again requiring price above the EMA.
The down signal fires when the oscillator crosses above fifty, meaning macro conditions have turned obstructive, and the chart symbol is trading below the EMA. The high risk signal fires when the oscillator crosses above the high headwind threshold, meaning macro conditions are severely obstructive. The high risk signal is not gated by the EMA by default, because severe macro stress is precisely the condition under which price position relative to a long average is least informative, but a gate can be enabled so that it behaves like the other three.
The directional logic is intentionally contrarian to the raw score. A rising oscillator means worsening conditions, so the long signals are generated by the oscillator falling and the short or risk signals are generated by the oscillator rising. This is the correct reading of a headwind measure rather than a momentum measure, and users who expect a rising line to be bullish should read the scale as a pressure gauge rather than a strength gauge.
NON REPAINTING DESIGN
Every external series is requested using the previous closed bar of its own timeframe with lookahead explicitly enabled, which is the standard construction for retrieving higher timeframe or external data without future reference. The value available on any given chart bar is the value that was already fixed at the close of the prior daily bar, so it cannot change after the fact and cannot be influenced by data that did not yet exist.
All oscillator based signals additionally respect the wait for candle close setting. When enabled, which is the default, the crossover conditions are only evaluated on confirmed bars, so a signal cannot appear during a forming bar and then disappear before that bar closes. When disabled, signals evaluate in real time and will track the forming bar, which is faster but can produce signals that are withdrawn. Users running automated alerting should leave this enabled.
The EMA slope classification and all dashboard values are likewise derived only from closed external data.
THE DASHBOARD
The dashboard is a two column table with nine rows that can be positioned anywhere on the pane and resized through its own settings group.
The regime row reports the current classification, being type A inflation and tightening, type B stress and growth shock, tailwind supportive, or neutral. The oscillator row reports the current value and whether it rose or fell on the last bar. The correlation row reports the smoothed correlation between the benchmark and the basket, labelled as inflation when negative and growth when positive, and labelled according to whether the chart symbol or the fixed benchmark is in use. The inflation weight row reports the current percentage weight assigned to the inflation interpretation. The stress index row reports the stress index as a percentage and highlights it in the dashboard alert colour once it exceeds the stress gate full level. The basket agreement row reports the percentage of components voting in the same direction. The deflation flip row reports whether the flip is active. The last signal row reports the most recent signal fired. The final row reports the active symbol and timeframe, so that a screenshot of the chart is always self identifying.
EVERY INPUT EXPLAINED
Engine A group. The US Dollar Index, basket yield, energy and breakeven symbols are each individually replaceable, so the basket can be regionalised, for example replacing the dollar index with a trade weighted peer comparison or replacing West Texas Intermediate with Brent or European natural gas for a European chart. Including breakevens in basket enables or disables the fourth component, reducing the basket to three assets when the breakeven series is unavailable or undesired. Z score lookback bars sets the window for every standardisation in both engines. Directional moving average length sets the reference average for the agreement votes. Minimum agreement for full signal sets the threshold above which the score is trusted at full strength. Multiplier when assets disagree sets the reduced strength applied below that threshold.
Engine B group. The VIX, VIX three month, high yield spread and both yield symbols are individually replaceable. Four separate toggles allow any of the four stress components to be excluded from the index, and each toggle removes the component from both the numerator and the total weight so that disabling one does not silently change the weighting of the others. Percentile lookback bars sets the window for the VIX and credit percentile ranks. Curve change length sets the window over which the two year change and curve change are measured. Stress gate starts and stress gate full set the boundaries of the stress gate. Base stress weight sets the minimum share of the blend that stress always holds.
Regime switching group. Use current chart symbol as benchmark determines whether the correlation is measured against the chart symbol or against a fixed benchmark, which matters because analysing a single stock against its own correlation to the basket gives a different answer from analysing it against an index. Correlation length sets the rolling correlation window. Correlation smoothing sets the exponential average applied to it. Regime sharpness sets the slope of the conversion into the inflation weight. Reflation mute floor sets the minimum weight retained by a positive basket in a positive correlation regime.
Daily EMA group. Show daily two hundred EMA toggles the line. EMA length sets the period. Timeframe sets the timeframe it is calculated on. Slope lookback bars sets the window for the slope measurement. Flat threshold sets the minimum slope percentage for a directional classification. Line width sets the thickness. Three colour inputs set the bullish, bearish and flat appearance of the line.
Visuals and signals group. Output smoothing length controls the exponential average on the final oscillator. High headwind threshold and strong tailwind threshold set the outer signal levels. Neutral band around fifty sets the width of the neutral zone used for the dashboard classification. Show engine components plots the effective basket score and the stress index scaled to the oscillator range so the two engines can be inspected directly. Show regime dashboard toggles the table.
Signal confirmation group. Wait for candle close enables the non repainting confirmation gate. Gate high risk signal with daily EMA adds the price filter to the high risk signal.
Dashboard group. Dashboard position offers nine screen positions. Dashboard text size offers five sizes.
ALERTS
Nine alert conditions are available, all of which respect the confirmation gate where relevant.
Long and bullish macro shift fires on the long signal. Bearish and downward trend shift fires on the down signal. Strong tailwind fires on the strong long signal. High headwind risk fires on the high risk signal. Type B flip activated fires when the deflation flip engages. Type B flip deactivated fires when it disengages. Headwind easing fires when the oscillator crosses back below fifty regardless of the EMA filter, which makes it useful as an early warning that precedes the gated long signal. Regime shifted to type B and regime shifted to type A fire when the dominant driver changes between the stress engine and the inflation engine.
The regime alerts are arguably the most valuable of the nine for position management, because a change in the driver of a headwind often arrives before a change in its intensity, and the appropriate response to a stress driven headwind is very different from the appropriate response to an inflation driven one.
MARKETS AND TIMEFRAMES
The script is intended for four hour charts and above. It displays a visible warning label and should not be relied upon below that level, because the external daily series are sampled against too few chart bars for the standardisation windows to be meaningful.
It is applicable to any market that responds to global financial conditions. Equity indices and large capitalisation equities are the primary use case, since they respond directly to the discount rate and to credit conditions. It is effective on precious metals, which respond to real yields and to the dollar. It is effective on crude oil, which is both a component of the basket and a responding market. It is effective on cryptocurrency, which is in practice a high beta instrument on global liquidity conditions. It is less informative on single currency pairs and on instruments driven primarily by idiosyncratic factors such as small capitalisation stocks with company specific catalysts, commodity futures with their own storage dynamics, or names in a clear corporate specific story.
TRADING STYLES
This is a position and swing timing tool, not an execution timing tool.
For position trading and longer term allocation, the primary use is regime identification. Sustained readings in the tailwind zone justify full target exposure, readings in the neutral band justify normal exposure with attention to the correlation row, and readings in the headwind zone justify reduced exposure. The regime alerts and the deflation flip state are the most relevant outputs at this horizon, and the oscillator value itself matters less than the regime classification and which engine is driving it.
For swing trading on four hour and daily charts, the four signals are the primary tool. The long and strong long signals identify when macro obstruction has eased enough to support a long position, and the down and high risk signals identify when it has turned. Because these are macro signals rather than price signals, they are best used to set directional bias and to time entries in confluence with a price based trigger on the chart, rather than as standalone entries.
For day trading, the script has a legitimate but narrower use as a bias filter. A day trader on a one hour or four hour chart can use the regime classification and the oscillator direction to decide whether to favour long setups or short setups during the session, and to stand aside when the deflation flip is active. It should not be used to generate intraday entries, because its inputs update on a daily cycle.
For scalping, this script is not suitable and no user should attempt it. The underlying data updates once per day, so the fastest possible information in the oscillator is a day old, and any apparent responsiveness on a low timeframe is an artefact of the sampling rather than genuine signal.
This is not an investing research tool in the fundamental sense. It measures market priced conditions rather than fundamentals, so it will not see valuation, earnings quality, balance sheet strength or competitive position.
WORKED EXAMPLES
First example, inflation shock. The dollar, the ten year yield and breakevens are all above their moving averages while crude has spiked. All four components vote the same way, agreement reads one hundred percent, and the basket score is trusted at full strength. The benchmark is falling while the basket rises, so the correlation turns negative, the inflation weight rises toward one hundred percent, and the stress gate remains closed because volatility is calm. The oscillator climbs above fifty and the reading is classified type A. The high headwind threshold is crossed and the high risk signal fires. The correct reading is an orderly but serious tightening environment, where exposure should be reduced but where the historical pattern is a slow degradation rather than a crash.
Second example, growth scare. The dollar is flat, breakevens are falling, and the basket is negative. On a naive reading that is supportive and would generate a long signal. But VIX has inverted its term structure, credit spreads have widened sharply, and the two year yield has fallen while the curve has steepened. The stress index jumps through the gate boundary, the gate opens, the correlation is negative, and the deflation flip activates. The negative basket is now inverted rather than accepted, so the oscillator rises into headwind instead of falling into support, and the reading is classified type B. This is the specific scenario the flip exists to handle, and it is the one in which a static macro dashboard would have produced a catastrophic long signal.
Third example, reflation. Equities are grinding higher alongside rising yields and a firmer dollar. The basket is positive, but the correlation between the basket and the benchmark is positive, so the inflation weight falls to zero and the reflation mute floor limits the weight given to the rising basket. The oscillator rises only modestly and remains below the signal threshold. The correct reading is that tightening is occurring but is being absorbed, and the historical tendency is for this environment to persist far longer than participants expect.
Fourth example, disagreement. Two components are easing and two are tightening. Agreement reads fifty percent, below the threshold, so the basket is multiplied by the disagreement multiplier and contributes at roughly a third of its raw strength. The oscillator flattens toward the neutral band regardless of the direction of the raw score. The correct reading is that there is no macro thesis, and the dashboard agreement row makes that explicit before a signal is taken.
WHAT MAKES IT ORIGINAL
The script is not a combination of existing indicators and does not reuse code from any other publication. Its components are constructed from public domain market concepts, being standardisation, percentile ranking, term structure comparison, credit spreads and curve slope, but the specific formulation, weighting, gating and interaction between them are original to this work.
Three design decisions are specific to this implementation and are not found in standard macro dashboards.
The first is that the interpretation of the macro basket is not fixed but is determined by an observed statistical relationship between the basket and the asset being analysed. Conventional macro tools assign a permanent meaning to each series, so a falling yield is always supportive. Here that meaning is estimated continuously from the data, which means the tool can distinguish an easing cycle from a growth scare without being told which one it is in.
The second is the deflation flip, which resolves the directional ambiguity of a falling basket by conditioning it on both the stress level and the correlation state. This is the mechanism that allows the script to remain long biased in an easing cycle while refusing to be long biased in a collapse, even though both produce falling yields.
The third is the automatic symbol adaptation through beta and divergence, which lets the same script be applied to an index, a metal, a commodity and a cryptocurrency without any per market tuning. The oscillator reaches its signal zones at macro moves that are proportionally significant for the specific symbol on the chart.
The two engines are genuinely complementary rather than redundant. Engine A is slow, persistent and structural, and describes conditions that develop over weeks. Engine B is fast, episodic and acute, and describes events that develop over days. The stress gate determines which of them owns the output at any moment, the correlation switch determines how a basket reading should be interpreted, and the adaptation layer determines how much any of it matters to the chart symbol. Removing any one of these layers changes the behaviour of the others, which is why they are built as one integrated engine rather than as separate indicators on the same chart.
LIMITATIONS AND SHORTCOMINGS
The two Federal Reserve Economic Data series used, the breakeven inflation rate and the high yield option adjusted spread, are published with a delay of approximately one business day and are not updated on weekends or holidays. Those two components can therefore hold a stale value while the market based components have already moved. The script handles unavailable data by excluding the affected component from the calculation rather than treating it as zero, but users should be aware that credit and inflation inputs lag the traded market.
The basket components are denominated in United States dollars and reference United States rates. Applying the script to a market whose primary macro driver is a different currency area will produce a reading that is directionally relevant but not optimal, and the basket symbols should be regionalised in that case.
Rolling correlation over a short window is statistically unstable, and the smoothing applied reduces but does not eliminate that instability. During abrupt regime changes the correlation can whipsaw, and the inflation weight can move with it. The smoothing input exists for this reason and can be raised to stabilise the regime switch at the cost of responsiveness.
The script is inherently a lagging confirmation tool. It measures conditions that have already been priced by the bond, credit and volatility markets, and it will not anticipate a policy surprise, a geopolitical shock or a credit event before those markets react. It is designed to keep a user on the right side of an environment, not to catch the first bar of a reversal.
The automatic adaptation is estimated from a limited window and is clamped, so it will under react for a symbol whose relationship to macro conditions has recently and sharply changed until the window recalibrates.
The flat threshold on the EMA slope is rarely exceeded at long lengths, so the flat state dominates by default.
The signals are macro signals and will be early or late relative to price by design. They identify when conditions become permissive or hostile, not when price will confirm. They should be combined with a price based trigger and risk management, and no signal in this script should be treated as a complete trade.
The script is not a strategy and reports no performance statistics. Nothing here has been backtested or optimised, and no claim of profitability, accuracy or win rate is made or implied.
DISCLAIMER
This indicator is provided for educational and informational purposes only. It is not investment advice, not a recommendation to buy or sell any instrument, and not an offer of financial services. Macro regime analysis is one input among many and can be wrong for extended periods. Markets can remain hostile or supportive far longer than any model expects, and past behaviour of any relationship measured here does not guarantee future behaviour. Users are solely responsible for their own decisions, position sizing and risk management, and should independently verify any reading before acting on it. Trading involves substantial risk of loss.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.