Skip to content

Order Flow

The Automations page (/trading-terminal) uses a trigger-based trading system. Instead of placing orders directly like an exchange UI, you create triggers — reusable trade configurations that can be fired manually, from TradingView alerts, or from any webhook source. (For direct manual trading with a chart and order form, use the Terminal.)

The Big Picture

Create Trigger → Fire Trigger → Execute on Exchange → View Result
  1. Create a trigger with your trade parameters (symbol, side, size, leverage, TP/SL)
  2. Fire the trigger — manually from the UI, or automatically via TradingView/webhook
  3. Crodl executes the order on your exchange via API
  4. Track the result in the Executed Triggers tab and via Discord/Telegram notifications

This trigger-based approach means you can set up your trades once and reuse them. Connect a trigger to a TradingView alert and your strategy executes automatically — no manual intervention needed.

Page Layout

The Automations page has two tabs per exchange:

Open Triggers Tab

Create and manage triggers that open new positions. This is where you define your entries.

Close Triggers Tab

Create and manage triggers that close existing positions. This is where you define your exits.

Below the tabs, a trading data section has five tabs:

  • Active Positions — live WebSocket feed of your open positions
  • Open Orders — live WebSocket feed of your pending limit and TP/SL orders
  • Executed Triggers — history of trigger executions with status
  • Order History — individual fills and trades from the exchange
  • Allocation IDs — allocation buckets with opened/remaining size per allocation_id

There is no chart on the Automations page. Charting lives in the Terminal (/main), which runs Crodl's own chart engine.

Creating an Open Trigger

The open trigger form walks you through every parameter:

1. Basic Configuration

FieldDescription
SideLong or Short
Trigger NameA label to identify this trigger (e.g., "BTC Long Breakout")
API KeyWhich exchange connection to use
SymbolSearchable dropdown of all available trading pairs
Order TypeMarket, Limit, Post Only, FOK, or IOC
Strategy JournalOptional reporting-only chooser for strategy_dashboard_id. Use it to run without journaling, create a new journal ID, or reuse an existing journal on the same key.

The trigger form presents strategy journaling as a dedicated chooser instead of a raw text field. If you create or reuse an ID there, Crodl writes that value into strategy_dashboard_id.

2. Position Settings

FieldDescription
Margin ModeIsolated or Cross
LeverageYour desired multiplier — the form shows and enforces the selected pair's maximum
Position ModeOne-Way (netting) or Hedge

3. Quantity

FieldDescription
Quantity TypeHow to measure size — USD (Margin), USD (Position), Percentage, or Asset
Quantity AmountThe value (e.g., 50 USD, 10%, or 0.5 BTC)

Quantity types explained:

  • Amount (USD - Margin) — Dollar amount of margin to allocate. With 10x leverage and $50 margin, your position size is $500
  • Amount (USD - Position) — Dollar value of the total position
  • Percentage — Percentage of your available balance
  • Asset — Exact amount in the base currency (e.g., 0.01 BTC)

4. Limit Price (non-market orders only)

For Limit, Post Only, FOK, and IOC orders:

FieldDescription
Price ModeAbsolute price or percentage from last price
Price ValueThe price or percentage value

5. Take-Profit / Stop-Loss (optional)

Each can be independently enabled or disabled:

FieldDescription
Execution TypeMarket or Limit
ModeAbsolute price or percentage from entry
Trigger PricePrice that activates the TP/SL
Order PriceExecution price (Limit type only)

If you set an Allocation ID on an open trigger, attached TP/SL is still shared at the position level. In other words, you can keep one TP/SL on the position, but it is not isolated per allocation.

6. Advanced Policies

FieldDescription
Opposite Side CloseAuto-close opposite position before opening
Cancel UnfilledCancel pending orders on this symbol first
PyramidingAllow or block stacking multiple positions
Allocation IDOptional strategy bucket ID if you want this trigger to track and close independently from other strategies on the same symbol/side (market orders only)

Then click Create Open Trigger.

Trade guardrails (max_notional_usd and guard_action) are webhook payload fields, not form fields. Add them to the trigger JSON you paste into TradingView (or any webhook sender) to cap position notional. See Triggers → Optional Trade Guardrails.

Creating a Close Trigger

Close triggers are simpler — no leverage, margin mode, or position settings needed:

FieldDescription
Trigger NameLabel for this trigger
API KeyWhich exchange connection to use
SymbolTrading pair to close
SideClose Long or Close Short
Order TypeMarket, Limit, Post Only, FOK, IOC
Quantity TypeHow much to close (percentage is most common)
Quantity Amounte.g., 100 for full close, 50 for half
Cancel UnfilledCancel pending orders before closing
Allocation IDOptional strategy bucket to close a specific allocation instead of the full net position (market orders only)
Strategy JournalOptional strategy_dashboard_id to group this close with the matching journal

Use percentage-based close triggers for flexibility. A "Close 50%" trigger works regardless of your position size, letting you scale out in stages.

If a close trigger includes an Allocation ID, percentage-based closes are calculated from that allocation's remaining size, not the whole exchange position.

If an open or close includes strategy_dashboard_id, Crodl auto-creates or updates the matching journal for that exchange and API key. You do not need to manually start a session first.

Firing a Trigger

Once created, triggers can be fired in four ways:

Manual Execution

Click the play button on any trigger row. A confirmation dialog summarizes the trade (symbol, side, order type, leverage) — confirming executes a live trade on the exchange immediately.

TradingView Alerts

  1. Copy the trigger's JSON config (click the copy icon on the trigger row)
  2. Create a TradingView alert with your entry condition
  3. Set the webhook URL to https://api.crodl.com/webhooks/trading
  4. Paste the JSON into the alert message
  5. When the alert fires, your trigger executes automatically

External Webhooks

Any system that can send an HTTP POST with JSON can fire your triggers. See the Triggers page for the full webhook API reference.

MCP Clients

Claude, Codex, and other MCP clients can queue the same open and close payloads through MCP Access. MCP uses scoped bearer keys and injects the webhook security_token server-side for direct trade tools. When you need to copy a saved trigger into TradingView, use the single-trigger payload tool with explicit token reveal.

What "Queued" Means

Firing a trigger is fire-and-forget: Crodl validates the payload, queues the execution, and immediately returns 202 Accepted. The trade itself runs in the background — the UI shows "Trigger queued" rather than a fill confirmation.

Execution results arrive through:

  • The Executed Triggers tab (status, error detail, timing)
  • Discord/Telegram notifications, if you have connected them in Settings
  • The Active Positions / Open Orders panels updating over WebSocket as the exchange confirms

Managing Triggers

From the trigger list, each row has action buttons:

ActionIconDescription
Copy JSONClipboardOpen the full trigger config (including your security_token) to copy for webhooks
Copy Webhook URLLinkCopy the webhook endpoint URL
RunPlayFire the trigger manually (with confirmation)
EditPencilOpen the trigger in edit mode
DeleteTrashRemove the trigger (with confirmation)

Click the expand chevron on any row to view the full configuration.

Closing a Position from the UI

You don't need a pre-made close trigger to exit a position. From the Active Positions panel:

  1. Find the position you want to close
  2. Click the Close button
  3. A confirmation dialog shows the position details (symbol, side, leverage, quantity, average entry price) and a percentage selector — 100% by default, or choose a partial amount
  4. Click Yes, Close (or Close N% for a partial close)
  5. Crodl submits a market close for the chosen percentage and the panel updates as the exchange confirms

There is also a Flash Close action for an immediate 100% market close, and a Reverse action that closes the position and opens the same size on the opposite side at market.

Partial closes are percentage-based — the backend resolves the actual size against your live position at execution time.

Execution Pipeline

When a trigger fires (manually, via TradingView, or webhook), Crodl processes it in this order:

1. Validate payload
2. Authenticate via security token
3. Return 202 Accepted (async execution)
4. Cancel unfilled orders (if configured)
5. Close opposite position (if opposite_side_close enabled)
6. Check pyramiding rules
7. Apply optional open-trade guardrails
8. Place order on exchange
9. Record execution result

The entire pipeline runs asynchronously — you get an immediate 202 Accepted response, and the execution happens in the background via a job queue.

When opposite_side_close is enabled alongside cancel_unfilled, the cancel step may execute twice — once before the opposite-side close and once before placing the new order.

Tracking Executions

Every trigger fire is tracked in the Executed Triggers tab, filterable by kind (open/close) and status:

ColumnDescription
TimeWhen the execution was created
KindOpen or Close
SymbolTrading pair
SideLong, Short, Close Long, Close Short
TypeOrder type
Qty / PriceRequested quantity and price
StatusSuccess, Failed, Partial, Accepted, Canceled
Queue / Exec / TotalTiming breakdown: queue time + execution time = total
DetailsExpand for the full execution detail, including error messages

Execution Statuses

StatusMeaning
SuccessOrder placed and filled on the exchange
FailedExecution failed (see error detail for reason)
PartialOrder partially filled
AcceptedOrder accepted by exchange, pending fill
CanceledExecution was cancelled

Order History

The Order History tab shows individual fills from your exchange:

  • Time, instrument, side, and position side (Long/Short)
  • Fill price and size
  • Fill PnL and fees
  • Expandable details per fill

This data comes directly from the exchange API and shows every fill, including partial fills on limit orders.

Live Positions & Orders

The Active Positions and Open Orders panels connect to your exchange via a shared WebSocket for real-time updates:

  • Position and order data updates automatically (no manual refresh needed)
  • A single WebSocket connection per exchange delivers both positions and open orders
  • Connection status shown: Live, Connecting, Reconnecting, Error, Paused, Idle
  • Last updated timestamp displayed
  • Each position shows: contracts, size, average price, margin, PnL, estimated liquidation price, mark price, TP/SL, and margin ratio
  • Open orders (including TP/SL) update within seconds of any change on the exchange

Dashboard Views

The main dashboard has two modes:

  • Default keeps the current exchange dashboard exactly as before
  • Strategy switches to the journaling and reporting view at /dashboard?view=strategy

The strategy view is designed for grouping trades by strategy_dashboard_id while leaving execution behavior unchanged. It is journal-first:

  1. Pick the exchange
  2. Pick the API key
  3. Pick the exact strategy_dashboard_id
  4. Review the journal header, current state, recent trades, and activity feed

Journals are created automatically from triggers and webhook payloads that include strategy_dashboard_id. Once a journal exists, you can review and manage it from the dashboard without changing how the underlying trigger executes.