OPEN-SOURCE SCRIPT

Cryptomarket Regime

337
This Pine Script indicator, titled "Cryptomarket Regime," aims to analyze the current market regime of the cryptocurrency market by considering various factors such as correlation, z-scores, and exponential moving averages (EMAs) for trend classification.

1. **Indicator Settings**:
- It allows users to toggle the display of bar colors, the EMA plot, and the exclusion of small-cap assets for a more focused analysis.
- Users can adjust parameters such as the length of the EMA, z-score, correlation length, and weight.

2. **Asset Data Retrieval**:
- The script retrieves daily close price data for various cryptocurrencies such as BTC, ETH, SOL, BNB, DOGE, ADA, and others, as well as market indices like TOTAL, TOTAL2, TOTAL3, and OTHERS.

3. **Correlation Calculation**:
- It calculates the correlation between each cryptocurrency and a specified benchmark symbol (e.g., TOTAL) over a given period.
- The correlation values are used to adjust z-scores later in the script.

4. **Z-Score Calculation**:
- Z-scores are calculated for each cryptocurrency based on its daily close price and a specified length.
- These z-scores represent the deviation of each asset's price from its mean in terms of standard deviations.

5. **Z-Score Market Sum**:
- The script computes a weighted sum of z-scores across selected assets, adjusting for correlation.
- Users can choose to include or exclude certain assets from this calculation.

6. **EMA Trend Analysis**:
- Exponential moving averages (EMAs) are calculated for each cryptocurrency based on a specified length.
- Crosses above or below these EMAs are identified to indicate potential trend changes. The trend number indicators how many bars have closed since the last crossover(bull) and crossunder (bear).

7. **Plotting**:
- The script plots the EMA of the primary charting asset (e.g., BTC/USD) if configured to do so.
- Additionally, it can display bar colors based on user preference.

8. **Overall Z-Score Calculation**:
- The final z-score is computed as a weighted combination of the market sum z-score and the z-score of the primary charting asset.
- This final z-score aims to provide a comprehensive assessment of the market regime, considering both the broader market context and the specific asset being analyzed.

Overall, this indicator offers a multi-dimensional analysis of the cryptocurrency market, considering correlations, z-scores, and trend indicators to provide insights into market conditions and potential trading opportunities. Users can customize the settings to align with their trading strategies and preferences.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.