Automate TradingView alerts on Coinbase
Create a Coinbase Advanced Trade API key, add it to StockAutoTrader, and point TradingView alerts at a bot's buy and sell URLs. Orders go to your own Coinbase account against the USD pair, sized in fractions, and capped by your balance.
Starter $49/mo · Bundle $149/mo · cancel from the dashboard.
How the connection works
You create an API key in the Coinbase Developer Platform with trade permission, then paste the key ID and private key (plus passphrase if your key has one) into Webhook Setup. The key is used to sign order requests for your bots.
StockAutoTrader does not connect Coinbase to a sandbox, so every Coinbase bot order is real. Start with a small max amount per trade and scale up once the audit trail looks right.
Setup, step by step
- Start a trial from pricing and sign in.
- In the Coinbase Developer Platform, create an API key with view and trade permissions. Do not enable transfer permissions.
- In Webhook Setup, choose Coinbase and paste the API key ID and private key.
- Create a bot: choose Coinbase, the asset (for example
BTC, traded asBTC-USD), and a small max dollar amount. - Copy the Buy Signal URL and Sell Signal URL.
- Create one TradingView alert per side with Webhook URL enabled, and paste the matching URL.
- Use the example message below, or an empty message to let the bot fetch the Coinbase price.
- Review the first orders in the trade history.
Example alert message
Spend up to $200 of USD on BTC at market when the buy alert fires:
{
"price": {{close}},
"max_amount": 200,
"signal_id": "btc-buy-{{timenow}}"
}Sell a fixed 0.01 BTC with a limit 0.2% above the close:
{
"price": {{close}},
"quantity": 0.01,
"default_sell_percent": 0.2
}What is supported on Coinbase
| Item | Supported |
|---|---|
| Markets | Spot, against USD (the bot asset plus "-USD", such as ETH-USD) |
| Order types | Market, or limit at a % offset from price |
| Quantity | Fractional, rounded to 8 decimals |
| Market buys | Sent as a USD amount, capped at your available USD balance |
| Sells | Capped at the amount of the asset you hold and at the dollar cap |
| Minimum | Orders under $1 are rejected before reaching Coinbase |
| Price source | Alert price, or a live Coinbase price if none is sent |
| Cancel stale limits | Optional: cancel this bot's unfilled limit orders before a new one |
| Not supported via webhook | Non-USD pairs, derivatives, margin, stop orders |
Fields the bot reads
| Field | Type | What it does |
|---|---|---|
| price | number or numeric string | Reference price. Used for sizing and as the base for limit offsets. TradingView: {{close}}. |
| quantity | number | Shares or coins for this order. Overrides the bot default. |
| max_amount | number (USD) | Dollar cap for this order. Overrides the bot setting. |
| default_buy_quantity | number | Overrides the bot default buy quantity. |
| default_sell_quantity | number | Overrides the bot default sell quantity. |
| default_buy_percent | number | Places a limit buy this % below price. 0 means market. |
| default_sell_percent | number | Places a limit sell this % above price. 0 means market. |
| signal_id | string | Idempotency key. A repeated signal_id is ignored instead of trading twice. |
How quantity is decided
quantityfrom the alert, if present.- Otherwise the bot default buy or sell quantity.
- Otherwise
max_amountdivided by price (whole shares for stocks, up to 8 decimals for crypto). - If no price was sent, the engine asks the broker for a quote where it can (Tradier and Coinbase).
- The order is rejected if the result is zero, above 10,000 units, or more than 1% over the dollar cap.
Things to know before going live
- Crypto trades around the clock, so alerts can fire while you sleep. Set a max amount you are comfortable losing on any single order.
- If your USD balance is lower than the requested buy, the order is reduced to what is available rather than failing.
- A sell with no holdings of that asset is rejected with a clear message.
Automated trading can lose money. Not investment advice. A webhook runs whatever your alert says, including a bad alert. Test in a sandbox or at small size first, and watch the audit trail.
Frequently asked questions
Which coins can I trade?
Any asset Coinbase lists against USD. You set the asset on the bot (for example SOL), and orders go to the matching USD pair (SOL-USD).
Is there a Coinbase paper mode?
No. Coinbase bot orders go to your real Coinbase account. Start with a small max amount. You can also rehearse the same alerts on Tradier's sandbox first.
What API permissions should the key have?
View and trade. StockAutoTrader never needs transfer or withdrawal permission, so leave those off.
Can it buy with a dollar amount instead of a coin amount?
Yes. Market buys are sent to Coinbase as a USD amount, which is how most people size crypto. Set max_amount on the bot or in the alert.
Related guides
- TradingView webhook automation, explainedHow TradingView webhook alerts work, how to write the alert message, how to size and route orders to a broker, and how to avoid duplicate or runaway trades.
- Automate TradingView alerts on TradierSend TradingView webhook alerts to your own Tradier account as market or limit stock orders. Setup steps, example alert JSON, sizing rules, and sandbox testing.
- Automate TradingView alerts on TastytradeRoute TradingView webhook alerts to your Tastytrade account as market or limit stock orders. OAuth setup, example alert JSON, sizing rules, and sandbox notes.
- A TradersPost alternative for TradingView alertsAn honest comparison of TradersPost and StockAutoTrader for TradingView webhook automation: pricing, brokers, sizing, testing, and where each one fits better.
Connect a broker and test your first alert
Orders run in your own account. Start on a broker sandbox, read the audit trail, and go live when you decide to.
Automated trading can lose money. Not investment advice.