Skip to content

Entry Logic

Entry Tier System

Once a setup is validated (all six conditions met), the strategy computes three entry price levels based on the fair value gap associated with the target order block. The trader selects which tier to use via configuration; the strategy reports all three.

How FVG Entry Levels Work

An order block on OB AI has an associated fair value gap -- a three-candle imbalance where the wicks of candle 1 and candle 3 do not overlap. The FVG represents the displacement that created the OB.

For a bullish OB (long entry):

Candle 3 low  ─── FVG High (top of gap)
                   ├── Aggressive entry (middle of gap)
                   ├── Safe entry (deeper into gap, closer to OB)
Candle 1 high ─── FVG Low (bottom of gap)
                   OB Body (order block itself)

For a bearish OB (short entry):

                   OB Body (order block itself)
Candle 1 low  ─── FVG High (top of gap)
                   ├── Safe entry (deeper into gap, closer to OB)
                   ├── Aggressive entry (middle of gap)
Candle 3 high ─── FVG Low (bottom of gap)

The Three Tiers

Aggressive Entry

Level: aggressive_fvg -- the middle candle level of the FVG (the consequent encroachment / 50% of the gap).

Characteristics:

  • First level price reaches when retracing into the FVG.
  • Highest probability of being filled.
  • Widest stop (from aggressive entry to OB invalidation level).
  • Lowest risk-reward ratio of the three tiers.

When to use: High-confluence setups (score 7+) where the risk-reward still exceeds 2:1 even with the wider stop.

Safe Entry

Level: safe_fvg -- deeper retracement into the FVG, positioned closer to the OB body.

Characteristics:

  • Requires price to retrace further into the gap.
  • Moderate probability of being filled.
  • Tighter stop than aggressive.
  • Better risk-reward ratio.

When to use: Default tier for most setups. Balances fill probability against risk-reward.

Conservative Entry

Level: OB body itself -- price fills the entire FVG and touches the order block.

Characteristics:

  • Requires full FVG fill.
  • Lowest probability of being filled (many OBs hold at the FVG without price reaching the body).
  • Tightest stop.
  • Best risk-reward ratio.

When to use: Lower-confluence setups (score 5-6) where maximum risk-reward is needed to justify the trade.


Entry Tier Configuration

The active entry tier is a configuration parameter, not hardcoded logic.

# strategy.config.yaml
entry:
  tier: "safe"          # "aggressive" | "safe" | "conservative"
  require_unspent: true  # Only enter at unspent OBs

Regardless of the configured tier, the StrategyFlags.decision.entry object always reports all three levels:

{
  "entry": {
    "aggressive": 5874.75,
    "safe": 5873.50,
    "ob_body": 5872.50
  }
}

This allows the human trader to choose a different tier at decision time without re-running the scan.


Unspent OB Requirement

All entry tiers require the target order block to be unspent. The spent state is determined by the OB AI indicator's line style:

Line Style State Entry Allowed
Solid Unspent -- price has not yet returned to this OB Yes
Dotted Spent -- price has already touched the OB zone No
Deleted Fully mitigated -- price broke through both boundaries No

An OB transitions from unspent to spent when price first touches the zone. It transitions from spent to fully mitigated when price closes through the OB's opposite boundary.

The strategy never suggests entering at a spent or mitigated OB. If the only OB in the path is spent, the setup condition 4 (unspent OB in path) fails and the result is no-trade.


Entry Level Calculation

The strategy reads FVG levels directly from OB AI. It does not compute them independently.

From OB AI Lines

For each unspent OB in the path:

  1. Read the OB box: top = OB high, bottom = OB low.
  2. Read associated FVG lines: fvg_high and fvg_low from data_get_pine_lines.
  3. Read entry labels: aggressive_fvg and safe_fvg from data_get_pine_labels.

If OB AI does not plot FVG lines for a given OB (the OB was not created by displacement with a gap), then:

  • The aggressive and safe levels are null.
  • Only the ob_body (conservative) entry is available.
  • The confluence factor "OB has associated FVG" does not score.

Multiple OBs in Path

When multiple unspent OBs exist between price and the DOL target, the strategy selects the nearest unspent OB to the current price as the primary entry zone. Remaining OBs are listed in the order_blocks array for reference but do not affect the primary entry levels.

Rationale: The nearest OB is where price will interact first. If that OB holds, the trade proceeds to target. If it is mitigated, the next OB becomes the new candidate on the subsequent scan.


Entry Validation Example

Long setup: Bullish bias, HUNT_LOW, price at 5876.00, DOL = PDH at 5892.00.

Nearest bullish OB:

  • OB high: 5875.00, OB low: 5872.50 (unspent, solid lines)
  • FVG high: 5876.25, FVG low: 5873.00
  • Aggressive FVG: 5874.75 (midpoint of FVG)
  • Safe FVG: 5873.50 (deeper into FVG)

Entry levels reported:

Tier Price Stop (OB low - ATR buffer) Target (PDH) R:R
Aggressive 5874.75 5870.25 5892.00 3.8:1
Safe 5873.50 5870.25 5892.00 5.7:1
Conservative 5872.50 5870.25 5892.00 8.7:1

All three tiers exceed the 2:1 minimum. The configured tier determines which level appears in the primary decision fields.