OPEN-SOURCE SCRIPT
EMA Crossover Indicator with UTC Time Filter and Profit Labels

The PineScript code provided is an indicator for TradingView that implements two user-defined Exponential Moving Averages (EMAs) with default periods of 5 and 9, generates buy and sell signals at EMA crossovers, filters these signals based on a user-specified UTC time window, and adds labels when the price moves 100 points in the profitable direction from the entry point. Below is a detailed description of the script's functionality, structure, and key components:
Overview
Key Features
2. Crossover Signals:
( ta.crossover ).
( ta.crossunder ).
3. UTC Time Filter:
window, handling both same-day and overnight ranges (e.g., 22:00 to 02:00).
labels.
4. Profit Tracking (+100 Points):
or more from the entry price.
or more from the entry price.
avoid chart clutter.
5. Visual Elements:
Labels:
the profit threshold is met.
Code Structure
overlay=true): Defines the indicator name and sets it to overlay on the price chart.
emaShortPeriod and emaLongPeriod: Integer inputs for EMA periods
(defaults: 5 and 9).
(defaults: 00:00 to 23:59).
closing price.
emaLong = ta.ema(close, emaLongPeriod): Computes the Long EMA.
then checks if the current time is within the specified range. Handles overnight
ranges correctly.
active signal type), `profitLabelPlaced` (prevents multiple profit labels).
met.
Usage
Setup: Add the indicator to a TradingView chart. Adjust EMA periods, UTC time
window, and points threshold via the indicator settings.
a signal.
Applications: Useful for traders who want to:
- Identify when a trade reaches a specific profit target.
Notes
price (e.g., $100 for stocks, 100 pips for forex). Adjust `pointsThreshold` for
different assets.
markets.
the chart clean.
account for multiple hits of the threshold unless a new signal occurs.
If you need further clarification or want to add features (e.g., alerts, additional profit levels, or different time filters), let me know!
Overview
- Platform:
- Indicator Type:
Key Features
- User-Defined EMAs:
- - **Long EMA**:
2. Crossover Signals:
( ta.crossover ).
( ta.crossunder ).
3. UTC Time Filter:
window, handling both same-day and overnight ranges (e.g., 22:00 to 02:00).
labels.
4. Profit Tracking (+100 Points):
or more from the entry price.
or more from the entry price.
avoid chart clutter.
5. Visual Elements:
Labels:
the profit threshold is met.
Code Structure
overlay=true): Defines the indicator name and sets it to overlay on the price chart.
emaShortPeriod and emaLongPeriod: Integer inputs for EMA periods
(defaults: 5 and 9).
(defaults: 00:00 to 23:59).
closing price.
emaLong = ta.ema(close, emaLongPeriod): Computes the Long EMA.
then checks if the current time is within the specified range. Handles overnight
ranges correctly.
active signal type), `profitLabelPlaced` (prevents multiple profit labels).
met.
Usage
Setup: Add the indicator to a TradingView chart. Adjust EMA periods, UTC time
window, and points threshold via the indicator settings.
a signal.
Applications: Useful for traders who want to:
- Identify when a trade reaches a specific profit target.
Notes
price (e.g., $100 for stocks, 100 pips for forex). Adjust `pointsThreshold` for
different assets.
markets.
the chart clean.
account for multiple hits of the threshold unless a new signal occurs.
If you need further clarification or want to add features (e.g., alerts, additional profit levels, or different time filters), let me know!
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。