You do not need an account to use any PFX tool. This guide shows how to run the PFX relay yourself, on your own computer or VPS. It is free. Your keys are made on your machine and stay there. Nothing in the relay contacts PrecisionFX.
Read the first table. You may not need the relay at all.
| You want to | What you need |
|---|---|
| Copy trades between MT5 accounts on the same computer | Nothing. The PFX Trade Copier works on its own: no account, no internet, no relay. |
| Copy trades between NinjaTrader 8 accounts | Nothing. The PFX Copier (NT8) runs inside NinjaTrader. No account, no relay. |
| Copy trades between MT5 accounts on different computers | The relay (this guide) and the free PFX Copy EAs. They are in the kit, in the EAs folder. |
| Send TradingView alerts to MT5 with the PFX Executor | The relay (this guide), or the PrecisionFX website if you prefer. Both work the same way. |
| Download | For |
|---|---|
PFX-SelfHost-Relay-Windows.zip | Windows PC or Windows VPS. Everything inside, nothing to install. |
PFX-SelfHost-Relay-Linux.zip | Linux, macOS or Docker. Needs Node.js 20 or newer. |
Both are free, with no sign-up, on the guide page precisionfx.io/guides/self-host. If you already have the kit, this same guide is inside it.
| File | What it is |
|---|---|
START-RELAY.cmd | Double-click this to start the relay (Windows). |
pfx-relay.mjs | The relay itself. |
node folder | Node.js, the program that runs the relay. Already inside, nothing to install. |
EAs folder | PFX Copy Source, Follower and Observer EAs (for copying between computers). |
relay-config.txt | Your settings and keys. It appears the first time you start the relay. Keep it private. |
relay-state.json | What the relay remembers between restarts. Leave it alone. |
| Do | You should see |
|---|---|
| Right-click the zip, choose Properties, tick Unblock if it is there, press OK. | Nothing yet. This stops Windows asking about each file. |
Unzip it to a folder that stays, for example C:\PFX-Relay. | The files listed above. |
Double-click START-RELAY.cmd. | A black window: PFX Self-Host Relay 1.00 - free, runs on your own computer. then First run: made relay-config.txt with new keys. |
Leave the window open. Closing it stops the relay. Open trades are never closed by stopping it.
Not seeing it?
| It says | What to do |
|---|---|
Windows protected your PC | Press More info, then Run anyway. Or unblock the zip first (above) and unzip again. |
Port 8787 is already in use | The relay is already running in another window. Use that one, or change port in relay-config.txt. |
Node.js was not found | You have the Linux download. Get the Windows download. |
Open relay-config.txt in Notepad. Every line is name = value. Save the file and the relay reads it again within a few seconds.
| Line | What it does |
|---|---|
webhook = pfxr_... name=Main | A TradingView webhook. Add another line with webhook = new name=Gold for a second one. |
terminal = pfxk_... name=Terminal-1 | A key for one PFX Executor. One line per MT5 terminal. |
copy_source = pfxcopy_... name=Source | The key for the PFX Copy Source EA (the account you trade). |
copy_follower = pfxcopy_... name=Follower-1 mode=off | A key for one PFX Copy Follower EA. mode=off watches only. mode=on copies new trades. |
news_mode = OFF | The Executor's news guard: OFF, HIGH or HIGH_MEDIUM. |
tunnel = off | Your internet address. See step 3. |
To make a new key, write the word new where the key goes, and save. To stop a key working, delete its line.
Not seeing it? The black window prints Settings: line 7: ... with the reason when a line is wrong. Fix that line and save. Nothing else stops.
TradingView needs a public https:// address to send alerts to. The PFX Copy EAs also only accept https:// addresses. A tunnel gives your relay one, without opening your router. Your relay still only listens on this computer.
| Option | Good for | How |
|---|---|---|
| Quick test | Trying it out today | Download cloudflared-windows-amd64.exe from Cloudflare's cloudflared downloads page. Rename it cloudflared.exe and put it in the kit folder. Set tunnel = quick. Restart the relay. The address changes every restart, so use this for testing only. |
| Cloudflare Tunnel (recommended) | A lasting address, free | Needs a free Cloudflare account and a domain on Cloudflare. In Cloudflare Zero Trust open Networks > Tunnels, create a tunnel (type cloudflared), and copy its token. Add a public hostname, for example relay.yourdomain.com, pointing to http://localhost:8787. Then set tunnel = cloudflare, cloudflare_token = <the token> and public_address = https://relay.yourdomain.com. Put cloudflared.exe in the kit folder too. |
| ngrok | A lasting address without your own domain | A free ngrok account includes one free fixed address. Run ngrok http 8787 --url=https://your-name.ngrok-free.app in its own window and set public_address to that address. |
Restart the relay after changing tunnel. It then prints every address you need:
| It prints | Where it goes |
|---|---|
Relay address for every EA | The Executor's relay address |
Copy EAs (Relay address) | The PFX Copy EAs' Relay address (it ends in /api/copy/relay) |
TradingView webhook "Main" | The Webhook URL in your TradingView alert |
In MT5, allow WebRequest for | MT5's WebRequest list (step 4) |
Not seeing it?
| It says | What to do |
|---|---|
Could not start cloudflared.exe | cloudflared.exe is not in the kit folder, or is still called cloudflared-windows-amd64.exe. |
The tunnel stopped | Check the internet connection, then restart the relay. |
In every MT5 terminal that uses the relay: Tools > Options > Expert Advisors. Tick Allow WebRequest for listed URL, add the address the relay printed after In MT5, allow WebRequest for, and press OK.
Not seeing it? The Executor prints WebRequest is not allowed for and the Copy EAs show MT5 is blocking the relay address. Both mean this step. Add the address exactly as printed, then re-attach the EA.
| Setting | Set it to |
|---|---|
| Signal source | PrecisionFX Cloud (this is the relay setting; your own relay counts) |
| ^ cloud: terminal key from your dashboard | Your terminal = pfxk_... key from relay-config.txt |
| ^ cloud: relay address (leave as-is) | Your relay address, for example https://relay.yourdomain.com |
In TradingView, paste the TradingView webhook address into the alert's Webhook URL. The alert message does not change. When an alert arrives the black window prints TradingView (Main): BUY XAUUSD queued as #1, then Executor: Terminal-1 collected #1, then what the EA did with it.
Not seeing it?
| It says | What to do |
|---|---|
terminal key rejected (in MT5) | The key in the EA does not match a terminal = line. Copy it again. |
an alert came to an address that is not in relay-config.txt | The webhook URL in TradingView is old or mistyped. Copy it from the window again. |
skipped ... entry alert(s) older than 10 minutes | The terminal was off. Old entries are never traded late; closes still go through. |
| Do | Detail |
|---|---|
| Install the EAs | In each MT5: File > Open Data Folder > MQL5 > Experts, copy in the .ex5 from the kit's EAs folder, restart MT5. |
| The account you trade | Attach PFX_Copy_Source. Relay address = your Copy EAs address. Connection key = your copy_source key. |
| Each account that copies | Attach PFX_Copy_Follower. Same Relay address. Connection key = that follower's copy_follower key. |
| Two switches before anything is copied | In relay-config.txt set that follower's mode=on, and in the Follower EA tick Allow this EA to place orders. |
Start on demo accounts. Losing trades are copied too. One key runs on one terminal only.
Not seeing it?
| It says | What to do |
|---|---|
The relay address must start with https:// | Use the tunnel address from step 3, not http://127.0.0.1. |
The relay does not recognise this key. | The key is not in relay-config.txt (or its line was deleted). Copy it again. |
This key is bound to a different account. | Each key belongs to one account. To move it, write new in place of that key and paste the new key into the EA. |
Another installation is using this key. | The same key is on two terminals. Give each terminal its own line. |
The relay only works while its window is open and the computer is on. On a VPS, start it once and leave it.
To start it with Windows: press Win+R, type shell:startup, press Enter, and put a shortcut to START-RELAY.cmd in the folder that opens.
Linux or a server: install Node.js 20 or newer and run sh start-relay.sh, or use the Dockerfile in the kit (its first lines say how).
| Rule | Why |
|---|---|
| The relay listens on this computer only | listen = 127.0.0.1. The tunnel reaches it from inside. Only change this if you know why. |
| Keys are made on your machine | The relay makes them with your computer's own random generator and never sends them anywhere. |
| It never contacts PrecisionFX | No account, no check-in, no updates. The only outside connection is the tunnel you switch on. |
| Stopping it closes nothing | Copies and trades stay open with their stop loss and take profit. They are just not managed until it runs again. |
| It places no trades | The EAs do, on your terminals, under their own settings. Test on demo first. |
Trading carries a high risk of loss and is not suitable for everyone. Copying repeats losses as well as profits.
Every PFX tool is free and stays free: there is no paid tier and nothing is held back. If one helps you and you would like to send a coffee back, there is a Ko-fi link on precisionfx.io. It is entirely optional and unlocks nothing.