SPX Fair Value Strategy UltimateThis is a strategy using the SPX Fair Value derived from Net Liquidity.
Net Liquidity function is simply: Fed Balance Sheet - Treasury General Account - Reverse Repo Balance
Formula for calculating the fair value of SPX using Net Liquidity looks like this: net_liquidity/1000000000/1.1 -1625
The SPX Fair Value is then subtracted from the SPX value which creates an oscillating diff value.
When diff is greater than 350, SPX is considered overbought and we go short/sell.
When diff is less than -150, SPX is considered oversold and we cover/buy.
The net liquidity values I calculate outside of TradingView. If you'd like the strategy to work for future dates, you'll need to update them.
Paremeters:
Strategy: Short Only, Long Only, Long/Short
Inverse (bool): check if using an inverse ETF to go long instead of short.
Start After Date: When the strategy should start trading
Close Date: Day to close open trades. I just like it to get complete results rather than the strategy ending with open trades.
Cari dalam skrip untuk "spx"
Enhanced SPX and BTC Overlay with EMASPX-BTC Momentum Gauge and EMA Cross Indicator
Thorough Analysis:
• Combined Overlay (Green/Red Line):
o Function: Plots a wide line over the price chart, representing a composite of SPX and BTC dynamics adjusted by volume data.
o Color Coding:
Green: Indicates bullish conditions when the combined value exceeds its 10-period SMA and Bitcoin volume increases.
Red: Signals bearish conditions when the combined value drops below its 10-period SMA and Bitcoin volume decreases.
o Line Characteristics:
Width: Set at 8 for high visibility.
Transparency: 86% for both colors to overlay without obscuring candlesticks.
Scaling: Uses a factor of 0.02446 to amplify movements, making trend changes more noticeable.
• Continuous Bright Red and Green Lines:
o 20-period EMA of Current Ticker (Red):
Purpose: Acts as a medium-term trend indicator, smoothing price data to reflect the asset's general direction over time.
Color: Bright red for easy identification.
Transparency: 60% to keep it visible but not overpowering.
o 5-period EMA of BTC (Green):
Purpose: Provides insights into short-term Bitcoin momentum, capturing rapid changes in market sentiment.
Color: Bright green to distinguish from the red EMA.
Transparency: 30% for high visibility against price movements.
Detailed Analysis of the EMA Cross:
• Crossing Points:
o Bullish Crossover:
Occurs when the 5-period BTC EMA (green) moves above the 20-period EMA of the current ticker (red).
Suggests that Bitcoin's short-term momentum is gaining strength relative to the asset's medium-term trend, potentially signaling an upcoming uptrend or strengthening of an existing one.
o Bearish Crossover:
When the green line falls below the red, it indicates that Bitcoin's immediate momentum is weakening compared to the asset's medium-term trend, which might precede a downtrend or confirm one.
• Early Trade Signals:
o Entry/Exit Points:
These crossovers can guide traders in making timely decisions to enter or exit trades, especially when corroborated by the combined overlay's color.
o Confirmation:
EMA crossovers can confirm trends indicated by the combined overlay. For example, a bullish crossover with a green combined line could validate a buying opportunity.
o Volatility Insights:
The rapid shifts in Bitcoin's 5-period EMA highlight potential volatility spikes, offering an additional layer of market analysis, particularly useful in volatile markets.
• Strategic Use:
o Multi-Market Insight: The script integrates data from both traditional (SPX) and crypto (BTC) markets, allowing for a more comprehensive analysis of market conditions.
o Decision-Making: Provides traders with visual cues for market sentiment, trend direction, and potential reversals, enhancing strategic trading decisions.
o Trend Confirmation: The combination of EMA crossovers and the overlay's color changes offers a multi-faceted approach to trend confirmation or divergence.
In Summary:
• This script merges elements of traditional stock market analysis with cryptocurrency dynamics, utilizing color changes, line thickness, and EMA crossovers to visually communicate market conditions, offering traders a robust tool for analyzing and acting on market movements.
SPX Open vs SMA AlertThis indicator is specifically designed to identify the first market-relevant candle of the S&P 500 (SPX) after the market opens. The opening price of the trading day is compared to a customizable simple moving average (SMA) period. A visual marker and an alert are triggered when the opening price is above the SMA. Perfect for traders seeking early market trends or integrating automated trading strategies.
Features:
Market Open: The indicator uses the New York market open time (09:30 ET), accounting for time zones and daylight saving time changes.
Flexible Time Offset: Users can set a time offset to trigger alerts after the market opens.
Customizable SMA: The SMA period is adjustable, with a default value of 10.
Visual Representation: A step-line SMA is plotted directly on the chart with subtle transparency and clean markers.
Alert Functionality: Alerts are triggered when conditions are met (opening price > SMA).
Usage:
This indicator is ideal for identifying relevant trading signals early in the session.
Alerts can also serve as triggers for automated trading, e.g., in conjunction with the Trading Automation Toolbox.
Supports both intraday and daily charts.
Alarm Settings:
Select the appropriate symbol (e.g., SPX) and the alert condition "SPX Open > SMA10".
Trigger Settings:
Choose "Once Per Bar Close" to ensure the condition is evaluated at the end of each candle.
If you prefer to evaluate the condition immediately when it becomes true, choose "Once Per Minute".
Duration:
Set the alarm to "Open-ended" if you want it to remain active indefinitely.
Alternatively, set a specific expiration date for the alarm.
SPX and Federal Net Liquidity differenceScript for applying Federal Net Liquidity to the SPX post-2020 monetary policy. Original indicator from jlb05013 with adjustments to make it more readable and usable. When the indicator is above 250 the SPX is overbought and when it's below -250 the SPX is oversold.
It's not perfect, I'm just publishing because I didn't see it already out there.
SPX Options Days Drop By DeltaSimple script that uses the percentage drop for a particular options delta and DTE to show how often you would be assigned on selling cash secured Puts (or naked Puts). Calculate the estimated percentage drop by finding your desired delta in the options chain and divide that price by the current price. For example a Delta of 10% could be $4055 with a current price of $4161 on a given day. The price differential is 2.5%. We test for how many times a 2.5% drop is encountered for our days to expiry (DTE) as this will be the number of times you would be assigned for that position. The lower the Delta the more the price has to drop ie a Delta of 7% would require a 4% drop etc. Objective is to NEVER be "assigned" and make "fee money" selling premium ie Puts.
SPX options expire 3 times a week as do SPY options
SPX options use the European model
SPX options settle in cash ie you are not assigned
NOTE: If you change your DTE you change your Delta and therefore your percentage differential.
SPX overnightThis script calculates SPX value during off trading hours, including overnight after the afterhours (before the pre hours of trading), based on value of ES1!
Script is intended to be used only with ES1! ticker, for now and timeframes up to 120 minutes.
It draws a line of ES1! price at NYSE previous day's closing time (4pm NY time) and displays change since that moment and caluclates spx value based on these data.
Also it can draw a previous week's closing line as well.
Whoever wants to improve this script is more than welcome to do it.
I just did it to be enough for what I needed it.
SPX Fair Value Bands V2An updated version of the SPX Fair Value Bands script from dharmatech and based on the net liquidity concept by MaxJAnderson .
Now with full customization of parameters through the settings (Dialog Box) and allowing the options to the use of
1) Standard Bands based on Offsets of the Fair Value
2) Bollinger Bands
3) Keltner Channels
to better capture buy/sell areas rather than relying on noisy unreliably (and unevenly) updated data from the Treasury/Fed.
==================================
Net Liquidity's importance in the new post-COVID QE to QT regime as described MaxJAnderson
----------------
" In past cycles, size of Fed's balance sheet changed a lot, while TGA and RRP changed relatively little. So size of balance sheet roughly equated Net Liquidity.
(The Treasury General Account) TGA and (Reverse Repo) RRP didn't matter. They were rounding errors by comparison.
But starting in 2020, relative changes in TGA and RRP have been THREE TIMES LARGER than the change in size of the Fed's balance sheet. As result, changes in TGA and RRP have taken over as the primary drivers Net Liquidity.
This is new, and changes the game significantly. Again - the size of the Fed's balance sheet doesn't matter.
What matters is the portion of it that's available to circulate in the economy (Net Liquidity).
And ever since 2020, the Treasury and Reverse Repo have become what controls that. Not the size of Fed's balance sheet.
----------------
The idea that follows is simple,short when $SPX reaches extreme levels of overvaluation, and close out when SPX returns to being undervalued. Here's the formulas I currently use to determine fair value:
Fair Value = (Fed Bal Sheet - TGA - RRP)/1.1 - 1625
And here's the trading rules I currently follow:
Short when diff of $SPX - Fair Value > 350
Close when diff of $SPX - Fair Value < 150
When one of these rules is triggered upon market close on a given day, trades are entered at open of the following day "
SPX/ES Basis [Overlay] [Moto]Hello traders,
This script visualizes the difference or "Basis", via %, in price between the SPX and The CME ES Mini Futures.
Understandably, if the ES is significant higher than it underlying index, correlated assets (like crypto) may be prone to revert to the downside, and vice versa if the ES is significantly under the SPX.
This indicator is to be taken in confluence with other factors and shouldn't be used on its own.
I've also included a resolution setting that will change the referenced candles of the SPX/ES. The default setting will have the time frame adjust with the observed resolution.
Thanks
SPX Intraday Mood IndicatorThe SPX Intraday Mood Indicator tries to gauge the intraday market direction of the S&P 500 (SPX) by focusing on internal market data.
Based on the 0DTE Mood Indicator concept. Overall strength/weakness is converted into a directional Mood Percentage which can help with choosing a trade type.
Use at your own risk and discretion. Potential trade ideas offer no guarantees. Intraday Charts Only. Turn off extended hours data. Only works on SPX.
This first version is untested and I am only sharing it to gather feedback on its accuracy, use at your own risk.
spx levelsThis script accommodates a 'string' using the formatting $ symbol then label (liek support for example). The string can be anything oyu want that you make up. I use it for SPX and publish a string daily for my substack subscribers. This is here for them but its free for anyone
SPX Fair Value BandsThese are based on Darius Dale and Max Anderson's Net Liquidity model.
This is intended for use with the $SPX chart.
SPX Scalping StrategyThis strategy points out good entries and exits to go with the direction of SPY
Used with:
Ticker: SPX 500 USD
Heiken Ashi Candles
1, 3, 5 min timeframe
SPX DivergenceScript plots divergence of SPX sectors and world markets based on 3 months return of various ETF's.
Excessive divergence in returns typically preceeds strong market downturns 1-2 weeks ahead of time.
SPX Sector % Member above MA20This indicator shows the SPX sector members which are above ma20. And bold black line is the total, if it is above 1000 which means market so hot and you should sell, or if it is below 200 means you should buy.
SPX DIXThis is the SPX DIX from Squeezemetrics. The code was generated with Python-Pandas. I cannot get the full DIX because I hit the variable limit and have not found a workaround. Publishing this to see if others know of a workaround.
SPX ATR14 indicator This indicator works well on SPX 500
Needs to be inverted so Red is at the bottom
Levels of pullbacks are used to determine trend .
Pullback to the Green zone normal Bull Market
Pullback to the Brown Zone are warning of potential Bear Market , but if it holds , just a deeper correction within a Bull Market
Pullbacks into the Red , Bear Market .
In Bear , wait until indicator is forming a reversal trend up and price should make a divergence by either making a new low or retesting previous low.
The Blue MA is the 33 MA and can be used as a form of stop trend indicator on the cross below the MA
Rate Of Change - Weekly SignalsRate of Change - Weekly Signals
This indicator gives a potential "buy signal" using Rate of Change of SPX and VIX together,
using the following criteria:
SPX Weekly ROC(10) has been BELOW -9 and now rises ABOVE -5
*PLUS*
VIX Weekly ROC(10) has been ABOVE +80 and now falls BELOW +10
The background will turn RED when ROC(SPX) is below -9 and ROC(VIX) is above +80.
The background will turn GREEN when ROC(SPX) is above -5 and ROC(VIX) is below +10.
So the potential "buy signal" is when you start to get GREEN BARS AFTER RED - usually with
some white/empty bars in between...but wait for the green. This indicates that the volatility
has settled down, and the market is starting to turn up.
This indicator gives excellent entry points, but be careful of the occasional false signals.
See Nov. 2001 and Nov. 2008, in both cases the market dropped another 25-30% before the final
bottom was formed. Always have an exit strategy, especially when buying in after a downtrend.
How I use this indicator, pretty much as shown in the preview. Weekly SPX as the main chart with
some medium/long moving averages to identify the trend, VIX added as a "Compare Symbol" in red,
and then the Weekly ROC signals below.
For the ROC graphs, you can show SPX+VIX together, SPX alone, or VIX alone. I prefer to display
them separately because they don't scale well together (VIX crowds out the SPX when it spikes).
Background color is still based on both SPX/VIX together, regardless of which graph is shown.
Note that there is no VIX data available on Trading View prior to 1990, so for those dates the
formula is using only ROC(SPX) and the assigned thresholds (-9 and -5, or whatever you choose).
Expected SPX Movement by timeframeTHIS INDICATOR ONLY WORKS FOR SP:SPX CHART
This code will help you to measure the expected movement of SP:SPX in a previously selected timeframe based on the current value of VIX index
E.g. if the current value of VIX is 30 we calculate first the expected move of the next 12 months.
If you selected the Daily timeframe it will calculate the expected move of SPX in the next Day by dividing the current VIX Value by the squared root of 252
(The 252 value corresponds to the approximate amount of trading sessions of the year)
If you selected the Weekly timeframe it will calculate the expected move of SPX in the next Week by dividing the current VIX Value by the squared root of 52
(The 52 value corresponds to the amount of weeks of the year)
If you selected the Monthly timeframe it will calculate the expected move of SPX in the next Week by dividing the current VIX Value by the squared root of 12
(The 12 value corresponds to the amount of months of the year)
For lower timeframes you have to calculate the amount of ticks in each trading session of the year in order to get that specific range
Once you have that calculation it it'll provide the range expressed as percentage of the expected move for the following period.
This script will plot that information in a range of 2 lines which represents the expected move of the SPX for the next period
The red flag indicator tells if that period closed between the 2 previous values marked by the range
VocsOng Intraday Support ResistanceOverview
This indicator is meant for intraday trading, mainly designed for SPX . The main purpose of this indicator is to mark out the key levels of support and resistance for intraday.
There are 9 main support and resistance that forms this intraday support resistance indicator.
1. Today's Open
Today's open is often a neglected area because by default change percentage is always based on yesterday close. So having a line drawn for today's open is the very starting point.
2. Yesterday Close
3. Yesterday High
4. Yesterday Low
Yesterday Close, High, Low are important intraday trading areas, it is very common that price action resist at this area.
5. Past 4 Days Calculated Estimated High (YesterdayClose + (EstimatedRange/2) :: EstimatedRange = Nearest day x0.4, followed by 0.3, 0.2, 0.1)
6. Past 4 Days Calculated Estimated Low (YesterdayClose - (EstimatedRange/2) :: EstimatedRange = Nearest day x0.4, followed by 0.3, 0.2, 0.1)
This is a calculated estimated high/low range based on past 4 days range. Weighing the nearest day heaviest of 40%, followed by 30%, 20%, 10%.
This calculated high/low area apparently also act as good support and resistance area sometimes.
7. Expected Move High (YesterdayClose + VIX/100 * SquareRoot(1/365))
8. Expected Move Low (YesterdayClose - VIX/100 * SquareRoot(1/365))
This is the formula used to calculate expected move LIVE based on current VIX. This is based from today's open.
9. 1.5% to 2% from SPX Open today
This marks out a zone where SPX is 1.5% to 2% away from today's open. This gives a general guide on a fix percentage change based on today's open.
Statistically, SPX close within 1.5% change from today's open 93.18% of the time in the past 10 years.
How I use them?
First to note, this indicator works best on 1 minute chart. Other timeframe might not be that accurate.
All these are intraday support and resistance. They can be simply use as support and resistance by default.
In addition to that, 7,8,9 are also used as overbought/oversold indicator because they are centered to today's open.
As SPX move towards 7,8,9, it shows how overbought or oversold it is.
I use this indicator with SPX 0 dte options trading.
So as SPX approaches the oversold area, and near any of the support, I will sell a 30 wide put credit spread at 5 delta away or $1 target credit.
This trade entry goes together with a bracket take profit (80%) and stop loss (200%) OCO order.
SectorsThis script attempts to show the relative strength of the 11 sectors in the SPX, which can be accomplished in three ways:
1. Sectors - displays all sector indices as they appear normally
2. Sector Relativity - displays each sector divided by the sum of the other 10 sectors
3. Sector Alpha - displays the alpha of each sector as compared to the sum of the other 10 sectors
I have seen some other iterations of this script that compare each sector to the SPX as a whole, a couple problems with that:
1. SPX sector weightings are unequal and change quarterly, meaning you will get an inaccurate depiction of relative sector strength across time.
2. Even if using an equal-weight SPX, you would be comparing a sector to itself as all 11 sectors are included in the SPX, not just the complementary 10 you are looking to compare one sector to.
For more information on the sectors in the SPX or the calculation of Alpha, visit the links at the top of the script.
*Includes an option for repainting -- default value is true, meaning the script will repaint the current bar.
False = Not Repainting = Value for the current bar is not repainted, but all past values are offset by 1 bar.
True = Repainting = Value for the current bar is repainted, but all past values are correct and not offset by 1 bar.
In both cases, all of the historical values are correct, it is just a matter of whether you prefer the current bar to be realistically painted and the historical bars offset by 1, or the current bar to be repainted and the historical data to match their respective price bars.
As explained by TradingView,`f_security()` is for coders who want to offer their users a repainting/no-repainting version of the HTF data.
Plotting SPX LineIntroduction
This is our second script on TradingView. The script plots SP500 Index as a line on your Trading View Platform. Plotting the SPX line on your charts is a good visual to see how a stock is acting relative to the markets.
Instructions on How To Add this Script to Your TradingView Charting Platform
Step 0: Head over to www.tradingview.com
Step 1: Add “Plotting SPX Line” to your Favorites by clicking “Add to Favorite Scripts” near the bottom of the page.
Step 2: Click “Indicators” at the very top on TradingView. Under Favorites click “Plotting SPX Line”
Step 3: Hover on the Indicator name (Plotting SPX Line) on your plot under legend and click the three dots (see screenshot). Under the “Move To” choose “New Pane Above”.
Step 4: Done. You have now plotted the SPX Line on your Trading View Platform.
BTC & SPX vs Yield Curve: Recession Risk ZonesBTC & SPX vs Yield Curve – Recession Risk Zones
This tool helps you track Bitcoin (BTC) and the S&P 500 (SPX) against key macro signals from the U.S. yield curve to spot potential recession risks.
🟪 Color Legend:
🔴 Red = Yield curve is inverted (warning starts)
🟡 Yellow = Projected 6–18 month recession risk (if inversion still active)
🟠 Orange = Active 6–18 month risk window (after inversion ends)
💜 Fuchsia = Real historical U.S. recessions
📈 What’s Plotted:
🔵 BTCUSD (blue line) – Normalized price
🟢 S&P 500 (green line) – Normalized price
🟠 10Y–2Y Yield Spread – Macro signal for risk
✅ Use it to:
Spot macro pressure zones
See how BTC and SPX behave around economic stress
Stay cautious when red/orange/yellow areas appear
Let me know if you'd like to enable toggles to hide/show BTC or SPX independently!