How It Works

From signal to trade — the full picture

What actually happens when a KingdomEdge signal fires. No magic, no black box — just six clear stages connecting your chart, our intelligence, and your broker. Most subscribers are happier after reading this once.

The 6-stage flow

You
TradingView
KingdomEdge bot
Your broker
📈
STAGE 1
Indicator plotted
TradingView
STAGE 2
Alert fires
TradingView
📡
STAGE 3
Webhook received
KE bot
🛡️
STAGE 4
Risk gates
KE bot
💼
STAGE 5
Bracket order placed
Your broker
📬
STAGE 6
You're notified
You
End-to-end latency: typically 3-8 seconds from the candle close that triggers an indicator signal to a placed bracket order in your broker account. The bot doesn't wait on you, doesn't require approval, and doesn't sleep through US market hours.

What happens at each stage

1
An indicator paints a signal on your chart
TradingView

You've added KE SETS Trade (plus the supporting Curve / Trend / Zone indicators) to your TradingView chart. As price action unfolds, the Pine script on your chart evaluates the SurgeU 6-step methodology in real time — Curve direction, Trend alignment, Zone freshness, structure quality, reward-to-risk — and assigns a Surge Score (0-10) plus a grade (HIGH / MED / LOW).

When a setup grades HIGH or MED, the indicator paints a BUY or SELL signal on the chart with entry, stop-loss, and 3 take-profit levels.

Happens at candle close (1m / 5m / 15m / 1h depending on your timeframe)
2
TradingView fires the alert
TradingView

Because you configured an alert on the SETS Trade indicator's alert() function, TradingView's server-side alert engine immediately notices the signal and sends an HTTP POST to your configured webhook URL. The body of that POST is a JSON payload generated by the Pine script — it contains the ticker, side (buy/sell), entry price, stop-loss price, TP levels, the Surge Score, the grade, and your subscriber-specific webhook secret for authentication.

Webhook URL: https://api.kingdomedgealgo.com/webhook — same endpoint for every KE subscriber. Your unique secret in the payload is what tells the bot which subscriber the signal belongs to.

~100-500 ms after the candle closes
3
The KE bot receives + authenticates the webhook
KE bot

The KingdomEdge cloud bot (a Flask app running on Railway, multi-tenant, ~24/7 uptime) receives the POST at /webhook. First thing it does: look up the secret in the payload against the subscriber database. If the secret matches one of your stored webhook secrets, the signal routes to your account specifically. If no match, the request is rejected with 401 — no further processing.

If you're a Concierge subscriber, your secret is generated by Mark and stored both in Railway env vars (so it survives restarts) and in your subscriber record.

~50-200 ms
4
Risk gates + paused checks
KE bot

Before placing any order, the bot runs a series of safety checks:

· Paused? If you've paused the bot (via your dashboard), the signal is logged but no order placed.
· Market hours? The bot enforces 06:30 – 13:00 PT NYSE hours by default (configurable).
· Max risk per trade? Each signal is checked against your dollar-risk-per-trade setting; if it would exceed, the signal is blocked.
· Reward-to-risk threshold? If the signal's R:R ratio falls below your minimum (default 2.0), blocked.
· Quantity override? If you've capped position size, the order qty is adjusted.

If any gate blocks the signal, the bot logs the reason but doesn't place an order. You can see blocked signals on your dashboard's Activity view.

~10-50 ms
5
Bracket order placed in your broker
Your broker

Once gates pass, the bot calls your broker's API (Alpaca by default for Concierge tier) to place a bracket order. A bracket is a 3-part conditional order:

· Entry — market or limit buy/sell at the signal's price
· Take-profit legs — TP1 / TP2 / TP3 (or single-TP @ TP2, depending on your settings) — partial-close orders at each profit target
· Stop-loss — full-close order at the SL price, with automatic move-to-break-even after TP1 hits

All legs are submitted to your broker as an OCA (one-cancels-all) group, so when one TP or SL fires, the others automatically cancel. The broker manages execution from here — the KE bot's job is done for this trade.

~200-2000 ms (broker-dependent)
6
You get notified — and life goes on
You

The bot fans out a notification to two places simultaneously:

· Discord #signals-channel — a rich embed showing the ticker, side, grade, entry, stops, TPs. Every cohort subscriber sees this. Good for spotting patterns.
· Optional email (if you have trade_email_enabled = true in settings) — same details, in your inbox.

You don't need to do anything. The bot watches the broker for fills + lifecycle events (TP1 hit / TP2 hit / SL hit / position closed) and logs each one. Every Saturday morning at 9 AM PT, your weekly digest summarizes the week with win rate, R-multiples, and per-trade detail.

Within seconds of the bracket placement

Who owns what

KingdomEdge is deliberately broker-neutral and storage-light. We own the methodology, the indicators, the bot logic, and your weekly reports. We don't custody your money, hold your trading account, or have power to withdraw funds.

ComponentWho owns / hosts itWhat we (KE) can do
TradingView accountYou — directly with TradingViewGrant access to KE invite-only indicators
Brokerage accountYou — directly with Alpaca (or your chosen broker)Place orders via API keys you generate (revoke anytime)
API keys (broker)You generated; we store encryptedPlace orders only — cannot withdraw, transfer, or change account settings
Pine indicatorsKingdomEdge IP — invite-only licenseGrant / revoke per subscriber
KE bot infrastructureKingdomEdge — Railway-hosted Flask appReceive webhooks, route to brokers, log events
Subscriber dataKingdomEdge — Supabase (encrypted)Sensitive fields Fernet-encrypted; never exposed in logs
Trade historyYour broker (source-of-truth)We read fills for your weekly report; you can verify against broker statement

Why we built it this way

Separation of concerns. KingdomEdge could have built its own brokerage. Instead, we connect to brokerages you already know and trust (Alpaca, Tradier, IBKR via partner integration). This way your money stays where you put it, you can switch brokers without leaving KE, and you can audit every trade against your broker's official records.

Indicators on TradingView, not a custom app. You already know TradingView. You're already comfortable with its charts. The 5 KE indicators add to your existing setup — they don't replace anything. Same for alerts: TradingView's alert system is battle-tested across millions of users.

The bot is just a router. The intelligence lives in the indicators (Pine scripts you can read the inputs of). The bot's job is to take indicator signals + your risk rules and submit clean bracket orders. Simple, auditable, replaceable.

Common questions about how it works

What happens if the bot crashes mid-signal?
The bot is monitored 24/7 by Sentry (error tracking) and UptimeRobot (uptime monitoring). If it crashes, Mark gets alerted immediately. In the worst case (extended outage), TradingView will retry the webhook delivery up to 3 times. After that, any missed signal stays in TradingView's alert history — you can scroll back and see what you missed. Since signals are time-sensitive, very long outages would mean missed entries, but partial-fills and existing bracket orders in your broker continue to manage themselves regardless of bot status.
What happens if my broker is down?
The bot will get an error response from the broker API and log it. The signal is preserved in our Activity log so you can see what would have been placed. Your Pine indicator on TradingView still paints the signal regardless — broker outages don't affect the chart-level analysis.
Can KingdomEdge withdraw money from my account?
No. Broker API keys with order permissions allow placing trades within the account but cannot initiate withdrawals, ACH transfers, or any movement of funds out of the account. This is enforced by the broker, not by us — even if our system were compromised, the attacker would only be able to place trades within your account, not steal funds. You can revoke our access at any time in your broker dashboard and the bot loses access immediately.
What's the difference between Pine indicators and the bot?
Pine indicators run on TradingView — they analyze price action and paint signals. The KE bot runs on our servers — it receives those signals and places orders in your broker. Pine is the "brain," the bot is the "arm." You can use the indicators visually without the bot (Core / Pro tiers do this), but you need the bot to automate execution.
Why a webhook? Why not just integrate directly?
Webhooks let you keep TradingView as your charting source-of-truth while still automating execution. The alternative would be a custom KE-built charting app, which would require us to maintain market data feeds, indicator rendering, alert engines, etc. — all things TradingView already does at world-class scale. Webhooks are the right plumbing for "use the best tool for each job."
Where can I see logs of what the bot did for me?
Your dashboard shows recent signal activity, your weekly digest email summarizes the week, and Discord #signals-channel shows every fire in real time. For deeper inspection (e.g., why a signal was blocked), email support with the approximate signal time and we'll pull the bot's log entries.

Still have questions?

This page is a snapshot of a system that evolves. If something here is unclear or out of date, please email support — every question that surfaces here usually means 5 other subscribers were wondering the same thing.