Webhook → Leader → Copy Follower: A Reliable Trading Topology
Trace a TradingView webhook through leader order execution, leader fills, follower routing, and reconciliation without confusing delivery, acceptance, and execution.
What is the correct webhook-to-copy topology?
Validate the webhook into one leader order, wait for supported broker-reported leader fills, and treat each resulting follower order as an independent lifecycle.
A TradingView alert is a message, not a fill. Successful HTTP delivery proves only that an endpoint received a request. The endpoint must authenticate and validate it, resolve the intended strategy, account, contract, side, quantity, and risk policy, and then submit a leader order. That order can be rejected, remain working, fill in pieces, or never fill.
The copy stage begins at the supported fill boundary, not merely because the webhook was accepted. Each newly observed leader fill becomes a versioned copy event. The group calculates follower targets and submits separate requests. A follower result cannot be inferred from the webhook response or leader fill.
This topology limits ambiguity and over-copying. It also creates a clear audit chain: alert identity, validation decision, leader client correlation, leader order and fills, copy-event identity, follower decisions, follower broker outcomes, and reconciled positions. Every retry or manual recovery should attach to that chain.
Four facts, not one trade
“Webhook delivered,” “leader order accepted,” “leader filled,” and “follower filled” are not synonyms. Store and display each transition independently.
Make the webhook a deterministic trade intent
Use a small authenticated schema with stable identifiers, explicit units, and server-side ownership of account and risk configuration.
TradingView documents webhook delivery behavior and cautions around sensitive credentials. Do not place broker passwords or secret API credentials in alert bodies. Use a hard-to-guess endpoint or signed authentication mechanism supported by your integration, TLS, and a server-side mapping from strategy identity to approved leader account.
Include a unique alert or intent ID, strategy ID, action, canonical symbol, contract selection rule, quantity mode, and event time. Reject missing, malformed, stale, or unsupported inputs before broker submission. Avoid free-form text parsing when a structured JSON payload can define the same intent unambiguously.
Keep risk controls server-side. The alert can request an action, but the service should enforce permitted account, symbol, maximum quantity, session policy, and kill switch from trusted configuration. Log a redacted hash or safe representation of the payload with the validation result.
{
"intentId": "tv-strategyA-20260830-00142",
"strategy": "strategy-a",
"action": "buy",
"symbol": "MES",
"quantity": 1,
"sentAt": "2026-08-30T14:32:05Z"
}Design idempotency across webhook and fill events
Deduplicate the alert intent, leader broker request, leader fill, and follower submission at their own boundaries.
TradingView documents webhook resubmission behavior in supported circumstances, so duplicate delivery must be expected. Store the intent ID with a durable processing state. If the same valid payload arrives again, return the prior result or a safe acknowledgement instead of creating another leader order.
Do not use only timestamp and symbol as an identity; two legitimate strategy actions can share them. Generate or carry a stable intent ID and attach a supported client correlation to the leader request. For fills, use the platform's stable order/fill identifiers plus incremental quantity. For follower requests, derive an idempotency key from copy event, follower account, and target version.
Idempotency does not mean replaying stale intent forever. Apply an age limit and compare the current target before executing queued work. If the leader has already exited, a delayed entry follower action should not suddenly become valid because a retry timer fired.
- 1
Deduplicate delivery
Persist a stable webhook intent ID before attempting leader submission.
- 2
Correlate the leader
Attach the intent to the leader order and retain broker order and fill identities.
- 3
Create copy-event keys
Identify each incremental fill once, including partial-fill quantity.
- 4
Single-flight followers
Allow one active submission for a copy event, follower, and target version.
- 5
Reconcile uncertainty
Query broker state before retrying any request whose outcome is unknown.
Treat the leader as an execution account, not a relay
The leader must pass its own risk checks and produce broker-confirmed fills before follower quantity is derived.
Select a leader whose contract, strategy permissions, and risk settings are appropriate even if no followers exist. The webhook handler should not inflate leader quantity to represent the group. Each account's quantity belongs in its own sizing policy; otherwise a follower configuration change can unintentionally alter leader risk.
Track partial fills and cancellations. If a three-contract leader order fills one and then cancels two, the copyable quantity is one under a fill-driven design. If that one contract later exits, the follower target changes based on the exit fill, not on the initial three-contract request.
A leader connection gap creates uncertainty. Pause new follower routing until missed events are recovered and the leader position is reconciled. Do not fabricate fill events from a displayed position difference without a documented recovery method, because manual trades and other strategies may share the account.
| Leader event | Copy consequence |
|---|---|
| Webhook validated | No follower action |
| Leader order accepted | No fill-derived follower quantity yet |
| Leader partial fill | Create only the supported incremental copy target |
| Leader cancel | No copy of unfilled quantity |
| Leader exit fill | Update follower target toward the corresponding exit |
Give every follower an explicit target and outcome
Compute follower target from fills and policy, then record requested and actually filled quantities without collapsing them into a group success flag.
For each copy event, apply contract mapping, multiplier, fractional carry, integer rounding, maximum quantity, current-position limits, connection health, and account policy. The result is either a proposed request or an explained skip. Store the configuration version so a later multiplier change does not rewrite why an earlier decision occurred.
After submission, follow broker events through acknowledgement, working, partial fill, fill, cancel, reject, or unknown. A successful leader trade can coexist with any combination of these follower outcomes. Position drift is actual follower position minus the current intended follower target, not merely the difference between submitted quantities.
Manual follower trades complicate reconciliation. Decide whether they are prohibited operationally, detected and alerted, or incorporated through a deliberate position-based model. Never silently overwrite an unexplained manual position with an automatic correction.
- Keep target, requested, and filled quantities separate.
- Store the follower account's immutable broker identifier.
- Preserve raw broker messages beside normalized status.
- Age unknown and partial states for actionable alerts.
- Require an explicit policy for manual position differences.
Contain failures at the narrowest safe boundary
Classify webhook, leader, connector, and follower failures separately so the response pauses only the scope whose state is uncertain.
A malformed or unauthenticated webhook should stop before any leader request. A leader reject should produce no fill-derived follower action. A missing leader feed can require group pause because copy events may be incomplete. A single follower reject can often pause that follower while healthy accounts remain visible, subject to the group's documented risk policy.
Timeouts require state lookup rather than blind replay. Rate-limit responses call for bounded backoff and capacity review. Unsupported symbols should fail closed. Authentication expiry should mark the affected connection unavailable. Use stable error classes for alerting while preserving the broker's exact response for diagnosis.
Provide manual controls for disabling a webhook strategy, pausing a group, pausing one follower, and initiating a separately confirmed flatten procedure. A flatten request also has independent outcomes per account, so track completion instead of assuming the button restored consistency.
Recovery actions create new orders
A retry, corrective trade, or flatten is another broker request with its own acceptance and fill risk. Reconcile its outcome exactly like the original follower request.
Test the topology from delivery through reconciliation
A release test should prove duplicate handling, partial leader fills, follower exceptions, and final broker positions—not only a happy-path webhook response.
Start with one leader and one low-risk follower. Send one valid intent and verify the exact audit chain. Resend the same intent ID and confirm it does not create a second leader order. Exercise a payload that fails a server-side cap and verify that it stops before the broker.
Next observe a partial leader fill if it occurs naturally in a safe environment, or use an approved simulation method. Verify that only filled quantity affects follower target. Test a follower skipped by a local policy gate, a connector reconnect, and an unknown-outcome recovery without deliberately violating broker rules.
Finish with an entry and exit, then compare actual positions at both accounts. Define pass criteria in advance: no duplicate intent, no uncorrelated order, no unexplained position drift, and complete timestamps and identifiers. Increase followers and cadence gradually while monitoring delivery failures, queue age, broker errors, and reconciliation lag.
- 1
Prove validation
Valid, invalid, stale, and duplicate payloads produce the expected non-ambiguous decisions.
- 2
Prove fill boundaries
Leader acceptance creates no follower action until supported fills are observed.
- 3
Prove exceptions
Skips, rejects, unknown outcomes, and reconnects stay account-scoped and visible.
- 4
Prove positions
Broker-reported positions reconcile after entry, partial/complete fills, and exit.
Sources and methodology
HexTrade Research uses official product, exchange, regulator, and vendor documentation. Policies and platform behavior can change; follow the linked source and verify current terms before trading.
- 1.How to configure webhook alerts — TradingView, accessed Aug 30, 2026
- 2.Webhook resubmission — TradingView, accessed Aug 30, 2026
- 3.What webhook errors mean — TradingView, accessed Aug 30, 2026
- 4.Using credentials for webhooks — TradingView, accessed Aug 30, 2026
- 5.TradingView webhook automation — HexTrade Docs, accessed Aug 30, 2026
- 6.Copy trading setup — HexTrade Docs, accessed Aug 30, 2026
- 7.Place order endpoint — Tradovate, accessed Aug 30, 2026
Frequently asked questions
Does a 200 webhook response mean the trade filled?
No. It usually means the endpoint accepted or processed the HTTP request according to its contract. Leader order acceptance, leader execution, follower submission, and follower fills are later independent events that must be observed separately.
Should followers copy the webhook quantity or the leader fill quantity?
In the fill-aware topology described here, followers derive targets from broker-reported leader fills and their own sizing policies. Copying submitted webhook quantity can overstate exposure when the leader rejects, partially fills, or cancels.
Why does the webhook need an intent ID?
A stable intent ID allows duplicate delivery to return the previous processing result instead of creating another leader order. Additional broker and fill identifiers are still needed because idempotency must continue through later execution stages.
Can follower fills be guaranteed to match the leader?
No. Followers have independent orders, account checks, connector timing, and market liquidity. They may fill differently, partially, later, or not at all. The system should expose those outcomes and reconcile actual positions.
Next step
Put the research into a controlled workflow
Start small, verify the broker and account rules, and keep risk controls between every signal and live order.
Explore futures copy tradingContinue reading
Educational content only. Futures are leveraged products and can produce losses greater than the amount you expected to risk. This article is not financial, legal, or prop-firm compliance advice.