cTrader

AlgoWay Blog

Guides, manuals and platform references.

Core
JSON & Alerts
MT5 / Expert Advisors
Errors
Integrations
Other Publications
AlgoWay Strategy Lab

TradingView: Use Separate Entry and Exit Indicators

Published December 4, 2026 · View Markdown

Two indicator panels controlling entry and exit for one trading position

Yes. Separate TradingView indicators can control entry and exit through AlgoWay when each exposes a usable alert and both messages target the same intended trading workflow. For MT5, send the entry alert and the exit alert to the same configured AlgoWay webhook. Use an entry action for the first and a closing action for the second. You do not need a second EA merely because the exit comes from another indicator.

The important qualification is coordination. Two independent alerts are not automatically one position-aware strategy. The entry indicator does not become aware of the exit indicator's decisions just because their messages share a destination.

This guide uses native TradingView alerts and a simple long-only MT5 example. Start with the AlgoWay MT5 connector and its multiple-alert setup instructions. A running, connected EA and an eligible TradingView webhook-alert setup are prerequisites.

Give each indicator exactly one job

Choose an entry event from indicator A and an exit event from indicator B. For example, A could report a trend change while B reports a loss of momentum. This is a workflow illustration, not evidence that combining those signals improves returns.

In TradingView's Create Alert dialog, select A's actual entry condition for the first alert and B's actual exit condition for the second. A colored marker is not enough: the chosen event must be available to the alert system.

For an alertcondition()-based indicator, TradingView lets you set the alert message in the dialog. An alert()-based script supplies its message from code, so check the script's supported configuration instead of assuming pasted text replaces it. These distinctions are documented in TradingView's alert reference.

A deliberately narrow pair of MT5 messages

Assume a demo account, EURUSD as the verified broker symbol, a single long position belonging to this workflow, 0.10-lot entry sizing and lot-based closing. Check that the broker accepts this size. Remove entry overrides or multipliers that would make the actual entry differ from the example. No other strategy should manage this symbol during the check.

Indicator A's entry message:

{
  "platform_name": "metatrader5",
  "ticker": "EURUSD",
  "order_action": "buy",
  "order_contracts": "0.10"
}

Indicator B's exit message:

{
  "platform_name": "metatrader5",
  "ticker": "EURUSD",
  "order_action": "flat",
  "order_contracts": "0.10"
}

These use the documented AlgoWay JSON fields. The two messages have different actions but the same symbol and route. An exit is not a new short entry: do not substitute sell just because the indicator calls its condition “Sell.” Map the meaning of the event, not its label.

For this example, confirm Close size: Lots / Percent % is set to Lots in the EA settings. The payloads illustrate entry and closing only; configure and verify the intended protective stops separately before any live use.

Decide what happens when the signals disagree

Write down the desired result for these sequences before enabling both alerts. The following are design questions, not measured execution outcomes.

  • Exit before entry: B fires while the account is flat, then A fires later. Do you still want the later entry, or should the earlier exit condition veto it?
  • Entry and exit on the same candle: does exit have priority, or should neither command be sent? Two independently configured alerts do not express that priority rule.
  • Another entry before an exit: should the second signal add size, be ignored, or replace the first trade? Make the route's position mode and repeated-entry policy agree with that choice.
  • A protective stop closes first: B may still produce an exit event afterward. Reconcile the actual account position rather than assuming the earlier entry remains open.

Here is why quantity deserves its own check. If two accepted entries leave 0.20 lots open and the exit instruction removes 0.10 lots, 0.10 lots remains. Both alerts can have worked as written while the result differs from “exit the strategy.” Conversely, if only one 0.10-lot position exists, the same reduction can finish it. This is arithmetic under the stated assumptions, not a promise about every trade mode or broker response.

When to combine the logic instead

If entry requires A to trigger while B permits trading, that is a combined condition. If B must veto A on the same bar, that is an explicit priority rule. Consider implementing those decisions in one script when you have access to the necessary logic or usable outputs. Two separate messages cannot substitute for a condition that was never defined.

A combined strategy also makes the intended position state and historical entry/exit sequence easier to inspect. Our indicator-to-strategy guide explains the conversion options. Access to an indicator's appearance does not establish access to its underlying calculations.

Verify the pair, then freeze the configuration

Test A alone, then B against the resulting demo position. Compare the TradingView alert event, AlgoWay received message and MT5 deal history. Next check the conflict sequences relevant to your design. Record actual results; a successful webhook delivery is not proof of the intended remaining position.

TradingView retains the script and input context used when an alert was created. If you change either indicator's settings, recreate the affected alert and verify the pair again. See why running alerts retain old settings.

The useful handover is precise: A decides when to request entry, B decides when to request exit, and the execution configuration determines which real position and quantity those requests affect. Keep all three decisions visible.

Last updated: December 4, 2026