Deploy your TradingView โ MT4 Signal Bridge to production with a permanent HTTPS URL.
Vercel hosts the app (serverless, always-on). Neon hosts the PostgreSQL database (free tier, no sleep). Both are free for hobby use with no time limits.
โ Free forever ยท โ Always-on (no sleep) ยท โ Automatic HTTPS ยท โ Permanent URL
tv-mt4-bridge, pick region closest to youโ ๏ธ Use the Direct connection string, NOT the pooled one. The pooled URL contains -pooler in the hostname โ avoid that.
In Neon dashboard, click SQL Editor in the left sidebar. Paste this entire SQL block and click Run:
do $$
begin
if not exists (select 1 from pg_type where typname = 'signal_status') then
create type signal_status as enum ('pending','executed','failed','expired','cancelled');
end if;
end $$;
create table if not exists api_keys (
id uuid primary key,
name varchar(100) not null,
key varchar(64) not null unique,
is_active boolean not null default true,
created_at timestamp not null default now(),
last_used_at timestamp
);
create table if not exists signals (
id uuid primary key,
api_key_id uuid references api_keys(id),
action varchar(20) not null,
action_type varchar(50),
symbol varchar(20) not null,
price numeric(18,8),
stop_loss numeric(18,8),
take_profit numeric(18,8),
lot_size numeric(10,2),
magic_number varchar(20),
ticket varchar(20),
expiration timestamp,
comment text,
status signal_status not null default 'pending',
source varchar(50) default 'tradingview',
raw_payload text,
executed_at timestamp,
error_message text,
created_at timestamp not null default now(),
updated_at timestamp not null default now()
);
create table if not exists signal_logs (
id uuid primary key,
signal_id uuid not null references signals(id),
message text not null,
level varchar(10) not null default 'info',
created_at timestamp not null default now()
);You should see CREATE TABLE / DO results with no errors.
๐ก Verify tables exist: In SQL Editor, run select table_name from information_schema.tables where table_schema = 'public'; โ you should see api_keys, signals, signal_logs.
tv-mt4-bridgecd your-project-folder git init git add . git commit -m "Initial commit" git remote add origin https://github.com/YOUR_USERNAME/tv-mt4-bridge.git git branch -M main git push -u origin main
โ ๏ธ Make sure you have a .gitignore that excludes node_modules/ and .next/ and .env. Otherwise GitHub will reject the push.
tv-mt4-bridge repoVercel builds in ~60 seconds. You'll get a permanent URL like tv-mt4-bridge.vercel.app.
https://your-app.vercel.app/api/health โ should return {"ok":true}https://your-app.vercel.app/api/keys โ should return {"keys":[]}https://your-app.vercel.app โ dashboard should loadcurl -X POST https://your-app.vercel.app/api/webhook \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY_HERE",
"action": "buy",
"symbol": "EURUSD",
"lot_size": 0.01
}'Update these with your permanent Vercel URL:
| Setting | Value |
|---|---|
| TradingView Webhook | https://your-app.vercel.app/api/webhook |
| MT4 Allowed URL | https://your-app.vercel.app |
| EA ServerURL | https://your-app.vercel.app |
| EA ApiKey | Your generated API key |
๐ This URL never changes โ no more updating MT4 and TradingView after every rebuild!
Railway deploys both the app and PostgreSQL in one click. Simpler setup, but the free tier only covers ~20 days of 24/7 usage ($5/month Hobby plan for unlimited).
DATABASE_URLThe database tables were not created. Run the SQL from Step 2 in Neon SQL Editor.
DATABASE_URL is set in Vercel Settings โ Environment Variables-pooler in the hostname โ avoid it for schema operations.gitignore is missing or doesn't exclude node_modules/git rm -r --cached node_modules then commit and push againDATABASE_URL in Vercel dashboard โ Settings โ Environment Variables/api/webhook/test endpoint first (no auth needed)https:// not http://.arena.site URLs โ only .vercel.app or .e2b.app