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!
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.