Main clusters and core pages.
Opposite trading signals are one of the most important problems in automated trading. If your system already has a BUY position open and a new SELL signal arrives, what should happen? Should the bot keep both positions, close the current one, or immediately flip to the opposite side?
AlgoWay solves this with four execution behaviors: Hedge Mode, Reverse Mode, Opposite Mode, and Inverse Mode. These modes define how AlgoWay handles BUY and SELL signals from TradingView alerts, Telegram signals, Pine Script strategies, API messages, or any other supported signal source.
This page explains how each mode works, when to use it, and how to choose the correct behavior for automated trading, webhook execution, MetaTrader 5, crypto exchanges, and other supported AlgoWay destinations.
Last updated: 2026-05-12 • Author: AlgoWay
Manual traders can look at a chart and decide what to do when the market changes direction. Automated trading systems need the rule in advance. Without a clear rule, the same SELL signal can mean different things:
That is why AlgoWay separates the logic into clear modes. The signal source only says what it wants to do. The selected AlgoWay mode defines how that signal is executed against the current open position.
Assume a BUY position is already open on EURUSD, BTCUSDT, or another symbol. Then a new SELL signal arrives.
| AlgoWay Mode | What happens to the BUY? | What happens to the SELL? | Best use case |
|---|---|---|---|
| Hedge Mode | BUY remains open | New SELL opens separately | Strategies that allow long and short exposure at the same time |
| Reverse Mode | BUY closes | No new SELL opens immediately | Opposite signal is treated as exit only |
| Opposite Mode | BUY closes | New SELL opens immediately | Strategy must flip direction on the same signal |
| Inverse Mode | Incoming BUY is treated as SELL | Incoming SELL is treated as BUY | Contrarian systems that intentionally trade against the original signal |
In simple words: Hedge keeps both sides, Reverse exits and waits, Opposite flips immediately, and Inverse turns BUY into SELL and SELL into BUY before execution.
Many trading platforms use the word “reverse” to mean “close the current position and open the opposite one.” In AlgoWay, the logic is more specific:
This distinction is important because platform terminology is not always consistent. Some brokers and exchanges call the direct flip behavior “reverse position”, while AlgoWay separates “close only” and “close plus open opposite” into two different modes so the execution rule is explicit. Inverse Mode is different again: it is not a close rule; it is a signal-direction transformation.
Hedge Mode allows opposite positions on the same symbol to exist at the same time. If a BUY is already open and a SELL signal arrives, AlgoWay keeps the BUY and opens a separate SELL.
EURUSD.Use Hedge Mode when your strategy intentionally allows both directions. This can be useful for grid systems, partial protection logic, independent long/short strategies, multi-signal portfolios, or strategies where one signal should not automatically close another signal.
Hedge Mode is also useful when separate systems are trading the same symbol but should remain independent. One strategy may be long while another strategy is short, and each strategy can manage its own exit logic.
Hedge Mode can increase exposure if you do not understand how the strategy behaves. A trader may think the system “changed direction”, while in reality it now holds both directions. That can increase fees, margin usage, and confusion in logs.
Before using Hedge Mode, confirm that the destination platform or broker account supports hedging. Some platforms use hedge mode, some use one-way mode, and some use netting-style position accounting.
Reverse Mode in AlgoWay treats an opposite signal as an exit signal. It closes the current position, but it does not immediately open a new position in the opposite direction.
EURUSD.Use Reverse Mode when an opposite signal means “exit the current trade”, not “open the other side right now”. This is common for conservative strategies where a bearish signal should close a long position, but a separate short-entry confirmation is required before opening a SELL.
Reverse Mode helps avoid immediate whipsaw. If your strategy often flips during ranging markets, closing first and waiting for confirmation may be safer than entering the opposite side instantly.
A direct close signal tells AlgoWay to close the position. Reverse Mode is different because it defines how AlgoWay reacts when the incoming signal is opposite to the current open position. It is a position management rule, not only a single command.
Opposite Mode is the direct flip behavior. When an opposite signal arrives, AlgoWay closes the current position and immediately opens a new position in the opposite direction.
EURUSD.Use Opposite Mode when your strategy is designed to always be in the market or to flip direction when the signal changes. Trend-following systems, reversal systems, and some TradingView strategy alerts often work this way.
Opposite Mode is useful when the same signal should act as both an exit and a new entry. For example, a bearish signal closes the BUY and opens a SELL immediately.
Opposite Mode can overtrade in sideways markets. If the signal flips often, the system can close and reopen positions repeatedly. This can increase fees, spread costs, and slippage.
Before using Opposite Mode live, test how your strategy behaves during choppy market conditions.
Inverse Mode is designed for traders who intentionally want to trade the signal from the other side. In this mode, AlgoWay receives the original direction and flips it before execution: a BUY command becomes a SELL command, and a SELL command becomes a BUY command.
This mode is useful for contrarian setups, reverse-signal testing, failed-signal strategies, or cases where a user follows a signal source but wants to execute the opposite direction on the destination account.
Incoming signal: BUY EURUSD 1.00
Inverse result: SELL EURUSD 1.00
Incoming signal: SELL XAUUSD 0.10
Inverse result: BUY XAUUSD 0.10
flat and close are not directional entry signals, so they should remain close-type actions. Inverse Mode is meant to flip BUY and SELL direction, not to turn a close command into an entry.
Use Inverse Mode only when the strategy is intentionally designed to trade against the incoming signal. It can be useful when testing whether a poor signal source performs better in reverse, when building a contrarian model, or when a copied signal uses the opposite side of the execution logic you want.
Inverse Mode can be confusing if enabled accidentally. A trader may expect a BUY alert to open a BUY, but the destination will receive a SELL. Always verify the selected mode in the webhook settings or inside the JSON override before live execution.
If the webhook route supports per-alert mode override, you can send trade_type directly inside the JSON. When trade_type is present, that specific order uses the mode from the JSON. If it is missing, AlgoWay uses the Trade Type selected in the webhook settings.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "buy",
"order_contracts": "0.10",
"trade_type": "inverse"
}
In this example, the alert says buy, but trade_type: inverse makes AlgoWay send the opposite direction to the destination.
AlgoWay modes control the execution rule inside AlgoWay, but the destination platform also matters. A crypto exchange, MetaTrader 5 account, or broker platform may have its own position accounting model.
In one-way mode, a symbol normally holds one net direction at a time. A new opposite order may reduce, close, or reverse the current position depending on the platform and order size.
In hedge mode, long and short positions can exist separately on the same symbol. This is common in futures trading and in MetaTrader 5 hedging accounts.
In a netting model, multiple trades on the same symbol are merged into one net position. A trade in the opposite direction can reduce or close the existing position instead of opening a separate opposite trade.
Because of these platform differences, always match your AlgoWay mode with the real account mode on the destination platform. If you use Inverse Mode, also remember that the incoming signal is deliberately flipped before it reaches the final execution behavior.
TradingView can send signals through alerts and webhook messages. A strategy alert may output values such as long, short, flat, buy, sell, or a custom JSON message. AlgoWay receives that message and applies the selected execution mode.
Example TradingView strategy message:
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.market_position}}"
}
If the current position is BUY and TradingView sends a SELL or short-style signal, AlgoWay uses the selected mode to decide whether to hedge, close only, flip, or invert the incoming direction before execution.
The same concept applies when the signal source is not TradingView. A Telegram channel, API integration, manual webhook test, or another supported source can send a BUY or SELL command. AlgoWay still needs to decide how this new command interacts with the current open position.
Example human-style Telegram signal after AI processing:
SELL XAUUSD
SL 2365
TP 2320
If a BUY on XAUUSD is already open, AlgoWay uses Hedge, Reverse, Opposite, or Inverse behavior according to the selected mode and platform capabilities.
Use this practical guide when selecting a mode:
| Question | Recommended mode |
|---|---|
| Should BUY and SELL stay open at the same time? | Hedge Mode |
| Should an opposite signal only close the current trade? | Reverse Mode |
| Should an opposite signal close and immediately open the other side? | Opposite Mode |
| Should every BUY be executed as SELL and every SELL as BUY? | Inverse Mode |
| Does the destination platform allow only one direction per symbol? | Check platform one-way/netting rules before choosing |
| Does the strategy flip often in sideways markets? | Test Reverse Mode before using Opposite Mode live |
On some platforms, reverse means close and open the opposite side. In AlgoWay, the direct flip behavior is called Opposite Mode. Reverse Mode closes and waits. Inverse Mode is not the same as either of them: it changes the signal direction first, so a BUY alert is treated as SELL and a SELL alert is treated as BUY.
If the destination account does not support separate long and short positions, Hedge Mode may not behave as expected. Check the account mode before live execution.
Opposite Mode can be powerful for clear trend systems, but expensive in choppy markets. Backtest and forward-test the logic before using larger size.
If the opposite signal size is different from the current open position size, the result may depend on the platform, account mode, and AlgoWay configuration. Test with controlled size first.
If TradingView, Telegram, and manual tests all send commands to the same symbol, the mode must be selected carefully. Otherwise one source can close or flip a position created by another source.
Inverse Mode deliberately trades the other side of the signal. If a user expects BUY to remain BUY, this mode should not be enabled. Use it only when reverse-signal execution is intentional.
Current position: BUY EURUSD 1.00
New signal: SELL EURUSD 1.00
Result: BUY remains open, SELL opens separately
Current position: BUY EURUSD 1.00
New signal: SELL EURUSD 1.00
Result: BUY closes, no SELL opens immediately
Current position: BUY EURUSD 1.00
New signal: SELL EURUSD 1.00
Result: BUY closes, SELL opens immediately
Current signal: BUY BTCUSDT 0.10
Selected mode: Inverse
Result: SELL BTCUSDT 0.10 is sent to the destination
Current signal: SELL XAUUSD 0.10
Selected mode: Inverse
Result: BUY XAUUSD 0.10 is sent to the destination
These guides help complete the automated trading workflow:
Opposite signal handling is not a small setting. It defines how the whole automated trading system reacts when the market direction changes.
AlgoWay lets you choose the behavior before the signal arrives, so your webhook automation follows a clear execution rule instead of guessing what to do with opposite trading signals or inverted trading logic.