OPEN-SOURCE SCRIPT
已更新 EMA Cloud [PhantomCipher]

EMA Cloud
EMA Cloud shows the trend as a shaded band between two exponential moving averages, with a third EMA drawn as a longer-term reference line.
SNAPSHOT: the indicator on a clean chart, with the cloud in both colours and the 200 EMA line visible
How it works
Settings
Alerts
Create the alert with Once Per Bar Close. A cross that happens part-way through a bar can reverse before the bar closes.
The trend flip comes from comparing the two EMAs:
Pine Script®
SNAPSHOT: close-up of a trend flip, with the cloud changing colour where the two EMAs cross
How to use it
A change in cloud colour marks a shift in trend between the two EMAs. The 200 EMA adds context. For example, you might take only uptrend signals while price is above it, and only downtrend signals while price is below it.
Example chart:
BTCUSDT.P
This indicator shows trend conditions. It's not a trading signal on its own, so combine it with your own analysis and risk management.
EMA Cloud shows the trend as a shaded band between two exponential moving averages, with a third EMA drawn as a longer-term reference line.
SNAPSHOT: the indicator on a clean chart, with the cloud in both colours and the 200 EMA line visible
How it works
- Cloud: the area between a fast EMA (50 by default) and a slow EMA (100 by default) is filled. It's green while the fast EMA is at or above the slow EMA (uptrend) and red while it's below (downtrend).
- EMA lines: the fast and slow EMAs are also drawn as lines that change colour with the trend.
- Reference line: a separate EMA (200 by default) is drawn as a single line. It's not part of the cloud and its colour doesn't change with the trend. Use it to see where price sits against the longer-term trend.
Settings
- Inputs tab: the length of each EMA, grouped into "EMA Cloud" (fast and slow) and "EMA Line" (the reference EMA).
- Style tab: every colour, line width and on/off switch, including separate uptrend and downtrend colours for the cloud and for each EMA line.
Alerts
- EMA Trend Up: fires when the fast EMA crosses above the slow EMA.
- EMA Trend Down: fires when the fast EMA crosses below the slow EMA.
Create the alert with Once Per Bar Close. A cross that happens part-way through a bar can reverse before the bar closes.
The trend flip comes from comparing the two EMAs:
SNAPSHOT: close-up of a trend flip, with the cloud changing colour where the two EMAs cross
How to use it
A change in cloud colour marks a shift in trend between the two EMAs. The 200 EMA adds context. For example, you might take only uptrend signals while price is above it, and only downtrend signals while price is below it.
Example chart:
This indicator shows trend conditions. It's not a trading signal on its own, so combine it with your own analysis and risk management.
版本注释
Update- Added a short summary to the top of the source code.
- No change to how the indicator works. The cloud, lines, settings and alerts are the same as before.
Example chart:
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。