How AlgoWay cTrader Connector Logic Works: Reverse, Hedge and TradingView Webhook Automation

How AlgoWay cTrader connector logic works for TradingView webhook automation

AlgoWay cTrader Connector receives webhook trading commands and applies clear position logic before sending orders to cTrader. The two most important modes are Reverse Mode and Hedge Mode. Reverse Mode is designed to close existing exposure before a new direction is handled. Hedge Mode is designed to allow new positions without closing the existing side.

This guide is written for traders searching for cTrader connector logic, TradingView to cTrader webhook, cTrader webhook automation, cTrader Reverse mode, cTrader Hedge mode, cTrader trading bot webhook, and AlgoWay cTrader automation.

The route is:

TradingView alert → AlgoWay webhook → AlgoWay cTrader connector → cTrader order execution

TradingView creates the signal. AlgoWay receives the JSON message. The cTrader connector applies the selected trade mode. cTrader then receives the final market order or close action.

Last updated: 2026-05-12 • Author: AlgoWay

Quick Answer: What Does the cTrader Connector Do?

The AlgoWay cTrader connector receives a structured command such as buy, sell, long, short or flat, checks existing positions for the selected symbol, applies the selected trade mode, and sends the required action to cTrader.

Mode Main behavior Best use case
Reverse Mode Close existing exposure first, then process the new direction when the route is configured to do so. One-direction strategies that should not keep overlapping exposure.
Hedge Mode Open the new direction without closing existing positions. Strategies that intentionally allow long and short exposure at the same time.

How the AlgoWay cTrader Connector Flow Works

The cTrader connector is the execution layer between AlgoWay webhook logic and cTrader order handling. It is not the strategy itself. The strategy can be in TradingView, a manual webhook test, or another source that sends a valid AlgoWay message.

The normal flow is:

  1. TradingView alert fires.
  2. TradingView sends JSON to the AlgoWay webhook URL.
  3. AlgoWay validates the message and identifies the cTrader route.
  4. The connector checks ticker, order_action, order_contracts and route settings.
  5. The connector reads current cTrader positions for the symbol.
  6. Reverse or Hedge logic is applied.
  7. The connector sends close or market order operations to cTrader.
  8. AlgoWay logs the received payload and execution result.

cTrader itself supports algorithmic trading through cBots, and cBots can perform operations such as sending market orders, modifying positions, closing positions and subscribing to trading events. AlgoWay uses this ecosystem to build an automation bridge around webhook commands.

Reverse Mode

Reverse Mode is for strategies that should avoid overlapping exposure on the same instrument. When a new signal arrives, the connector checks existing positions for the symbol and closes exposure that conflicts with the selected logic.

Objective

The objective is to close existing positions for the specified symbol and prepare the account for the new state. Depending on the route behavior and signal design, the system can then open the new direction or only close the old position.

Logic

  • The connector checks existing positions for the selected ticker.
  • If open positions exist, they are closed through cTrader close operations.
  • The connector avoids leaving conflicting positions when the strategy is intended to be one-directional.
  • If the route is configured to open a new position after closing, the connector uses a market order for the new direction.
  • If the signal is a close-only or flat-style signal, no new position is opened.

Example: Reverse Mode

Current position:

EURUSD LONG 1.00

Incoming signal:

{
  "platform_name": "ctrader",
  "ticker": "EURUSD",
  "order_contracts": 1,
  "order_action": "short"
}

Expected behavior:

  1. The connector detects the existing LONG position.
  2. The connector closes the LONG position.
  3. If the route is configured for reverse-and-open behavior, it opens a SHORT position.
  4. If the route is configured as close-first/flat behavior, it stops after closing.

Hedge Mode

Hedge Mode is for strategies that intentionally allow additional exposure without closing current positions. If a LONG exists and a SHORT signal arrives, the connector can open the SHORT while the LONG remains open, provided the platform/account allows this behavior.

Objective

The objective is to add a new position without forcing old positions to close.

Logic

  • The connector checks current positions for context.
  • Existing positions are not closed automatically.
  • The incoming signal is sent as a new order according to symbol, action and size.
  • Long and short exposure may coexist when supported by the account and platform behavior.

Example: Hedge Mode

Current position:

EURUSD LONG 1.00

Incoming signal:

{
  "platform_name": "ctrader",
  "ticker": "EURUSD",
  "order_contracts": 1,
  "order_action": "short"
}

Expected behavior:

  1. The connector detects the existing LONG position.
  2. The connector does not close it.
  3. The connector opens a new SHORT position.
  4. The account now has both long-side and short-side exposure if supported.

Reverse Mode vs Hedge Mode

Characteristic Reverse Mode Hedge Mode
Existing positions Checked and closed when required by route logic Checked but not closed automatically
Opposite signal Used to remove or replace current exposure Can create additional opposite exposure
Best for One-direction strategies Hedged or layered strategies
Risk profile Cleaner exposure, fewer overlapping positions More flexible but can increase total exposure
Main mistake Expecting instant flip when route is close-only Forgetting that losses can exist on both sides

TradingView JSON Examples for cTrader

AlgoWay expects structured JSON. The exact route must match the platform configured in your AlgoWay webhook.

Strategy Alert JSON

{
  "platform_name": "ctrader",
  "ticker": "{{ticker}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_action": "{{strategy.market_position}}",
  "price": "{{close}}"
}

This version uses TradingView strategy placeholders. TradingView replaces the values when the alert fires.

Fixed Test JSON

{
  "platform_name": "ctrader",
  "ticker": "EURUSD",
  "order_contracts": 1,
  "order_action": "buy"
}

Use a small test size first. Confirm the cTrader account accepts the symbol and size before using live strategy values.

Flat / Close-Style JSON

{
  "platform_name": "ctrader",
  "ticker": "EURUSD",
  "order_action": "flat"
}

Use close-style actions only if your route supports them. Check AlgoWay logs after the test to confirm how the action was interpreted.

Stop Loss and Take Profit Behavior

The legacy version of this page explained that the connector uses market orders for fast execution and that SL/TP should be handled by the strategy or route logic instead of assuming they are always attached directly at market-order creation time.

The practical rule is:

  • if your route supports SL/TP fields, send them explicitly and test them;
  • if your route does not attach SL/TP directly, use TradingView strategy logic to send exit or close signals;
  • do not assume every cTrader account, symbol or route supports the same stop behavior;
  • always verify SL/TP behavior in AlgoWay logs and cTrader history before live size.

Example with explicit SL/TP-style fields where supported:

{
  "platform_name": "ctrader",
  "ticker": "EURUSD",
  "order_contracts": 1,
  "order_action": "buy",
  "sl_price": 1.08400,
  "tp_price": 1.09000
}

Risk, Symbol and Size Checks

Most cTrader connector problems are not caused by the webhook itself. They are caused by mismatched symbol names, invalid size, unsupported account behavior or misunderstood mode logic.

Before live automation, check:

  • TradingView ticker vs cTrader symbol;
  • minimum and maximum order size;
  • volume step;
  • commission and spread;
  • market session;
  • account permissions;
  • Reverse or Hedge mode behavior;
  • whether your strategy sends close signals;
  • whether the same account can hold opposing positions;
  • how the connector logs rejected commands.

When to Use Reverse Mode

Use Reverse Mode when:

  • the strategy should hold only one direction per symbol;
  • an opposite signal means the old position should be closed;
  • you want simpler exposure control;
  • you do not want long and short positions open at the same time;
  • your risk model assumes one active direction.

When to Use Hedge Mode

Use Hedge Mode when:

  • the strategy intentionally layers positions;
  • long and short exposure may exist at the same time;
  • the account and platform behavior support this workflow;
  • you understand the total exposure across all open positions;
  • you have clear close logic for every side.

cTrader Connector vs cTrader to MT5 Copier

This page explains cTrader connector logic when cTrader is the destination for webhook automation. It is different from the cTrader-to-MT5 copier workflow.

Page / workflow Source Destination
cTrader connector logic TradingView or AlgoWay webhook signal cTrader
cTrader to MT5 copier cTrader trade action MetaTrader 5 through AlgoWayWS-MT5 EA

For the copier workflow, read: How to copy trades from cTrader to MetaTrader 5 with AlgoWay.

Troubleshooting cTrader Connector Logic

AlgoWay Receives the Alert but cTrader Does Not Trade

Check platform route, cTrader credentials, symbol, account state, permissions, order size and the exact error in AlgoWay logs.

Reverse Mode Closes but Does Not Open the Opposite Side

Check whether the route is configured as close-only or close-and-open. The legacy behavior documented for this page warned that reverse logic may close first and not automatically open the opposite side unless the signal or route specifies it.

Hedge Mode Opens Too Many Positions

Hedge Mode does not close existing positions by design. Check alert frequency, duplicate alerts and whether TradingView sends multiple signals per bar.

Wrong Symbol

Check the exact cTrader symbol and compare it with the TradingView ticker. Configure mapping if needed.

Wrong Size

Check order_contracts, quantity multiplier, symbol volume rules and account risk settings.

Invalid JSON

If AlgoWay rejects the webhook before cTrader execution, check JSON syntax. Read: How to fix AlgoWay webhook Error 415.

SL/TP Does Not Appear

Check whether your current cTrader route supports direct SL/TP attachment, post-entry modification or strategy-managed exits. Test with small size before relying on protective orders.

Related AlgoWay Guides

Final Summary

AlgoWay cTrader connector logic is mainly about how existing positions are handled when a new webhook signal arrives. Reverse Mode is designed to close or replace current exposure. Hedge Mode is designed to add new exposure without closing existing positions.

Choose Reverse Mode when your strategy should keep one direction per symbol. Choose Hedge Mode only when your strategy and account are designed to handle overlapping long and short exposure. Test symbols, size, SL/TP behavior and close logic before live automation.