OPEN-SOURCE SCRIPT

Pearson Correlation Best MA [victhoreb]

1 017
Pearson Correlation Best MA is an innovative indicator designed to dynamically select the moving average that best aligns with price action based on the Pearson correlation coefficient. Here’s what it does:

- Multiple MA Evaluation: The indicator computes eight different moving averages — SMA, EMA, DEMA, TEMA, LSMA, RMA, WMA, and VWMA — using a user-defined period.

- Correlation Analysis: For each moving average, it calculates the Pearson correlation with the price (using the average of high and low) over a specified correlation length, then identifies the one with the highest correlation.

- Optional Smoothing: Users can opt to further smooth the selected best moving average for an even more refined signal.

- Visual Cues: The indicator plots the “Best MA” on the chart, colors it based on its direction (bullish or bearish), and also displays the correlation value. Additionally, it can color the price candles to reflect the trend indicated by the best moving average.

- Customizability: All key parameters such as moving average length, correlation length, smoothing options, and color settings are fully customizable.

This tool helps traders by automatically adapting to market conditions—highlighting the moving average that is most in sync with current price trends, potentially improving trade timing and decision-making.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。