Session Hunt AI -- Indicator Contract
Identity
| Field |
Value |
| Pine Title |
"Session Hunt AI" |
| Study Filter |
"Session Hunt AI" |
| Overlay |
true |
| Timeframe |
Any (macros require 5-minute chart) |
Modes
Session Hunt AI operates in one of two modes, configured by the user:
| Mode |
Hunted Session |
Hunter Session |
Description |
| NY |
London |
New York |
NY session hunts London's high and low |
| London |
Asia |
London |
London session hunts Asia's high and low |
The mode determines which session range is the target and which session is expected to sweep those targets.
Visual Channels
| Channel |
Signal Role |
Required for Strategy |
| Boxes |
Session range identification (boundaries) |
Yes |
| Lines |
Extension targets and sweep detection (color + style changes) |
Yes |
| Labels |
Target identification and sweep confirmation |
Yes |
All three channels carry signal data. The interpreter must read all of them.
Boxes -- Session Ranges
Each trading session is drawn as a box spanning the session's time range and price range (high to low).
Session Colors
| Session |
Color |
Hex |
Default Transparency |
| Asia |
Purple |
#7700ff |
85% |
| London |
Blue |
#2157f3 |
85% |
| NY AM |
Orange |
#e9801e |
85% |
Box Properties
| Property |
Value |
| Left edge |
Session start time |
| Right edge |
Session end time |
| Top |
Session high |
| Bottom |
Session low |
| Border color |
Same as session color |
| Background color |
Same as session color with transparency |
Box Identification
Match boxes by their border/background color to determine which session they represent. The box top and bottom values give the session's high and low -- the levels that will be hunted.
Lines -- Extension Targets
After the hunted session completes, its high and low are extended as horizontal lines into the hunter session. These lines are the core signal elements.
Line Colors and States
| Color Variable |
Default Hex |
Default Transparency |
Meaning |
ext_hi_color |
#ff4444 |
20% |
Active high target -- not yet swept |
ext_lo_color |
#44bb44 |
20% |
Active low target -- not yet swept |
ext_swept_color |
#888888 |
50% |
Swept target -- price has taken this level |
reext_color |
#ff9900 |
20% |
Re-extended range -- new targets after both sides swept |
Line Style Transitions
| State |
Style |
Width |
Extend |
| Active (not swept) |
Solid |
ext_width (default 2) |
extend.right |
| Swept |
Dashed |
swept_width (default 1) |
extend.none (stops extending) |
| Re-extended |
Solid |
ext_width |
extend.right |
Sweep Detection
A sweep is detected when a line transitions from its active state to the swept state:
- Color change:
ext_hi_color or ext_lo_color -> ext_swept_color
- Style change: Solid -> Dashed
- Width change:
ext_width -> swept_width
- Extension change:
extend.right -> extend.none
In a snapshot reading, identify swept vs. active lines by checking color and style against the known values.
Labels
Extension Labels
| Label Text |
Meaning |
"London H" |
London session high extension (NY mode) |
"London L" |
London session low extension (NY mode) |
"Asia H" |
Asia session high extension (London mode) |
"Asia L" |
Asia session low extension (London mode) |
Swept Labels
When a level is swept, the label text is appended with " ✓" (space + checkmark):
| Label Text |
Meaning |
"London H ✓" |
London high has been swept |
"London L ✓" |
London low has been swept |
"Asia H ✓" |
Asia high has been swept |
"Asia L ✓" |
Asia low has been swept |
Re-Extension Labels
| Label Text |
Meaning |
"Re-Ext H" |
Re-extended high target |
"Re-Ext L" |
Re-extended low target |
Macro Labels
| Label Text |
Conditions |
Position |
"M" |
5-minute timeframe only |
Placed at macro window highs |
Macro labels mark ICT macro time windows. They appear only on 5-minute charts and are positioned at the high of each macro window bar.
Sessions and Time Windows
All times are in Eastern Time (ET).
Session Definitions
| Session |
Start |
End |
| Asia |
20:00 |
00:00 |
| London |
02:00 |
05:00 |
| NY AM |
07:00 |
11:00 |
Gap Scan Windows
The gap scan window is the period between the hunted session's close and the hunter session's open. If both sides are swept during this window, a re-extension occurs.
| Mode |
Gap Scan Start |
Gap Scan End |
| NY |
05:00 |
07:00 |
| London |
00:00 |
02:00 |
Entry Windows
The entry window is the period during which the strategy should look for trade entries based on the hunt state.
| Mode |
Entry Start |
Entry End |
| NY |
07:00 |
15:00 |
| London |
02:00 |
07:00 |
Macro Windows (5-Minute Chart Only)
| # |
Start |
End |
| 1 |
06:50 |
07:10 |
| 2 |
07:50 |
08:10 |
| 3 |
08:50 |
09:10 |
| 4 |
09:50 |
10:10 |
| 5 |
10:50 |
11:10 |
| 6 |
12:50 |
13:10 |
| 7 |
13:50 |
14:10 |
| 8 |
14:50 |
15:10 |
| 9 |
15:15 |
15:45 |
| 10 |
15:50 |
16:10 |
Hunt State Machine
States
| State |
Code |
Description |
| INITIAL |
INIT |
No sweeps have occurred. Both extension lines are active. No directional signal. |
| HUNT_HIGH |
HUNT_HIGH |
Low has been swept. High is still active. Strategy should draw on the low side (look for longs). |
| HUNT_LOW |
HUNT_LOW |
High has been swept. Low is still active. Strategy should draw on the high side (look for shorts). |
| RE_EXTENSION |
RE_EXT |
Both sides swept during gap scan window. New range established from sweep extremes. |
| INVALID |
INVALID |
Both sides swept outside gap scan, or both sides of re-extension swept. No valid hunt. |
| TARGET_REACHED |
TARGET |
The remaining active target was swept after a hunt was locked. Objective complete. |
Transition Diagram
+-------------+
| INITIAL |
| both active |
+------+------+
|
+-------------+-------------+
| |
low swept high swept
| |
+------v------+ +------v------+
| HUNT_HIGH | | HUNT_LOW |
| high active | | low active |
| draw LOW | | draw HIGH |
+------+------+ +------+------+
| |
high swept low swept
(target hit) (target hit)
| |
+------v------+ +------v------+
| TARGET | | TARGET |
| REACHED | | REACHED |
+-------------+ +-------------+
--- Special: Both swept during gap scan ---
+-------------+
| INITIAL |
+------+------+
|
both swept during gap scan
|
+--------v--------+
| RE_EXTENSION |
| new H/L targets |
+--------+--------+
|
+-------------+-------------+
| |
re-ext low swept re-ext high swept
| |
+------v------+ +------v------+
| HUNT_HIGH | | HUNT_LOW |
| (re-ext) | | (re-ext) |
+------+------+ +------+------+
| |
both re-ext swept both re-ext swept
| |
+------v------+ +------v------+
| INVALID | | INVALID |
+-------------+ +-------------+
--- Special: Both swept outside gap scan ---
+-------------+
| INITIAL |
+------+------+
|
both swept outside gap scan
|
+--------v--------+
| INVALID |
+-----------------+
State Derivation from Snapshot
To determine the current state from a chart snapshot:
- Find extension lines by color matching (
ext_hi_color, ext_lo_color, ext_swept_color, reext_color).
- Check which lines are active vs. swept:
- Active: solid style, active color (
ext_hi_color or ext_lo_color)
- Swept: dashed style,
ext_swept_color
- Re-extended: solid style,
reext_color
- Determine state:
- Both active ->
INIT
- High active + Low swept ->
HUNT_HIGH
- Low active + High swept ->
HUNT_LOW
- Re-extension lines present ->
RE_EXT (check if one side of re-ext is swept for sub-state)
- Both swept, no re-ext lines ->
INVALID
- Both swept, re-ext lines also both swept ->
INVALID
- Confirm with labels: Check for
" ✓" suffix on label text to confirm sweeps.
Daily Reset
The state machine resets after the End of Day time (default 15:00 ET). After reset:
- All extension lines from the previous session are no longer relevant.
- New session range boxes appear for the next cycle.
- State returns to
INIT for the next hunt cycle.
Hunt Direction Interpretation
| State |
Trade Direction |
Rationale |
INIT |
None |
No sweep yet, wait for direction |
HUNT_HIGH |
Long (buy) |
Low was taken (liquidity swept), expect price to reach high |
HUNT_LOW |
Short (sell) |
High was taken (liquidity swept), expect price to reach low |
RE_EXT |
Wait for one side to sweep, then same logic |
New range, same rules apply |
INVALID |
None |
Both sides taken, no clean setup |
TARGET |
None |
Objective already achieved |
Alert JSON
When alerts fire, they emit JSON payloads:
{
"hunt": "HUNT_HIGH",
"mode": "NY",
"target_hi": 5890.00,
"target_lo": 5870.00
}
| Field |
Type |
Description |
hunt |
string |
Current hunt state: "HUNT_HIGH", "HUNT_LOW", "RE_EXT", "INVALID" |
mode |
string |
Operating mode: "NY" or "London" |
target_hi |
float |
Price level of the high target |
target_lo |
float |
Price level of the low target |
Parser Rules
| # |
Channel |
Identifier |
Meaning |
Parser Logic |
| 1 |
Box |
bgcolor matches #7700ff (85% transp) |
Asia session range |
Top = Asia H, Bottom = Asia L |
| 2 |
Box |
bgcolor matches #2157f3 (85% transp) |
London session range |
Top = London H, Bottom = London L |
| 3 |
Box |
bgcolor matches #e9801e (85% transp) |
NY AM session range |
Top = NY H, Bottom = NY L |
| 4 |
Line |
color == ext_hi_color, solid |
Active high extension target |
y-value = target high price. Not yet swept. |
| 5 |
Line |
color == ext_lo_color, solid |
Active low extension target |
y-value = target low price. Not yet swept. |
| 6 |
Line |
color == ext_swept_color, dashed |
Swept extension target |
Price has taken this level. Check label for H/L. |
| 7 |
Line |
color == reext_color, solid |
Re-extended target |
New target after both sides swept in gap scan. |
| 8 |
Label |
text matches "{Session} H" (no checkmark) |
Active high target label |
Confirms high extension is live. |
| 9 |
Label |
text matches "{Session} L" (no checkmark) |
Active low target label |
Confirms low extension is live. |
| 10 |
Label |
text matches "{Session} H ✓" |
Swept high target label |
Confirms high was taken. |
| 11 |
Label |
text matches "{Session} L ✓" |
Swept low target label |
Confirms low was taken. |
| 12 |
Label |
text == "Re-Ext H" |
Re-extension high label |
New high target from re-extension. |
| 13 |
Label |
text == "Re-Ext L" |
Re-extension low label |
New low target from re-extension. |
| 14 |
Label |
text == "M" |
Macro window marker |
5min TF only. Positioned at macro high. |
Edge Cases
| Case |
Handling |
| No boxes visible |
Session range not yet established or chart does not cover session times. Return state UNKNOWN. |
| No extension lines |
Hunted session has not completed yet. State is INIT but premature -- wait for session close. |
| Extension lines present but no labels |
Unusual. Lines alone are sufficient for state derivation; labels are confirmatory. |
| Both sides swept simultaneously (same bar) |
Check timestamp. If within gap scan window -> RE_EXT. Otherwise -> INVALID. |
| Re-extension with only one side visible |
Possible if one re-ext line is off-screen. Use the visible line + label to infer state. |
| Multiple days of boxes on chart |
Use the most recent session boxes (rightmost). Filter by x-coordinate (time). |
| Mode mismatch (reading NY data on London mode) |
Mode is a configuration. Interpreter must know which mode the indicator is set to. Box colors help confirm: if hunting London H/L, look for blue boxes. |
| Macro labels on non-5min timeframe |
Should not appear. If they do, ignore them. |
| Custom session times |
User may adjust session boundaries. The interpreter should read box positions rather than hardcode times. |