Skip to content

Automated trading

From a TradingView Backtest to a Verified MT5 Demo Trade

To verify an MT5 demo trade, follow one instruction all the way from the TradingView alert to the broker's deal and position records. First check connection messaging, then send one temporary demo-order alert. After that, reconcile each signal from your strategy so that expected differences and unresolved defects remain visible.

A backtest examines rules under simulation assumptions. A verified demo trade checks a configured execution path. Automation executes rules; it does not create an edge, and neither exercise predicts future live results.

Illustrative parallel paths comparing a TradingView simulation with separately verified broker-demo execution.
Illustrative original artwork. The stages represent different evidence, not observed trading results.

Part 7 of 8 in From discretionary to automated trading. Previous: Backtest costs, fills and out-of-sample checks. Next: Monitor, intervene and pause.

What does the backtest leave unverified?

TradingView's strategy report simulates orders with a broker emulator using chart data and your selected fill assumptions.[1] It does not establish webhook delivery, the receiving account's state or a broker fill. Review Part 6's cost and fill checks before testing the separate configuration chain below.

Illustrative comparison of the TradingView simulation with the demo execution path: alert, webhook delivery, PineConnector processing, EA request, broker response, deal and resulting position.
Compare evidence from both paths. A condition, an alert, a received message, an accepted request, a deal and a resulting position are distinct events.

1. Turn strategy orders into alerts

A strategy can provide order-fill alert events from the broker emulator, or explicit alert() events. Choose the event path your implementation was designed to send. Enabling both without accounting for both messages can create extra instructions.[2]

For a script that supplies an alert_message on its order functions, put {{strategy.order.alert_message}} in the TradingView alert's Message field for order-fill events. That event describes a simulated fill, not an MT5 fill. Other scripts may build their instructions differently; follow the documented integration for the actual script.[2]

TradingView saves the script, inputs, chart symbol and timeframe when you create the alert. Delete the old alert and create a new one after changing those inputs. Keep a record of the script version used for each alert.[2]

Confirm it: inspect the actual triggered message in TradingView's Alerts log. Check the selected event, intended instruction and timestamp; a chart marker alone does not show that a message was sent.

2. Point the alert at a webhook

In the alert's Notifications settings, enable Webhook URL and enter https://webhook.pineconnector.com. The trading instruction belongs in Message. Your TradingView plan must include webhook access and two-factor authentication must be enabled.[3][5]

TradingView sends the alert body by HTTP POST. Delivery can fail, so inspect the Webhook status column in its alert log. Keep broker credentials out of the message. If PineConnector Signal Authentication is enabled, privately include its matching signal secret as instructed in the syntax guide; never substitute a broker password.[3][4]

Confirm it: match the delivery status to the particular alert event. Successful webhook delivery establishes that stage, not the broker outcome.

3. Write an instruction the connector can parse

PineConnector messages use LicenseID,Command,Symbol,Parameters, with one License ID, one command and one symbol per message. Use your broker's exact symbol, including any prefix, suffix and letter case. Each entry needs one volume method; loss-based sizing also needs an explicit stop in the same message.[4]

TradingView's simulated quantity is not automatically MT5 lots or a cash-loss budget. Likewise, a simulated stop or target does not prove that a protective order exists at the broker. Use Part 4's rule worksheet to specify broker size and protection separately.[10]

Confirm it: read the exact message after placeholders have resolved, then compare the same instruction with its PineConnector processing record. Do not diagnose the cause from a received status alone.

4. Have a terminal running to receive it

MetaTrader Expert Advisors need the terminal running and the EA attached to a chart. Closing the relevant chart or platform stops that EA.[6] Choose the setup that matches your intended controls:

  • Self-hosted MT5: follow the MT5 setup guide for the PineConnector EA, algorithmic-trading permission and required DLL imports. Keep the terminal connected. PineConnector calls the toolbar control Algo Trading; MetaQuotes' help calls it AutoTrading.[14]
  • PineConnector Edge: Edge hosts MT5 with the PineConnector EA, so your own computer does not run this terminal. Edge does not host third-party EAs. You can view and change its EA settings in Portal → Edge → EA Settings; applying a change restarts the terminal, so signals pause for about a minute. Check that the hosted settings fit the intended rules, and confirm the tab says your saved settings are running before relying on a change.[7]

Confirm it: match the connected account and License ID, then inspect the EA's activity for the test. On Edge, select the instance in Portal → Edge to read Experts and Journal. Both logs are available; the 17 September 2026 product update records their addition.[7][8]

5. Use the intended broker demo account

Check the account number, server and demo status before sending any trade request. A License ID routes to every account connected to it, not just the account you are viewing. Use a separate ID for the demo experiment, with no live account sharing it.[7]

Confirm the broker symbol, permitted lot size and open trading session. A trigger chart can be receiving prices while the broker's requested instrument is closed. The chart's ticker also need not match the broker symbol in the fixed test message.[5] On Edge, the Symbols tab (Portal → Edge → Symbols) lists every symbol the broker offers on that account, with its specification, so you can copy the exact name into the test message instead of retyping it (Edge Symbols guide).

Confirm it: inspect every account sharing the selected ID and record the intended recipients before enabling the temporary alert.

6. Verify the fill, not the alert

MetaTrader distinguishes an order from a deal and a position. The order is an instruction; deals record actual executions; the position records the resulting exposure. One order can produce several deals, so an accepted order is not sufficient evidence of the final filled volume or an open position.[11]

Confirm it: check orders and deals in the intended account's history, then its current positions. Verify symbol, direction, total filled volume and requested SL/TP. Explain additional orders using their evidence rather than assuming every additional deal is a duplicate.

If the outcome is unclear, inspect the account before retrying. A delayed notification does not prove that the first request failed, and repeating a successful request can add unintended exposure.[5]

How do you run the two-stage setup test?

The documented setup test separates a connection check from a broker-demo order. The connection check cannot establish that TradingView is configured correctly or that the broker can fill an order.[5]

Stage A: check connection messaging

  1. In PineConnector Portal, confirm the intended demo connection and copy its License ID.
  2. Open the Test your setup page. Review its fixed LicenseID,test,test connection message, substitute your ID in the tool and select Send connection test once.
  3. In Portal → Bridge, match the time and account and inspect the processing result. A browser response saying accepted does not establish terminal processing.
  4. If no matching result appears, investigate the documented missing-signal or EA-error path before repeating. Continue only after the connection result is explained.

Stage B: request and verify one demo order

Illustrative setup-test message, not a strategy recommendation. Paste destination: TradingView alert, Message field. Replace LicenseID and EURUSD with your demo-only ID and exact broker symbol. The example requests 0.01 lots without SL or TP; use a different volume only if needed to meet that demo symbol's permitted size.[5]

LicenseID,buy,EURUSD,vol_lots=0.01
  1. Prepare: verify the receiving demo accounts, symbol, permitted volume and open broker trading session. Include the matching signal secret privately if authentication is enabled.
  2. Choose the trigger: open a normal price chart receiving live positive quotes. Create one temporary alert with Condition: Price, Greater Than, value 0, and Only Once (called Once only in some layouts). Do not choose Crossing for this test.
  3. Complete the alert: name it Demo trade test, paste the reviewed message, enable Webhook URL and enter https://webhook.pineconnector.com. Review the complete configuration before selecting Create once.
  4. Follow the event: find the actual message and delivery status in TradingView's Alerts log. A positive live quote is needed for the trigger; creating the alert alone does not send it. A one-time alert stopping after it triggers can be its expected state.
  5. Follow processing: match the message, time and intended account in Portal → Bridge. Read its processing result, then the matching Experts and Journal entries where needed.
  6. Verify at the broker: confirm the intended demo account, exact symbol, Buy direction and 0.01-lot volume if unchanged. The message requests no SL/TP. Inspect the actual protection fields and explain any difference; also check orders, deals and positions for unexpected additional exposure.
  7. Finish: close the demo position through the broker interface and verify the resulting account state. Disable or delete the temporary alert before connecting the strategy.

Keep one trade-test alert active. Do not create extra copies while waiting. If any checkpoint is missing, start at the last evidenced stage; the delivery-to-broker diagnosis follows that chain.

The chain as a checklist

Stage Evidence to retain
Backtest Frozen rules, costs and fill settings.
Strategy alert Version plus actual triggered message.
Webhook Delivery status for that alert.
PineConnector Matching message, account and processing result.
EA and terminal Experts activity and Journal request/response.
Broker demo Correct account, orders, deals and resulting positions.
Cleanup Test position closed; temporary alert disabled or deleted.

How do you reconcile a run of strategy signals?

One verified setup order tests one path. Before connecting the strategy, start with the simulated strategy and every receiving demo account flat. Check pending orders as well, and remove unintended duplicate alerts or connections. Change one configuration item at a time and keep the previous working version.[9][10]

Use one worksheet record per intended signal and per receiving account. Include expected events that did not trigger, received messages that were filtered, and broker trades that lack an expected signal. Logging only successful fills hides the failures this exercise is meant to find.

Copy the per-signal reconciliation worksheet

  1. Identity: local record ID ___; rule version ___; alert name ___; redacted account reference ___; chart symbol/timeframe ___; broker symbol ___; common comparison timezone ___.
  2. Rule and simulation: condition expected? ___; evaluation time ___; simulated order time ___; simulated fill time/price/quantity ___; simulated stop/target and position state ___.
  3. TradingView evidence: actual alert time ___; actual message ___; webhook delivery status ___; alert-log reference ___; no event, if applicable ___.
  4. PineConnector evidence: matching signal reference ___; message/account match ___; received time and processing status ___; filter or error details ___.
  5. Terminal evidence: Experts event ___; Journal request ___; broker response ___; uncertainty still requiring investigation ___.
  6. Broker outcome: order ticket/state ___; deal ticket(s), times, prices and total filled volume ___; resulting position(s) ___; actual SL/TP ___; exit evidence ___.
  7. Reconciliation: difference class ___; explanation supported by which evidence ___; owner/action ___; retest required ___; resolved date and evidence ___.

Convert timestamps to one timezone before comparing them, retaining the original timestamps too. Redact License IDs, account identifiers and secrets before sharing the worksheet. Do not put credentials in notes or screenshots.

Use this five-class key for differences

Class What would support it? Next action
Expected difference Documented fill timing, quote or entry-filter explanation. Record evidence; check against the written specification.
Configuration defect Wrong version, symbol, units, size or recipient. Correct that input; repeat the affected demo check.
Delivery or processing gap An event is evidenced, but the next stage is missing or rejected. Trace logs; check the account before any resend.
Position drift Simulation and broker exposure disagree. Pause new entries; inspect positions and pending orders.
Logic divergence Realtime decisions differ from the saved rule or reloaded history. Inspect data, repainting and alert version.

A label is a working diagnosis. Keep unexplained differences unresolved until evidence supports a cause. For broker request failures, read the full Experts and Journal messages and the relevant EA Errors guidance; a numeric code by itself may not identify the cause.[12]

Apply the worksheet to the London pullback example

Illustrative scenarios, not executed trades or recommendations. The EURUSD H1 rule evaluates closed bars whose opening times are 07:00 through 10:00 in Europe/London. A bar opening at 09:00 is evaluated at its 10:00 close. Record that condition time separately from the emulator fill, alert event and broker deal time.

  • Expected timing difference: under default next-tick execution, an emulator market fill follows the condition calculation. An order-fill alert relates to that simulated fill; the eventual broker fill still needs its own evidence. A difference between the signal-bar close and broker price alone does not locate a defect.
  • Expected filter outcome: the example's spread=2 may block an entry when the receiving spread exceeds two PineConnector pips, although the simulated strategy entered. Confirm the actual filter record before classifying it this way.[4]
  • Position drift requiring action: a broker stop may close the demo position while the strategy still shows an open long. The converse can also occur after a missed broker close. Record both states and reconcile before another entry.[10]

An explained filter outcome can still leave the simulation and broker in different position states. Apply the reconciliation plan before the next instruction; an expected reason does not make that divergence harmless.

The example plans about US$100 of loss at the stop on a USD account using vol_dollar=100 with sl_price=. Verify the requested and filled volume from the applicable stop distance and broker specification; costs and execution can exceed the planned amount.[4]

“One at a time” needs a broker check. Pine's strategy.position_size is simulated state, not actual MT5 exposure. The comment=LDN-PB label does not give the script a broker-position feed. Require independent broker reconciliation and a receiving-side rule where a hard position limit is necessary.

At the 16:00 London close of the bar that opened at 15:00, the illustrative specification requests a close. Sending it then does not establish that the account is flat at 16:00. Confirm the request, broker response, closing deal and remaining positions before recording the exit as complete.

The documented MT5 comment filter applies to closelong for the exact symbol and matching comment, subject to EA scope and installed-version behaviour. It is not account-wide isolation; do not extend that claim to partial-close commands. Multi-Strategy lists the supported commands and demo checks.[13]

Which operational checks must pass before considering live use?

Set the observation plan before starting. A calendar duration or trade count alone cannot show that the relevant entry, exit and failure paths were exercised. These checks assess operational readiness; they are not profitability criteria.

Check Proceed only when If not
Complete evidence Every intended signal and actual broker trade in the chosen run is reconciled. Keep unresolved records open.
Version and routing Alert version, recipient group and broker symbol match the specification. Fix inputs; recreate changed alerts.
Size and protection Actual volume and broker SL/TP match the reviewed request. Resolve sizing or protection defects.
Duplicates and scope Extra orders are explained; intended strategy scope is verified. Inspect sources and receiving connections.
Exit and exceptions Relevant exits, filters and failure responses have documented outcomes. Run the missing demo check.
Monitoring and intervention An owner can detect drift, pause entries and verify account state. Complete Part 8 before proceeding.

Changing to a live account changes the receiving setup. Recheck its account/server, symbol specification, permissions and routing, and ask the broker how demo execution differs. A successful demo test does not certify live fills.

Where PineConnector Edge fits, and where it does not

PineConnector Edge supplies the hosted MT5 terminal and PineConnector EA. Your rules, messages, account selection and broker checks remain your responsibility. Its EA Settings tab, where applying a change restarts the terminal, and its lack of third-party EA hosting may matter when choosing where a control will run.[7]

The Edge tag in Bridge identifies where processing occurred; read the separate Status field for the processing outcome. Experts shows EA activity, and Journal includes terminal trading messages and broker responses. An attempted close in Experts is still an attempt: use the matching Journal result and account positions or history to establish what happened.[7]

Limitations and common mistakes

  • Demo is a separate environment. Do not assume its fills, spreads or available symbols match a live account.
  • A quiet log is not a completed test. Historical markers do not replay as newly sent alerts; you need relevant realtime events.[9]
  • Receipt is not execution. Keep alert trigger, webhook delivery, PineConnector processing, EA request, broker acceptance, deals and positions separate.
  • Unknown retry behaviour stays unknown. Do not assume webhook repeats are deduplicated or missed instructions are replayed after restart. Inspect the account before resending an ambiguous request.
  • Existing protection and new exit requests differ. Check broker-side SL/TP separately from the ability to deliver a later close instruction.

Frequently asked questions

Can I read Experts and Journal if I use Edge?

Yes. Select the hosted instance in Portal → Edge and open Experts or Journal. Check the selected date range and refresh before treating an absent entry as missing activity.[7]

How many demo signals are enough?

Use the scenarios in your specification and the reconciliation checklist. A run that never encounters a required exit or exception has not tested that path, regardless of its length. No fixed number certifies future results.

Why does the demo still follow an older version?

A running TradingView alert keeps its saved configuration. Delete it and create a new alert after a script, input, symbol or timeframe change, then verify the new event and message.[2]

Does a good backtest or demo run establish future profit?

No. Those records describe the tested rules, assumptions and observed setup. They do not predict future market conditions or broker outcomes.

Next step

Keep the reconciliation worksheet with the frozen rule specification. Then use Part 8's monitoring, pause and resume checklist to define who intervenes, what each control affects and how account state is verified before resuming.

Reviewed 23 September 2026 against the linked primary documentation, including refreshed product, strategy and MT5 references; Edge EA Settings updated 6 October 2026. No trading account was tested and no Pine Script or MQL5 code was compiled.

Sources

  1. TradingView – Pine Script Strategies, accessed 23 September 2026.
  2. TradingView – Pine Script Alerts, accessed 23 September 2026.
  3. TradingView – How to configure webhook alerts, accessed 23 September 2026.
  4. PineConnector Docs – PineConnector Syntax, accessed 23 September 2026.
  5. PineConnector Docs – Test your setup, accessed 23 September 2026.
  6. MetaQuotes – Algorithmic Trading, accessed 23 September 2026.
  7. PineConnector Docs – Connect your MT5 account and inspect Edge logs, accessed 23 September 2026.
  8. PineConnector Docs – Product updates, accessed 23 September 2026.
  9. PineConnector Docs – Recommendations, accessed 23 September 2026.
  10. PineConnector Docs – Pine Script Converter, accessed 23 September 2026.
  11. MetaQuotes – Basic Principles: Orders, Deals and Positions, accessed 23 September 2026.
  12. PineConnector Docs – EA Errors, accessed 23 September 2026.
  13. PineConnector Docs – Multi-Strategy, accessed 23 September 2026.
  14. PineConnector Docs – MetaTrader 5 setup, accessed 23 September 2026.

PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.

Back to PiCo Blog

Run your strategies on our managed infrastructure

Bridge routes TradingView alerts to MetaTrader. Edge hosts and runs MT5 for you.

Core Trial

Then $59/month unless you cancel.

$7for 7 days

  • 3 account connections
  • 1 hosted MT5
  • Unlimited alerts, routed by Bridge
Try Core for $7

Trusted by 66,000+ traders in 156 countries and territories · <1s typical latency

Your Edge MT5 runs in our cloud · nothing to install · built on Microsoft Azure