EU & US Current Day Only

The purpose of this indicator is:
To automatically detect and mark the opening prices of the European and U.S. trading sessions for each day.
To generate buy/sell trading signals only when specific intraday conditions are met.
To limit the number of trades per day and ensure that all trades are closed by the end of the day.
To enable intraday trading within a defined time window and with confirmed price action.
⚙️ How the Indicator Works
1. User Inputs
The user defines the following parameters:
Opening hour for the EU and US sessions (UTC).
Maximum number of trades per day (e.g., 2).
Minimum distance in pips the price must move from the session open levels to confirm a signal.
Trading hours (start and end).
Time zone.
2. Tracking Session Open Prices
At the start of each new day, the indicator:
Detects the exact moment when the EU and US sessions open (e.g., 9:00 UTC for EU).
Records the opening prices of these sessions (eu_open_price and us_open_price).
These levels are then plotted as horizontal lines on the chart:
Red line = EU Open
Black line = US Open
3. Trading Signals
The strategy will only trigger a trade if the following conditions are met:
Trading is happening within the defined hours (start_hour to end_hour).
Both session open levels (EU & US) are defined for the current day.
The current price is:
Above both levels by a defined pip distance → Buy signal.
Below both levels by a defined pip distance → Sell signal.
The strategy has not yet reached the maximum number of trades for the day.
Example logic:
If price moves more than 20 pips above both EU and US open levels → enter a long position.
If price drops more than 20 pips below both levels → enter a short position.
4. Exiting Positions
If the opposite signal appears while a position is open:
The strategy will automatically close the current position.
Additionally, at the start of a new day, any open positions are forcefully closed:
pinescript
Копирај
Измени
strategy.close_all(comment="Close EOD")
This ensures that the strategy remains purely intraday and avoids overnight risk.
✅ Advantages
Clear identification of daily session levels (EU/US open).
Filters out weak signals using minimum pip distance.
Limits the number of trades per day – avoids overtrading.
Automatically closes trades at the end of the day – reduces risk.
🔚 Conclusion
This indicator is especially useful for intraday traders who base their entries on how price behaves around the EU and US session open levels. The strategy is clean, rule-based, and suitable for automated backtesting, optimization, and real-time trading—especially for currency pairs with high volatility during the European and American sessions.
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi Aleksin_Aleksandar secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.
Penafian
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi Aleksin_Aleksandar secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.