OPEN-SOURCE SCRIPT

Market Phases [OmegaTools]

The Market Phases indicator utilizes the Detrended Price Oscillator (DPO) to assess various asset classes, bonds, or stock sectors across different market phases. It offers users the ability to monitor and compare trends in multiple markets through a normalized DPO approach, providing insights into relative overbought or oversold conditions. The indicator supports three distinct modes: "Asset Classes," "Bonds," and "Stock Sectors," allowing flexibility in market analysis based on user preference.

Key Features:
Detrended Price Oscillator (DPO) Calculation: The DPO is computed to remove longer-term trends and focus on shorter-term cyclical behavior. The indicator applies normalization using linear interpolation to smooth out the values for better comparison across different markets.

Three Analysis Modes:
Asset Classes: Compares the DPO for major asset classes, including stocks (S&P 500), bonds (US 10-Year), commodities (Gold), and the US Dollar Index (DXY).
Bonds: Analyzes the DPO across various bond categories such as investment-grade bonds (LQD), high-yield bonds (HYG), emerging market bonds (EMB), and corporate bonds.
Stock Sectors: Provides insight into key stock sectors, including Technology (XLK), Utilities (XLU), Financials (XLF), and Healthcare (XLV).
Real-Time Plotting:
The indicator plots the DPO values of the selected assets, bonds, or sectors on the chart. It provides a visual representation of the market phases, helping to identify potential market reversals or trends. Each plot is color-coded for clarity:

Blue: Asset/Sector 1
Red: Asset/Sector 2
Green: Asset/Sector 3
Orange: Asset/Sector 4

Table Display:
A dynamic table is displayed on the chart, showing the DPO values for the selected mode's assets or sectors. This allows quick comparison and evaluation of market trends.

Inputs:
DPO Length: Defines the lookback period for DPO calculation, adjustable between 10 and 500.
Normalization Length: Sets the length for normalizing the DPO values, with options ranging from 100 to 2000.
Mode: Choose between "Asset Classes," "Bonds," or "Stock Sectors" for tailored market analysis.

This tool is perfect for traders seeking to identify cyclical market phases, compare different asset classes, or monitor sector rotation dynamics. Use it to align your trading strategies with broader market trends and uncover potential trading opportunities across multiple markets.
CyclesOscillatorssentiment

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明