DrDaq
Lean Python trading assistant. Telegram-driven. Perplexity-backed. Neon-stored. Kovner + Hougaard + ICT voice.
Agent mode
—
Kill switch
—
Daily trades
—
Last snapshot
—
connecting to status.drdaq.me...
Quick reference
| /briefing | Morning read — auto-fires 4:44am PT daily | auto |
| /prices | Live snapshot — NQ, ES, YM, GC, VIX, CL, DX | anytime |
| /logtrade | Log trade immediately after entry /logtrade MNQ BUY 3 21450 21480 90 breakout | required |
| /risk | Drawdown, trade count, kill switch state | daily |
| /debrief | Post-session review after 4pm ET | EOD |
| /memory_status | Memory health — candidate / quarantined / promoted | anytime |
| /clear | Wipe in-memory conversation history without restart | anytime |
| /help | Full command list inside Telegram | in bot |
Design principles
- Prefer deterministic systems over probabilistic where possible
- Keep orchestration modular — bot.py, brain.py, engine.py each own their domain
- Treat memory as a governed asset — quarantine first, promote later
- Prefer observability over hidden behavior
- Never fabricate prices, event times, or economic data
- Never mix NQ/MNQ futures with Nasdaq Composite or cash-index values
- Soft-quarantine questionable memory before deletion or promotion
Walk me through it
Five concepts that make DrDaq work
1. Runtime
2. Memory
3. AMD + PO3
4. Briefing
5. Risk
How a message becomes a response
Every Telegram message goes through a strict pipeline. Nothing random — each step gates or enriches the message before the model sees it.
Telegram message
→
Auth gate
→
Rate limiter
→
Kill switch
→
State check
Deterministic?
yes →
Stored snapshot
→
Response
no →
Econ calendar fetch
→
Market + Risk + Strategy
→
Perplexity
→
Validator
→
Response
If you ask "what was NQ at 4pm?" and DrDaq has the snapshot stored, it answers from Neon — no model call, no hallucination risk. The price snapshot schedule exists for exactly this reason.
How memory is governed
DrDaq does not store everything you say. Every potential memory goes through a quarantine-first flow with a duplicate guard, deterministic scoring, TTL, and daily expiry.
Candidate text
→
Duplicate guard
→
Score 0–10
→
TTL assigned
Score < min
→
quarantined
Score ≥ min
→
temporary_memory
→
promote → persistent
Scoring: high-signal category (+3), 40+ char content (+2), validation language (+2), high confidence (+2), trusted source (+1). Max 10. TTL: high score + high confidence → 90 days. Score ≥ 5 → 30 days. Otherwise → 7 days. Duplicate guard skips identical content in same category within last 7 days. Daily expiry runs every session loop tick.
/memory_status shows counts by status. /purge_today preview shows what would be quarantined. /clear wipes the in-memory conversation history without touching Neon.
AMD phases and Power of 3
Every timeframe — daily, weekly, monthly — moves through three phases. DrDaq tracks your read in Neon and injects it into every briefing and analysis.
- A — Accumulation. Smart money building position. Ranging, false breaks, liquidity hunts. The quiet phase before direction.
- M — Manipulation. The stop hunt. Sharp move into liquidity engineered to fill orders against retail.
- D — Distribution. The actual directional move. Smart money offloading. Position with this, not against it.
/setphase daily M
→
amd_tracking Neon
→
injected into all briefings
Set phase before the open. Update if it shifts mid-session. London M into NY D is the most common sequence. /po3 shows the current read across all timeframes.
The briefing pipeline
The 4:44am PT briefing is the most important automated event. Here is exactly what happens:
- Scheduler fires at 4:44am PT — checks is_am_briefing_time()
- Captures briefing_am price snapshot from Yahoo Finance
- Fetches verified economic calendar from Finnhub + FRED APIs
- Assembles: live prices + daily levels + framework + fractal + PO3 + strategy rules
- Structured retrieval runs with verified calendar context already injected
- Perplexity Sonar generates briefing in Kovner/Hougaard/ICT voice
- Validator checks response — symbol boundaries, price sanity, timestamp
- Written to Neon briefings table with full market context snapshot
- Sent to all authorized Telegram IDs with DailyTouchpoint postscript
Miss the 4:44am briefing? /briefing triggers it on demand. PM briefing fires at NY PM kill zone open — same pipeline, different prompt focus.
The risk system
Two-trade daily limits and weekly drawdown guard. Code-enforced gates, not suggestions. Kill switch persists through restarts.
- Daily trade limit. 2 trades per day max. /risk shows count. Prevents overtrading on bad days.
- Weekly drawdown guard. Tracks P&L against high-water mark. Escalates risk messaging when threshold exceeded.
- Kill switch. /kill_on — complete silence, no response, disables all conversation. Persists through restarts. Emergency only.
- State OFF. /state OFF — returns "Session closed" message. Data collection and snapshots continue. Use at end of day.
- Agent modes. OFF — ANALYSIS_ONLY — PAPER — LIVE. All labels until IBKR is wired.
/logtrade + PNL
→
record_trade()
→
weekly_ledger
→
/risk + /weekly
Trade logs export as CSV for California tax/CPA review via /export. Records only, not tax advice. Kill switch does NOT currently gate IBKR execution — must be wired before LIVE.
Daily workflow
What to run, when, and why — in order
Pre-market — before 6:30am PT
4:44am PT
/briefing (auto)
Auto-fires. Macro backdrop, session structure, key levels, verified economic calendar. Read before forming any bias.
pre-market
/prices
Check where Globex opened. Note NQ, ES, GC before anything else.
pre-market
/setlevels MNQ [high] [low]
Feed pre-market high and low once established. DrDaq references these all session.
example: /setlevels MNQ 21500 21350
backfill: /setlevels MNQ 21500 21350 2026-05-14
pre-market
/setphase daily [A/M/D]
Confirm AMD read before the open. Feeds every response until updated.
example: /setphase daily A London building inventory below 21350
pre-market
/ready
Mark yourself ready. Signals DrDaq you are in active session mode.
Session — 9:30am to 4:00pm ET
on entry
/logtrade immediately
Log at entry, not end of day. Add exit and PNL when trade closes. Catalyst feeds memory.
example: /logtrade MNQ BUY 3 21450 21480 90 NY open sweep above VWAP
if shifts
/setphase daily M (or D)
Update if AMD phase changes. London M into NY D is the most common sequence.
any question
Just talk to DrDaq
Conversational messages route through Perplexity with your full market context and verified calendar automatically injected.
before acting
/factcheck [claim]
Verify any economic event time or news. Uses verified Finnhub + FRED data, not Perplexity guessing.
example: /factcheck CPI release is 8:30am ET today
End of session — after 4:00pm ET
4:00pm ET
ny_close (auto)
Captures futures marks for NQ, MNQ, ES, MES, YM, MYM and promotes them into daily close levels in Neon.
EOD
/debrief
Post-session review. DrDaq pulls your logged trades and gives honest feedback on execution and discipline.
EOD
/pnl + /risk
Confirm P&L and check drawdown posture going into tomorrow.
EOD
/state ANALYSIS_ONLY
Close trading session. DrDaq still talks, data still collects. Use this not /state OFF.
Weekly — Monday pre-market
Sunday 6pm ET
/setweekopen MNQ [price]
Record Globex weekly open. Auto-fires at London pre Monday but verify it captured correctly.
Monday AM
/setphase weekly [A/M/D]
Set weekly AMD bias before Monday open. Feeds all briefings for the week.
Monday AM
/weekly
Review last week — P&L, drawdown, high-water mark, discipline, lessons.
Log a trade
Fill in the fields — command builds live — copy to Telegram
Trade details
Be specific — this feeds memory and debrief context
/logtrade MNQ BUY 1 —
Syntax
/logtrade SYMBOL SIDE QTY ENTRY [EXIT] [PNL] [CATALYST]
Required: SYMBOL SIDE QTY ENTRY — Optional: EXIT PNL CATALYST
entry only: /logtrade MNQ BUY 3 21450
full close: /logtrade MNQ BUY 3 21450 21480 90 NY open sweep
sell side: /logtrade MNQ SELL 2 21500 21460 80 liquidity sweep
Required: SYMBOL SIDE QTY ENTRY — Optional: EXIT PNL CATALYST
entry only: /logtrade MNQ BUY 3 21450
full close: /logtrade MNQ BUY 3 21450 21480 90 NY open sweep
sell side: /logtrade MNQ SELL 2 21500 21460 80 liquidity sweep
Set levels
Pre-market structure, session reference levels, opens and closes
Pre-market high / low
Set once highs and lows are established — usually 6:00–9:30am ET. DrDaq references these all session. Add an optional date to backfill past sessions.
Leave blank for today. Enter YYYY-MM-DD to backfill a past session.
/setlevels MNQ — fill fields
Weekly / monthly open
Weekly open = Sunday 6pm ET Globex open. Monthly open = first of month price. Both auto-fire — use this to verify or correct.
/setweekopen MNQ —
Manual daily close
ny_close auto-captures futures marks at 4pm ET. Use this only if the snapshot missed.
/setclose MNQ —
AMD phase
Confirm your read — stored in Neon and injected into every briefing
Set phase
Stored in Neon. Specificity compounds over time in briefings.
/setphase daily A
Phase reference
A — accumulation
Smart money building. Ranging, false breaks, liquidity hunts.
M — manipulation
Stop hunt. Sharp move into liquidity engineered against retail.
D — distribution
The actual move. Smart money offloading. Position with this.
Common sequence
London A or M, NY D
Check current
/po3
Add strategy rule
Rules stored in Neon and seeded into DrDaq's context on every restart
New rule
Strategy rules shape how DrDaq reasons about setups, risk, and discipline. Injected into every briefing and analysis. Write them as principles you have internalized — specific and actionable.
First person, specific, actionable. The way you would tell yourself.
/addrule risk — fill in rule text
Examples by type
risk
never hold through a major news event
entry
only enter on confirmed liquidity sweep with displacement
discipline
two losses in a row means stop for the day
session
avoid trading the first 5 minutes of NY open
position_sizing
max 3 contracts MNQ until 60 days consistently profitable
All commands
31 commands across 5 categories
Market data
| /prices | Live snapshot — NQ, MNQ, ES, MES, YM, MYM, GC, VIX, CL, DX | anytime |
| /briefing | AM briefing on demand. Auto-fires 4:44am PT. Verified economic calendar injected. no arguments | auto |
| /debrief | Post-session review — trades, risk, discipline, market read | EOD |
| /weekly | Weekly summary — P&L, drawdown, high-water mark, trade count | Monday |
| /bias | Directional bias read across timeframes | anytime |
| /po3 | Power of 3 — current AMD phase read all timeframes | anytime |
| /fractal | Decade fractal context — long-cycle AMD positioning | anytime |
Trade management
| /logtrade | Log a trade to Neon and local ledger SYMBOL SIDE QTY ENTRY [EXIT] [PNL] [CATALYST] example: /logtrade MNQ BUY 3 21450 21480 90 NY open sweep | required |
| /pnl | Today's realized P&L summary | EOD |
| /risk | Risk state — drawdown %, daily trade count, kill switch | daily |
| /export | Export trade log CSV for CPA/tax review | monthly |
Market structure
| /setlevels | Set pre-market high/low — session reference levels SYMBOL HIGH LOW [YYYY-MM-DD] today: /setlevels MNQ 21500 21350 backfill: /setlevels MNQ 21500 21350 2026-05-14 | pre-mkt |
| /setclose | Manual daily close — only if auto-snapshot missed SYMBOL PRICE example: /setclose MNQ 21460 | EOD |
| /setmonthopen | Record monthly open — auto-fires 1st of month SYMBOL PRICE [YYYY-MM] example: /setmonthopen MNQ 21100 | auto |
| /setweekopen | Record weekly open — auto-fires Monday london_pre SYMBOL PRICE example: /setweekopen MNQ 21400 | auto |
| /setphase | Confirm AMD phase — stored in Neon, injected into all briefings TIMEFRAME PHASE [notes] — timeframe: daily weekly monthly — phase: A M D example: /setphase daily M London swept sell-side 21340 | pre-mkt |
Strategy and memory
| /strategy | View current strategy rules in DrDaq's context | anytime |
| /addrule | Add a strategy rule to Neon TYPE rule text example: /addrule risk never hold through a major news event | anytime |
| /memory_status | Memory health — candidate / quarantined / promoted / expired counts and oldest entry | anytime |
| /purge_today | Preview or confirm soft-quarantine of today's memory preview | confirm | careful |
| /clear | Wipe in-memory conversation history for current session — does not touch Neon no arguments | anytime |
| /factcheck | Verify a claim via Finnhub + FRED + Perplexity structured retrieval claim text example: /factcheck Fed meeting is June 11 at 2pm ET | anytime |
System
| /status | Bot status — mode, kill switch, authorized users, model | anytime |
| /state | Set agent mode OFF | ANALYSIS_ONLY | PAPER | LIVE | careful |
| /kill_on | Emergency panic button — complete silence, disables conversation, persists through restarts | emergency |
| /kill_off | Re-enable after kill switch — check /status before trading | restore |
| /ready | Mark yourself ready for session | pre-mkt |
| /collect | Toggle data collection mode — listen and record only, no analysis | anytime |
| /help | Full command list inside Telegram | in bot |
Data dictionary
Every Neon table — columns, types, what's stored, example rows. Tap to expand.
trades
Every logged trade — permanent record for P&L, tax, and debrief
columntypedescription
ts_pt
TEXT
Timestamp in Pacific Time ISO format
symbol
TEXT
MNQ, MES, MYM, NQ, ES, YM
side
TEXT
BUY or SELL
qty
REAL
Number of contracts
entry_price
REAL
Entry price
exit_price
REAL
Exit price — NULL if still open when logged
realized_pnl
REAL
Realized P&L in dollars — NULL if not provided
catalyst
TEXT
What triggered entry — feeds memory and debrief
example: symbol="MNQ" side="BUY" qty=3 entry=21450 exit=21480 pnl=90 catalyst="NY open sweep above VWAP"
price_snapshots
Instrument prices at each of 9+ session labels per day
columntypedescription
session_label
TEXT
london_pre, pre_market, ny_open, ny_am_close, lunch, ny_pm_open, ny_close, globex_reopen, overnight, briefing_am, briefing_pm, on_demand
symbol
TEXT
NQ, MNQ, ES, MES, YM, MYM, GC, VIX, CL, DX
price
REAL
Last price from Yahoo Finance at snapshot time
day_high
REAL
Day high at time of snapshot
day_low
REAL
Day low at time of snapshot
captured_at
TIMESTAMPTZ
When the snapshot was taken UTC
example: session_label="ny_close" symbol="MNQ" price=21460 day_high=21510 day_low=21320
daily_levels
Pre-market highs/lows and 4pm close prices per date
columntypedescription
instrument
TEXT
Instrument
trade_date
DATE
The trading date — YYYY-MM-DD
session_high
REAL
Pre-market high — set via /setlevels
session_low
REAL
Pre-market low — set via /setlevels
closing_price
REAL
4pm ET futures close — auto or /setclose
true_day_open
REAL
2:30am ET true day open — auto at london_pre
example: instrument="MNQ" trade_date="2026-05-15" session_high=21500 session_low=21350 closing_price=21460
temporary_memory
Candidate observations — scored, TTL-governed, quarantine-first
columntypedescription
owner_id
BIGINT
Telegram user ID — owner memory isolated from guests
category
TEXT
market_insight, trade_pattern, risk_observation, strategy_rule, etc.
content
TEXT
The actual memory text
store_score
INTEGER
Quality score 0–10 — computed deterministically on write
confidence
TEXT
high / medium / low — affects score and TTL
status
TEXT
candidate / quarantined / promoted / expired
expires_at
TIMESTAMPTZ
7, 30, or 90 days depending on score and confidence
reason
TEXT
Comma-separated scoring reasons
example: category="trade_pattern" score=7 status="candidate" expires="2026-06-14" content="MNQ tends to sweep pre-market low in first 30 min of NY open when weekly bias is bullish"
persistent_strategic_memory
Promoted observations — long-term strategic context
columntypedescription
temporary_memory_id
INTEGER FK
Reference to temporary_memory row promoted from
category
TEXT
Inherited from temporary_memory on promotion
content
TEXT
The memory text
store_score
INTEGER
Score at promotion — must meet minimum threshold
status
TEXT
active / quarantined
example: category="market_insight" score=9 status="active" content="confirmed: accumulation in first hour of Globex valid for MNQ when weekly opens above prior week close"
amd_tracking
AMD phase state per instrument per timeframe
columntypedescription
symbol
TEXT
MNQ, MES, MYM
timeframe
TEXT
daily / weekly / monthly
phase
TEXT
accumulation / manipulation / distribution
notes
TEXT
Your context notes — specificity compounds in briefings
confirmed_at
TIMESTAMPTZ
When this phase was confirmed
example: symbol="MNQ" timeframe="daily" phase="manipulation" notes="London swept sell-side at 21340"
weekly_ledger
Realized P&L, drawdown, high-water mark per week
columntypedescription
week_id
TEXT
ISO week — YYYY-WNN format
realized_pnl
REAL
Total realized P&L for the week in dollars
high_water_mark
REAL
Peak equity — drawdown measured from this
daily_trade_count
INTEGER
Trades today — resets each day, max 2
drawdown_posture
TEXT
normal / caution / restricted
example: week_id="2026-W20" realized_pnl=340 high_water_mark=340 daily_trade_count=1 drawdown_posture="normal"
strategy_rules
Trading rules seeded into DrDaq context on every restart
columntypedescription
rule_type
TEXT
risk / entry / exit / discipline / market_structure / position_sizing / session
rule_text
TEXT
The rule in plain language — injected into system context every session
active
BOOLEAN
Whether active — inactive rules not injected
example: rule_type="risk" rule_text="never hold through a major scheduled news event" active=true
briefings
Full text of every AM and PM briefing with market context
columntypedescription
briefing_type
TEXT
morning or pm
content
TEXT
Full briefing text as sent to Telegram
market_context
JSONB
Price snapshot and levels at time of briefing
created_at
TIMESTAMPTZ
When the briefing was generated
example: briefing_type="morning" created_at="2026-05-15 11:44+00" content="4:44 - Dr Daq morning read..."
weekly_opens / monthly_opens / daily_opens
Reference open prices — macro anchor levels for structure analysis
columntypedescription
symbol
TEXT
MNQ, MES, MYM
open_price
REAL
The open price at start of the period
period_start
DATE
Sunday 6pm ET for weekly, 1st of month for monthly, 2:30am ET for daily
source
TEXT
auto (scheduler) or manual
example (weekly): symbol="MNQ" open_price=21400 period_start="2026-05-11" source="auto"
bias_state / fractal_annotations / ict_flows
Advanced structure tables — written by DrDaq analysis automatically
columntypedescription
bias_state
—
Directional bias reads per instrument per timeframe — written by /bias analysis
fractal_annotations
—
Decade fractal context annotations — long-cycle AMD labels
ict_flows
—
ICT order flow events — breaker blocks, FVGs, sweeps identified in analysis
note: Written by DrDaq automatically during analysis. Use /bias, /fractal, and conversational analysis to populate. No direct commands required.
Architecture
What DrDaq is built on, what it can do, and what it cannot
Infrastructure
Runtime
Hetzner Ubuntu 24 / systemd
Interface
Telegram long-polling
Database
Neon PostgreSQL (pooler)
Weekday model
Perplexity Sonar
Weekend model
claude-sonnet-4-6
Market data
Yahoo Finance ~0.12s
Econ calendar
Finnhub + FRED
Memory
66MB RAM, stable
Auto-schedule (ET)
4:44am PT
AM briefing
2:30am ET
london_pre + daily open
6:00am ET
pre_market snapshot
9:30am ET
ny_open snapshot
11:30am ET
ny_am_close snapshot
1:00pm ET
lunch snapshot
2:00pm ET
ny_pm_open + PM briefing
4:00pm ET
ny_close + daily levels
6:30pm ET
globex_reopen
12:30am ET
overnight snapshot
daily
memory TTL expiry
Core files
bot.py (1043+)
Telegram, scheduler, auth, all commands
brain.py (683+)
Persona, Perplexity, retrieval, calendar injection
engine.py (2340+)
State, risk, Yahoo, Neon, AMD, strategy
validator.py
Symbol, price bounds, timestamp check
econ_calendar.py
Finnhub + FRED calendar context builder
Observability (phase 1)
Log format
timestamp level [module] pid=N
Trace IDs
8-char hex per message
Timing
Perplexity, Yahoo, briefing elapsed
Memory events
write / promote / expire logged
Noise
httpx/telegram WARNING only
Capabilities
Market analysis
Perplexity + structured retrieval
Economic calendar
Finnhub + FRED verified
Price snapshots
Yahoo, 9+ sessions/day
Memory governance
score, TTL, quarantine, promote
Trade logging
Neon + local JSONL + CSV
Response validation
symbol, price bounds, timestamp
Limitations
Kill switch
conversation only — not IBKR
Agent modes
labels only until IBKR wired
Live prices
Yahoo cache, not streaming
Webhooks
long-polling only
Semantic search
keyword only, no embeddings
Polygon
free tier insufficient for futures
Roadmap
SHIPPED
Phase 1 - Observability
Phase 2 - Memory governance
Phase 3 - Validator
Economic calendar (Finnhub + FRED)
/clear, /setlevels date backfill
Kill switch vs state OFF
Phase 2 - Memory governance
Phase 3 - Validator
Economic calendar (Finnhub + FRED)
/clear, /setlevels date backfill
Kill switch vs state OFF
ROADMAP
Phase 4 - Semantic compression
Phase 5 - Async retrieval
Phase 6 - Evaluation harness
IBKR kill switch gate
Phase 5 - Async retrieval
Phase 6 - Evaluation harness
IBKR kill switch gate
FUTURE (6+ weeks)
Phase 7 - Strategic research
Obsidian integration
Semantic memory search
Webhook migration
Obsidian integration
Semantic memory search
Webhook migration