OPEN-SOURCE SCRIPT

ASIA AND LONDON BOXES

64

---

### Purpose:

This indicator highlights the **Tokyo (Asia) and London trading sessions** on a price chart by drawing boxes around the price action during these time frames. It helps traders visually identify the price range (high and low) for each session across multiple days.

---

### Key Features:

1. **Timezone Selection:**

* You can select the timezone offset (default `'GMT-7'`) for the session times.
* This adjusts when the sessions start and end according to your preferred timezone.

2. **Sessions Defined:**

* **Tokyo session** defaults to 17:00 to 23:00 (5 PM to 11 PM) in the selected timezone.
* **London session** defaults to 23:00 to 05:00 (11 PM to 5 AM) in the selected timezone.
* These are customizable through `input.session()`.

3. **Session Boxes:**

* For each day and session, the script:

* Tracks the highest high and lowest low price during the session.
* Draws a box on the chart covering that price range over the session time.
* Boxes can be styled either as a solid box or just a background color (configurable).
* Box opacity and colors are customizable.

4. **Multiple Days Back:**

* The indicator keeps boxes visible for a user-defined number of days back (default 3 days).
* Old boxes beyond this limit are deleted to keep the chart clean.

5. **Session Start/End Detection:**

* It detects the start and end of the Tokyo and London sessions based on the selected session times and timezone.
* At session start: initializes tracking variables for high, low, and bars.
* During the session: updates the high and low.
* At session end: finalizes the session box.

6. **Box Drawing Details:**

* Boxes are drawn using price coordinates (`yloc=yloc.price`), meaning the vertical edges correspond exactly to the high and low prices of the session.
* Horizontally, the boxes stretch from the session start bar to the session end bar.

7. **Performance:**

* Uses arrays to manage multiple boxes.
* Periodically cleans up old boxes to avoid performance degradation.

---

### Summary:

* **Visualizes Tokyo and London trading sessions on your chart with colored boxes.**
* **Boxes highlight the price range during each session (high and low).**
* **Allows customization of session times, colors, opacity, style, and timezone.**
* **Maintains boxes for a set number of past days, then cleans up old ones.**

---

### Why is this useful?

For many traders, especially those trading forex or global indices, knowing the price range during the Asian and London sessions is critical. These boxes let you quickly see support/resistance zones and volatility windows linked to these major market hours.

---

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.