import json

base_dir = "/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/reviews"

# Context summaries
htf_context = "H4 shows price pushed down to 4708 on April 21st, after ranging around 4770-4820 in prior days. H1 shows an initial drop into the 4775 area at 06:00, bouncing to 4794, and then sweeping lower."
m30_structure = "M30 shows a consolidation range between 4780 and 4793 from 07:00 to 11:30, with a brief sweep up to 4798 at 11:30, followed by a breakdown below 4780, sweeping liquidity down to 4760 at 13:00, then returning to 4794."

# Item 1: candidate_2026-04-21T09-15-00Z_long_liquidity_sweep_reversal
item1 = {
  "candidate_id": "candidate_2026-04-21T09-15-00Z_long_liquidity_sweep_reversal",
  "timestamp": "2026-04-21T09:15:00Z",
  "decision": "needs_more_context",
  "reason": "M5 shows minor chop between 4781 and 4788. Price wicked down to 4781.29 at 09:15 M15 bar (M5: 09:25 L=4781.29) but the setup is mid-range and lacks a clear OTE or major liquidity sweep (the real sweep happens later at 13:00 down to 4760). Holding as needs_more_context / shadow.",
  "htf_context": htf_context,
  "m30_structure": m30_structure,
  "m15_m5_execution": "M15 at 09:00 formed a small candle. M5 shows an attempted move down to 4781.29 at 09:25 before bouncing to 4787. Minor reaction, not a high-probability setup.",
  "entry": None,
  "stop": None,
  "target": None,
  "r": None,
  "promoted_to_journal": False
}

# Item 2: candidate_2026-04-21T10-15-00Z_long_liquidity_sweep_reversal
item2 = {
  "candidate_id": "candidate_2026-04-21T10-15-00Z_long_liquidity_sweep_reversal",
  "timestamp": "2026-04-21T10:15:00Z",
  "decision": "needs_more_context",
  "reason": "Price consolidating tightly in the 4780-4790 range. M5 at 10:15 went down to 4780.96 and immediately reversed back to 4786. It's a scalping range without clear HTF sponsorship or structural shift. Not a clear A+ entry.",
  "htf_context": htf_context,
  "m30_structure": m30_structure,
  "m15_m5_execution": "At 10:15 M15/M5 price drops to 4780.96 and reverses to 4786. Small micro-range liquidity sweep, no significant displacement to justify a swing position.",
  "entry": None,
  "stop": None,
  "target": None,
  "r": None,
  "promoted_to_journal": False
}

# Item 3: candidate_2026-04-21T13-00-00Z_short_liquidity_sweep_reversal
item3 = {
  "candidate_id": "candidate_2026-04-21T13-00-00Z_short_liquidity_sweep_reversal",
  "timestamp": "2026-04-21T13:00:00Z",
  "decision": "needs_more_context",
  "reason": "At 13:00, price aggressively swept down to 4764, then further down to 4760 at 13:15, and reversed strongly up to 4794. The setup is marked as 'Short', but this was actually a deep liquidity sweep into a strong bullish reversal. A short here would have been stopped out aggressively. Rejecting/shadowing as the direction implies fighting a strong reversal.",
  "htf_context": htf_context,
  "m30_structure": m30_structure,
  "m15_m5_execution": "M15 dropped sharply to 4760 at 13:15 and immediately reversed with strong displacement up to 4793 by 13:30. A short entry at 13:00 would have been on the wrong side of a major stop hunt/reversal.",
  "entry": None,
  "stop": None,
  "target": None,
  "r": None,
  "promoted_to_journal": False
}

results = [item1, item2, item3]

with open(f"{base_dir}/manual_replay_results/replay_result_00541_00544.json", "w") as f:
    json.dump(results, f, indent=2)

print("Wrote results to replay_result_00541_00544.json")
