H1 Stochastic · Session Grading Engine · Session Analysis

Session Grading Engine
— Line by Line

A complete reference explaining every line of the Session Grading Engine Popup — what it shows, how each score is calculated, and exactly what the final session grade means for your trading decisions.

What Is the Session Grading Engine Popup?

The Session Grading Engine Popup is a specialised analysis window inside the Execution Edge Dashboard. It opens when you click a pair in the H1 Stochastic column of the dashboard grid, and it answers one focused question: how structurally tradable has this session been overall? Rather than showing raw price data, it evaluates the quality of the session's trading conditions using the Session Grading Engine and delivers a structured, objective report card.

Purpose

What It Evaluates

The engine continuously monitors the trade grade (A, B, or C) of the current pair throughout the active session. It records how long each grade persisted, weighs more recent conditions more heavily, and synthesises everything into a final letter grade. This gives you a structured, time-aware view of whether the session has been consistently high-quality, moderately tradable, or structurally poor — before you decide whether to take a trade.

Key question it answers: "Has this session been good enough to trade with full conviction, or should I reduce size and apply extra caution?"
When It Opens

How to Access It

Click any pair in the H1 column of the Stochastic Dashboard. The popup appears near the clicked cell and displays a complete session report card. It can be dismissed with the ✕ CLOSE button at the bottom. Only one Session Grading Popup is active at a time — opening another pair's popup automatically closes the previous one. The popup tracks the exact time it was opened via an internal timestamp.

Popup Dimensions
  • H1_Popup_Width – width in pixels (default 600 px)
  • H1_Popup_Height – height in pixels (default 400 px)
The Three Grades

A, B, and C — What They Mean

The grading system uses only three grades to keep interpretation clear and actionable. There is no D or F — the focus is on whether a session is excellent, acceptable, or should be traded with caution.

A
High Quality
Structurally excellent session. Consistent, clean price action with sustained directional intent. Trade with full conviction and normal position sizing.
B
Tradable / Moderate Quality
Acceptable session with some structural noise. Setups exist but require stronger confirmation. Consider reduced position size and tighter risk.
C
Poor / Unstable Structure
Session has been inconsistent or choppy. Low structural quality makes reliable entry signals difficult. Skip or trade minimum size only.
Data Input

What the Engine Records

At each update interval — recommended every 5 minutes or every M15 candle close — the engine records a snapshot containing three pieces of information: the current Trade Grade (A, B, or C) for the pair, the Timestamp of that snapshot, and the active Session ID (Asia, London, or New York). These snapshots are stored in a running array and reset automatically when the session changes.

Required Inputs (per snapshot)
  • TradeGrade – A, B, or C at time of snapshot
  • Timestamp – exact datetime of the snapshot
  • SessionID – Asia / London / New York
  • Update frequency – every 5 min or M15 close (recommended)

How the Grading Engine Works

The Session Grading Engine runs a five-step pipeline. Each step transforms raw grade snapshots into progressively more meaningful scores, culminating in a final letter grade that reflects both the overall quality and the direction in which session conditions are moving.

1

Collect Grade Snapshots

Throughout the session, the engine records a GradeSnapshot at each update interval — containing the current TradeGrade (A, B, or C), the timestamp, and the active session ID. All snapshots for the current session are stored in a running array called SessionGrades[]. This array is the raw data pool that all subsequent steps draw from.

Data structure: Each snapshot stores time, grade_value (the numeric conversion of A/B/C), and session_id.
2

Convert Grades to Numbers

Letter grades are converted to numeric values so they can be averaged mathematically. The conversion is intentionally simple and evenly spaced to avoid over-engineering the scale.

Grade → Numeric Conversion
A = 3.0  (High Quality)
B = 2.0  (Moderate Quality)
C = 1.0  (Poor / Unstable)
The 1-point gap between each grade means no single grade dominates disproportionately. A mix of A and C averages to B — which accurately reflects a session that swung between extremes.

Session Timeline & Phase Breakdown

The popup's Session Timeline section shows the dominant grade for each of the three session phases alongside the number of minutes each phase has covered so far. These are the raw, unweighted observations — the foundation every other score is built upon.

Early Phase

Early Phase: [Grade] ([X min])

Covers the first 0–33% of the total session time elapsed so far. The grade shown is the dominant grade (most frequently occurring A, B, or C) during this opening segment, and the minute count is the total duration of this phase. The Early phase sets the baseline — it tells you what structural conditions were like when the session opened and liquidity was building.

Weight in final score: 30%. The opening phase carries the least forward-looking weight because market structure is still establishing itself and initial liquidity is often thinner.
Mid Phase

Mid Phase: [Grade] ([X min])

Covers 33–66% of elapsed session time. This is typically the core of the session — the period when the opening move has resolved and the session's dominant direction (if any) is playing out. A strong A grade here alongside an A in the Early phase strongly suggests a high-quality session. A drop to C in the Mid phase while the Early phase was A indicates a session that started well but lost structural integrity mid-way.

Weight in final score: 30%. Equal weight to the Early phase, as the midpoint provides important confirmation of whether early conditions were sustainable.
Recent Phase

Recent Phase: [Grade] ([X min])

Covers the most recent 66–100% of elapsed session time. This is the most actionable phase because it reflects current conditions — what the market is doing right now. A session that was C in the Early phase but has moved to A in the Recent phase is improving and may present fresh opportunities. A session that was A throughout but just flipped to C signals deteriorating conditions and warrants reducing exposure.

Weight in final score: 40%. The Recent phase carries the highest weight of the three — 10 percentage points more than Early or Mid — because it best predicts what conditions will be like for your next trade.
Session Time Allocation & Score Weighting
Weight: 30%  (0–33%)
Weight: 30%  (33–66%)
Weight: 40% ← highest  (66–100%)
Why 40% on the Recent phase? When you open the popup and consider a trade, you are about to trade into the conditions that exist right now — not the conditions from three hours ago. Weighting the most recent third of the session at 40% ensures the final grade reflects the quality of the market environment you're actually entering, not a purely historical average.

Segment Scores

Unlike the Session Timeline which shows a single dominant grade per phase, the Segment Scores show a precise numeric average within each segment — reflecting the full mix of A, B, and C grades that occurred during that phase and how long each lasted.

Early Segment

Early Segment Score

The time-weighted average of all grade snapshots recorded during the Early phase (0–33% of session). Ranges from 1.00 (all C grades) to 3.00 (all A grades). A score of 2.80 means the early session was predominantly A-grade with only brief dips below. This number feeds directly into the Momentum-Adjusted calculation with 30% weight.

Within-Segment Score Formula
Score = Σ(GradeValue × DurationMinutes)
          ÷ TotalSegmentMinutes
Mid Segment

Mid Segment Score

The time-weighted average for the middle third of the session. A score of 2.10 suggests mostly B-grade conditions with some A mixed in — tradable but not ideal. Comparing this to the Early Segment Score tells you whether conditions improved, held steady, or deteriorated as the session moved through its core phase.

Divergence signal: If Early Segment = 2.80 and Mid Segment = 1.30, the session deteriorated sharply at its midpoint — a significant caution flag regardless of what the Recent phase shows.
Recent Segment

Recent Segment Score

The time-weighted average for the most recent third of elapsed session time. A score of 2.95 is exceptionally strong — close to pure A-grade structure throughout the most recent phase. This is the single most forward-relevant score in the entire popup and the key driver of the final grade due to its 40% weighting in the Momentum-Adjusted calculation.

Primary trading signal: A Recent Segment Score of 2.80 or higher, combined with an A Final Grade, is the strongest session quality signal the popup can produce.
🧮

Worked Example: Calculating Segment Scores from the Spec

The official specification provides this example session: 180 minutes of Grade A, followed by 60 minutes of Grade C, followed by 120 minutes of Grade A — a total of 360 minutes. Here is how the Segment Scores are derived step by step.

Step 1 — Assign segment boundaries:
Total session = 360 minutes. Each segment = 120 minutes.
Early = minutes 0–120 (Grade A throughout → 3.0)
Mid = minutes 120–240 (60 min Grade C at 1.0, then 60 min Grade A at 3.0)
Recent = minutes 240–360 (Grade A throughout → 3.0)

Step 2 — Calculate each segment's score:

Early Segment (all A, 120 min)
(120 × 3.0) / 120 = 3.00
Mid Segment (60 min C + 60 min A)
(60 × 1.0 + 60 × 3.0) / 120 = (60 + 180) / 120 = 240 / 120 = 2.00
Recent Segment (all A, 120 min)
(120 × 3.0) / 120 = 3.00

The popup therefore displays: Early Segment = 3.00 · Mid Segment = 2.00 · Recent Segment = 3.00.

Notice the Mid Segment score of 2.00 exactly reflects the mixed A/C composition — the 60 minutes of C dragged it from 3.00 down to B-territory, which is precisely what happened structurally during that phase.

Time-Weighted Score

The Time-Weighted Score is the first cumulative measure of session quality across the entire session. It weights each grade snapshot by how many minutes it persisted — so a grade that lasted 3 hours has three times the influence of one that lasted 1 hour. It treats all time equally, with no preference for early vs. late conditions.

Formula

How the Time-Weighted Score Is Calculated

Every grade snapshot in SessionGrades[] contributes its grade_value × DurationMinutes to a running numerator. This sum is then divided by the total session minutes elapsed. The result is always between 1.00 (all C grades) and 3.00 (all A grades).

Time-Weighted Average Formula
WeightedScore = Σ ( GradeValue × DurationMinutes )
                   ÷ TotalSessionMinutes
Spec Example (180 min A + 60 min C + 120 min A = 360 min)
( 180×3 + 60×1 + 120×3 ) ÷ 360
= ( 540 + 60 + 360 ) ÷ 360
= 960 ÷ 360
= 2.67
What 2.67 tells you: The session was predominantly Grade A in terms of total time, but the 60-minute C period pulled the average below 3.00. A score of 2.67 falls in the A-grade range (≥ 2.60) — the session has been structurally strong overall.
Interpretation

Reading the Time-Weighted Score

The Time-Weighted Score tells you about the session's historical quality across its entire duration, giving equal respect to every minute. It is the most conservative of the two composite scores because it does not distinguish between old and recent conditions. Compare it against the Momentum-Adjusted Score to detect whether the session is trending better or worse.

Score RangeEquivalent GradeInterpretation
2.60 – 3.00ASession has been high quality overall
1.80 – 2.59BMixed or moderate quality session
1.00 – 1.79CPoor structural quality throughout
Limitation

Why Time-Weighting Alone Isn't Enough

The Time-Weighted Score treats a 3-hour block of Grade A from 8am identically to a 3-hour block of Grade A from 11am. But when you're about to trade at 12pm, the 11am A-block is far more relevant than the 8am one. This is why the engine applies a second step — the Momentum (Recency) Adjustment — which gives extra credit to the most recent segment of the session.

Rule of thumb: If Time-Weighted ≈ Momentum-Adjusted, session quality is stable. If Momentum-Adjusted > Time-Weighted, conditions are improving. If Momentum-Adjusted < Time-Weighted, conditions are deteriorating.

Momentum-Adjusted Score

The Momentum-Adjusted Score is the engine's primary output. It refines the Time-Weighted Score by applying asymmetric weights to the three session segments — giving the most recent third of the session 40% influence on the final number. This is the score that determines the Final Session Grade.

Formula

Recency Weighting Applied to Segment Scores

After each segment's score is independently calculated, the three scores are combined using fixed weights that favour the most recent phase. This two-step approach — first computing per-segment averages, then weighting them — prevents any single outlier minute from dominating while still giving priority to recent conditions.

Momentum-Adjusted Score Formula
FinalScore = ( EarlySegmentScore × 0.30 )
           + ( MidSegmentScore × 0.30 )
           + ( RecentSegmentScore × 0.40 )
Spec Example (Early=3.00, Mid=2.00, Recent=3.00)
= ( 3.00 × 0.30 ) + ( 2.00 × 0.30 ) + ( 3.00 × 0.40 )
= 0.90 + 0.60 + 1.20
= 2.70  → Final Grade: A
In the specification's own example, the Momentum-Adjusted Score of 2.72 is slightly higher than the Time-Weighted Score of 2.67 — confirming that the session is in a stable or improving state: the most recent conditions are as good as the session average.
Improving Session

When Momentum-Adjusted > Time-Weighted

If the Momentum-Adjusted Score is higher than the Time-Weighted Score, conditions in the most recent segment are better than the session average. The session is improving. This is the most favourable state for new trade entries — you're stepping into a market that is getting cleaner, not noisier.

Example: Time-Weighted = 2.10 (B), Momentum-Adjusted = 2.65 (A). The session started rough but has recently improved to A-grade quality. The final grade of A reflects current conditions, not the historical low points.
Deteriorating Session

When Momentum-Adjusted < Time-Weighted

If the Momentum-Adjusted Score is lower than the Time-Weighted Score, recent conditions are worse than the session average. The session is deteriorating. Even if the overall grade is still B, a falling Recent Segment Score is a caution signal — conditions may continue to worsen and the historical quality average is misleading about what you are actually about to trade into.

Example: Time-Weighted = 2.55 (B), Momentum-Adjusted = 2.10 (B). Both are B, but momentum is negative. The session started near A-quality and has decayed. Apply extra caution even though the letter grade appears the same.

Stability Index & Grade Flips

The Stability Index and Grade Flip Count are contextual quality-of-quality metrics — they do not change the final grade, but they tell you how trustworthy that grade is. A session can score an A grade yet have low stability, which is a meaningful distinction for position sizing and trade confidence.

Grade Flips

Grade Flips: The Raw Instability Count

A Grade Flip is counted every time the trade grade changes from one letter to another — A to B counts as one flip, B back to A counts as another flip, and so on. Grade Flips accumulate throughout the session and are displayed as a plain integer. A high flip count means the session has been swinging between quality states — indicative of erratic, choppy conditions where structural signals are inconsistent and unreliable.

Anchoring point: The Stability Index formula normalises flips against a maximum of 8. Any session with 8 or more flips produces a Stability Index of 0.00 or below — the floor of the scale.
Stability Index

Stability Index: Normalised Consistency Score

Converts the raw flip count into a 0.00–1.00 scale. A session with zero flips (perfectly consistent grade throughout) produces a Stability Index of 1.00. As flips accumulate, the index falls. At 8 flips it reaches 0.00. The formula is simple and transparent — making it easy to interpret without reference tables.

Stability Index Formula
StabilityIndex = 1.0 − ( FlipCount ÷ 8.0 )
Example: 2 Grade Flips
StabilityIndex = 1.0 − ( 2 ÷ 8.0 ) = 1.0 − 0.25 = 0.75
Interpretation

Reading the Stability Index

Three intuitive bands help you interpret the index at a glance. These bands are not enforced by the code — the index is always displayed as a raw number — but they provide a useful mental framework for reading it quickly.

Index RangeFlip CountInterpretation
0.75 – 1.00 0–2 flips Highly stable — grade was sustained; strong conviction
0.50 – 0.74 3–4 flips Moderate — some inconsistency; treat final grade cautiously
0.00 – 0.49 5–8+ flips Unstable — choppy session; reduce size or skip
Display Only

Why It Doesn't Change the Final Grade

The Stability Index is a display-only metric — it never modifies the Momentum-Adjusted Score or the Final Grade. This is an intentional design decision: the grade formula already accounts for quality through time-weighting. Adding stability as a score modifier would double-count instability and make the grade harder to interpret consistently. Instead, the Stability Index sits alongside the final grade as a transparency layer — letting you see not just what the grade is, but how reliably it was earned.

Best practice: Always read the Final Grade alongside the Stability Index. An A grade with Stability 0.90 = high confidence. An A grade with Stability 0.38 = proceed with caution despite the letter.

Final Session Grade Conversion

The Final Session Grade is the last step in the pipeline. The Momentum-Adjusted Score — a number between 1.00 and 3.00 — is mapped to one of three letter grades using fixed thresholds. This grade is displayed prominently at the bottom of the popup in a larger font, colour-coded for instant recognition.

Conversion Table

Score-to-Grade Thresholds

The three grade bands are fixed and evenly distributed across the 1.00–3.00 score range. The A-grade band is intentionally the narrowest (0.40 wide) to ensure that only genuinely high-quality sessions earn the top grade. The B and C bands are each 0.80 wide, providing generous ranges that capture moderate and poor session quality without being too punitive.

Momentum-Adjusted ScoreFinal GradeColourMeaning
2.60 – 3.00 A ● Green High quality. Structurally excellent. Trade with full conviction.
1.80 – 2.59 B ● Yellow Tradable. Moderate quality. Apply standard caution and check Stability Index.
1.00 – 1.79 C ● Red Poor structure. Skip or trade minimum size only.
Grade A

Grade A — High Quality Session

Requires a Momentum-Adjusted Score of 2.60 or above — meaning the weighted combination of all three segment scores was consistently near the A level. A session earns this grade by maintaining Grade A conditions for a sustained majority of session time, particularly in the most recent segment. This is the optimal environment for directional trading with full position sizing.

Trading Implication
  • Use normal position sizing
  • Trust directional signals with high conviction
  • Allow runners more room — structure supports continuation
  • Always cross-check Stability Index before entering
Grade B

Grade B — Tradable with Caution

Requires a score between 1.80 and 2.59 — a wide band that captures a broad range of mixed session conditions. B-grade sessions have real structural opportunity but also meaningful noise. The wide range of this band means a B with a score of 2.50 (close to A) should be treated very differently from a B with a score of 1.85 (close to C). Always check the Stability Index and both composite scores when the grade is B.

Trading Implication
  • Reduce position size by 25–50%
  • Require stronger technical confirmation before entry
  • Set tighter initial stops
  • Check if Momentum-Adjusted is rising or falling
Grade C

Grade C — Poor Session Structure

Requires a score between 1.00 and 1.79 — indicating the session has been predominantly made up of poor structural conditions. C-grade sessions are characterised by choppy, directionless price action, inconsistent follow-through, and unreliable signal generation. The risk of fakeouts, whipsaws, and stop hunts is materially elevated in a C-grade session.

Trading Implication
  • Skip the trade or use minimum size only
  • Wait for Recent Segment Score to improve before re-evaluating
  • Do not force entries on poor structure
  • Use the time productively — monitor, do not trade

Session Grading Popup Appearance Settings

Every visual element of the Session Grading Engine Popup is configurable through the dashboard's input parameters. Background colour, border, header bar, text colour, font size, and font name can all be adjusted independently to match your chart theme or personal preference.

General

Popup Window Dimensions & Position

The popup is positioned near the clicked cell using configurable pixel offsets, and its overall size is set by width and height inputs. The default dimensions (600 × 400 px) are designed to fit the full report card comfortably without overlapping too much of the chart area on standard monitor sizes. Adjust these if you run a very large or very compact screen layout.

Key Settings
  • H1_Popup_Width – popup width in pixels (default 600)
  • H1_Popup_Height – popup height in pixels (default 400)
  • H1_Popup_BG_Color – background colour (default C'25,25,35')
  • H1_Popup_Border_Color – outer border colour (default DodgerBlue)
Header Bar

Title Bar Styling

The header bar at the top of the popup displays the symbol name and identifies the window as the Session Grading Engine. Its background, text colour, font size, and font name are independently configurable — allowing it to visually stand out from the popup body and serve as a clear, readable title area even at small font sizes.

Key Settings
  • H1_Popup_Header_BG_Color – title bar background (default C'30,30,50')
  • H1_Popup_Header_Font_Color – title text colour (default White)
  • H1_Popup_Header_Font_Size – title font size (default 11 pt)
  • H1_Popup_Header_Font_Name – title font family (default Arial Bold)
Content

Body Text Styling

All report card lines — segment scores, composite scores, stability data, and the final grade — use a shared set of content font settings. The final grade line overrides this with a font size 2 points larger than the content font size, giving it additional visual prominence at the bottom of the popup. The ✕ CLOSE button is fixed to the bottom of the popup and uses a dark-red background regardless of the content settings.

Key Settings
  • H1_Popup_Text_Color – body text colour (default White)
  • H1_Popup_Text_Font_Size – content font size (default 10 pt)
  • H1_Popup_Text_Font_Name – content font family (default Arial)
Grade colour override: Regardless of the H1_Popup_Text_Color setting, grade values (A/B/C) are always rendered in their semantic colour — green, yellow, or red — as defined by the engine's colour logic. The text colour setting only affects neutral labels like score numbers and section headers.

Reset Conditions

The grading engine maintains separate grade histories for each session. To ensure each session is evaluated on its own independent data — not contaminated by conditions from a previous session — the SessionGrades[] array is cleared and the running scores are reset when any of the following events occur.

Trigger 1

Session Change

When the active session transitions from Asia to London, or from London to New York, the engine detects the session boundary crossing and automatically resets the grade array. This is the most common reset trigger and ensures that London session quality is never averaged together with Asia session quality, even if you open the popup right at the session boundary.

Session boundaries are defined by the configurable session open hours: Session_Asia_Open, Session_London_Open, Session_NY_Open, and Session_NY_Close.
Trigger 2

Broker Midnight

At the broker's server midnight, a full reset occurs regardless of which session is technically active. This handles edge cases where a session spans the midnight boundary (common in Asia session configurations) and ensures the grade history never accumulates data across calendar days. The date boundary is determined by the broker's server time, not the trader's local time.

Trigger 3

Manual Override

A manual reset can be triggered to clear the grade history on demand — for example, if a significant news event causes an anomalous spike in price quality that you do not want contaminating the session average going forward. This is an intentional escape hatch that allows traders to start a fresh grade calculation at any point during a session without waiting for a natural session transition.

After a reset: The SessionGrades[] array is cleared to zero entries. The Time-Weighted Score, all three Segment Scores, the Momentum-Adjusted Score, the Stability Index, and the Grade Flip Count all return to their initial states. The popup will show minimal or empty data until enough new snapshots accumulate to calculate meaningful scores — typically after the first full segment (33% of session time) has elapsed.