Kraken Guide
Connect TradingView to Kraken (Spot and Futures) using TradeAdapter’s direct API integration for strategies and indicators.
Video walkthrough #
Kraken + TradingView setup
1 — Create Kraken API keys #
Separate keys per market
Kraken uses different API keys for Spot and Futures. Create a Spot key on the main Kraken site for Spot trading, and a Futures key on Kraken Futures for Futures. Use the correct key in your alert message for the market you are trading.
-
Choose the right site
Spot: Go to kraken.com and sign in. Futures: Use the Kraken Futures platform and create or log in to your Futures account.
-
Open API management
Navigate to API Management (or Security → API) and create a new API key. Name it (e.g.
TradeAdapter) and complete any verification steps. -
Set permissions
Enable only the permissions needed for trading (e.g. Create & modify orders, Query open/closed orders). Keep Withdraw disabled — TradeAdapter never needs withdrawal access.
-
Restrict to TradeAdapter IP (if available)
If Kraken offers IP whitelisting, add
35.75.198.16so only TradeAdapter can use this key. -
Save your credentials
Copy your API Key and Private Key. The Private Key is shown only once — store it securely. You will paste both into the alert message.
2 — Select the Kraken symbol in TradingView #
Open TradingView and search for the symbol using the KRAKEN prefix. Match the symbol type to the market you enabled with your API key (Spot or Futures).
Search KRAKEN:BTCUSD, KRAKEN:ETHUSD, KRAKEN:XBTUSDT, etc. Kraken Spot uses pairs like XBT/USD, ETH/USD, or USDT pairs.
For Kraken Futures, select the corresponding perpetual or futures symbol offered by TradingView under the Kraken exchange (e.g. KRAKEN:PF_XBTUSD or the symbol that matches the supported Futures list).
Important
The {{ticker}} placeholder sends this exact symbol to Kraken. The symbol must exist in the chosen market (Spot or Futures) and match the supported symbols list. Wrong symbol or market will cause order failures.
3 — Add your indicator or strategy #
Load your Pine Script indicator or strategy onto the chart. This generates the trading signals for Kraken.
Open Pine Editor, paste your strategy code, and click “Add to chart”. Check the Strategy Tester tab to confirm backtest results and that orders are generated.
Add the indicator to the chart. It must use alertcondition() for Buy/Sell (and optionally TP/SL). You will create one alert per action and set order_action and order_size manually in the message.
Not sure which one you have? See Indicator vs Strategy.
4 — Configure order size #
Kraken enforces symbol-specific rules (ordermin, costmin, lot_decimals, tick_size for Spot; Qty MinSize, Price TickSize for Futures). Make sure your order size and price respect these for the symbol you trade.
How to set order size
Strategy: Configure your strategy’s position size so that {{strategy.order.contracts}} meets the symbol’s minimum and step. For Limit orders, ensure {{strategy.order.price}} respects the price tick size.
Indicator: Set the size manually in the alert message with order_size (see below), respecting the symbol’s minimum and precision.
5 — Create the TradingView alert #
Press Alt + A (or click the alarm clock icon) to create a new alert on your strategy or indicator.
Under Condition, select your strategy and set trigger to “Order fills only”. TradingView fills action, size, and price via {{strategy.*}} placeholders.
Under Condition, choose the specific alertcondition() (e.g. Buy, Sell). Set order_action and order_size manually in the JSON message.
Required: Webhook URL + Message
In Notifications, enable Webhook URL and paste your personal webhook from your TradeAdapter profile. Paste the JSON message (below) in the Message field.
Alert message formats #
Use one of the following templates depending on whether the alert comes from a strategy or an indicator.
{
"kraken_api_key": "YOUR_KRAKEN_API_KEY",
"kraken_private_key": "YOUR_KRAKEN_PRIVATE_KEY",
"real_order": "No",
"order_market": "Spot",
"order_type": "Market",
"exchange": "kraken",
"ticker": "{{ticker}}",
"time": "{{timenow}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.order.action}}",
"order_price": "{{strategy.order.price}}"
}
Open Kraken Message Generator (Strategy)
{
"kraken_api_key": "YOUR_KRAKEN_API_KEY",
"kraken_private_key": "YOUR_KRAKEN_PRIVATE_KEY",
"real_order": "No",
"order_action": "BUY",
"order_size": "0.01",
"order_market": "Spot",
"order_type": "Market",
"exchange": "kraken",
"ticker": "{{ticker}}",
"time": "{{timenow}}"
}
Message fields explained #
| Field | Description |
|---|---|
kraken_api_key |
Your Kraken API Key (Spot or Futures, depending on the market you trade). |
kraken_private_key |
Your Kraken Private Key from the API creation step. Store it securely and never share it. |
real_order |
"Yes" sends real orders to Kraken. "No" sends test orders via TradeAdapter only (no live trades). |
order_market |
Choose "Spot" or "Futures". Must match your API key type and the TradingView symbol. |
order_type |
"Market" or "Limit". For Limit orders, order_price is used as the limit price. |
exchange |
Must be "kraken" so TradeAdapter routes the order to Kraken. |
ticker |
The TradingView symbol (e.g. KRAKEN:XBTUSD) from {{ticker}}. |
time |
Alert time from TradingView ({{timenow}}). |
order_contracts (Strategy) |
Position size from your strategy ({{strategy.order.contracts}}). |
order_action |
"BUY" or "SELL". For strategies use {{strategy.order.action}}; for indicators set it manually. |
order_price (Strategy) |
Price from the strategy ({{strategy.order.price}}), used for Limit orders. |
order_size (Indicator) |
Manual quantity for indicator alerts. Must respect the symbol’s minimum and precision for Spot or Futures. |
6 — Execute & monitor #
-
Start with test orders
Set
"real_order": "No"and trigger a few alerts. Check MyTrades to see how TradeAdapter interprets your signals. -
Verify on Kraken
When you set
"real_order": "Yes", monitor Orders and Trade History on Kraken (Spot or Futures) to confirm orders execute as expected. -
Scale up gradually
Use small sizes first and increase only after confirming symbol, market, and order size behave correctly.
Important notes #
API security — Never share your Private Key. Use a key with trading-only permissions and no withdrawals. Restrict by IP if Kraken allows it (
35.75.198.16).
Spot vs Futures keys — Use a Spot API key when
order_market is "Spot" and a Futures API key when order_market is "Futures". Mixing them will cause errors.
Respect symbol specs — Check Spot and Futures symbol lists for minimums and precision; test with small orders before scaling.
Recreate alerts after changes — If you change strategy parameters or message fields, delete and recreate the TradingView alert so all values are applied correctly.
Monitor MyTrades — Use TradeAdapter’s MyTrades as the single place to verify what orders are being sent.
All setup guides