Home

/

Guides

/

TradingView to Phemex

Exchange SetupUpdated 2026-02-07

TradingView to Phemex Futures: Step-by-Step Webhook Guide

8 min read

2026-02-07

Why Automate Phemex with TradingView

Phemex has earned a strong reputation in the crypto derivatives space for its fast execution engine, clean user interface, and reliable infrastructure. Originally founded by ex-Morgan Stanley executives, the exchange brings a Wall Street engineering mindset to crypto trading. For derivatives traders who value speed and a polished trading experience, Phemex is a compelling choice.

But speed on the exchange side only matters if you can act on opportunities fast enough. Manual trading introduces delays that no exchange can eliminate: the time it takes to notice a signal, open the app, size the position, and click the button. These seconds add up. In fast-moving markets, they can be the difference between catching a move and chasing it.

TradingView is where most traders develop their edge. Pine Script indicators, custom alerts, and community strategies make it the industry standard for chart analysis. What TradingView lacks is direct order execution. It can tell you when to trade, but it cannot trade for you.

Flipr.Cloud connects the two. When your TradingView indicator triggers, the alert fires a webhook to Flipr.Cloud, which parses your plain-text command and places the order on Phemex within 50 to 250 milliseconds. No manual intervention, no JSON formatting, no delays.

Flipr.Cloud routes Phemex trades through its Singapore server, providing low-latency connectivity to Phemex infrastructure. With connection pooling keeping your API session warm, every subsequent order benefits from pre-established connections. The result is consistent, fast execution from the moment your TradingView alert fires.

Prerequisites

Before you begin, make sure you have the following accounts and tools ready. The entire setup takes about 5 to 10 minutes once you have these in place.

  1. Phemex Account (verified) — Sign up at phemex.com and complete identity verification. You need a verified account to create API keys and trade futures.
  2. TradingView Account (Essential plan or higher) — Webhooks are a paid feature on TradingView. The Essential plan (or higher) is required to send webhook notifications from your alerts. The free plan does not support webhooks.
  3. Flipr.Cloud Account — Create a free account at flipr.cloud. The free trial gives you full access to all Pro features with no time limit and no credit card required, so you can test everything before committing.

Phemex Testnet: Best in Class

Phemex offers one of the best testnet environments in crypto. It closely mirrors the live trading experience with virtual funds, making it ideal for testing your entire automation pipeline risk-free. When adding your API key in Flipr.Cloud, simply toggle the Testnet option. This is strongly recommended for your first setup.

Step 1: Create a Phemex API Key

The API key is how Flipr.Cloud authenticates with Phemex to place orders on your behalf. You will create a restricted key that can only trade, never withdraw, ensuring your funds stay safe even if the key is ever compromised.

  1. Log in to your Phemex account and navigate to Account > API Management.
  2. Click "Create New API Key".
  3. Give the key a descriptive label, such as Flipr-TradingView or TV-Automation.
  4. Set Permissions: Enable "Trading" only. Do not enable "Withdrawal" or "Transfer" permissions. Trading permission is all Flipr.Cloud needs to open and close positions on your behalf.
  5. IP Whitelisting (recommended): For extra security, add the Flipr.Cloud Singapore server IP to the allowed list. You can find the current server IP in your Flipr.Cloud dashboard under API Keys settings.
  6. Click "Confirm" and complete any 2FA or email verification Phemex requires.
  7. Save your API Key and Secret Key immediately. Phemex only shows the Secret Key once during creation. Store both values in a secure password manager.

Security Warning

Never share your API key or secret with anyone. Never enable withdrawal permissions for a trading bot key. If you suspect your key has been compromised, delete it immediately from Phemex and create a new one. Flipr.Cloud encrypts all API keys at rest using industry-standard Fernet encryption.

Step 2: Add the API Key to Flipr.Cloud

Now that you have your Phemex API key and secret, you need to register them with Flipr.Cloud so it can execute trades on your behalf.

  1. Log in to Flipr.Cloud and navigate to the API Keys page from the sidebar.
  2. Click the "Add API Key" button.
  3. Select Phemex as the exchange.
  4. Select Futures as the market type.
  5. Paste your API Key and Secret Key into the corresponding fields.
  6. Give the key a recognizable label (e.g., Phemex-Main).
  7. If testing, toggle the "Testnet" option to connect to the Phemex demo environment.
  8. Click "Test Connection" to verify that Flipr.Cloud can reach Phemex with your credentials.

Connection Verified

If the test shows your account balance, the connection is working correctly. Flipr.Cloud is now authorized to place trades on your Phemex account. If the test fails, double-check that your API key has Trading permission enabled and that you copied the key and secret without extra spaces.

After adding the key, you will see your personal webhook URL on the dashboard. It looks like:

Your Webhook URL

https://flipr.cloud/webhook/{your_user_id}/{your_webhook_token}

Copy this URL. You will need it in the next step when configuring your TradingView alert.

Step 3: Create a TradingView Alert with Webhook

This is where the automation happens. You will configure a TradingView alert that sends a webhook request to Flipr.Cloud every time your indicator or strategy triggers. Flipr.Cloud will parse the message and execute the trade on Phemex instantly.

  1. Open your chart on TradingView with the indicator or strategy you want to automate.
  2. Click the "Alert" button (clock icon) or press Alt + A.
  3. Set your alert condition (e.g., indicator crossing a threshold, strategy entry signal, price level).
  4. In the "Notifications" tab, check "Webhook URL" and paste your Flipr.Cloud webhook URL.
  5. In the "Message" field, enter your trading command using Smart Syntax. This is plain text, not JSON:

Alert Message (Market Entry with SL/TP)

BTCUSDT on Phemex_F market long 0.01 sl off 2% tp off 5%

That is it. Two lines. The first line specifies the symbol and exchange. The second line is the trading command with an inline stop loss and take profit. When the alert fires, Flipr.Cloud will:

  • Open a long position of 0.01 BTC on Phemex Futures

  • Set a stop loss 2% below the entry price

  • Set a take profit 5% above the entry price

Click "Create" to save the alert. TradingView will now send a webhook to Flipr.Cloud every time this alert triggers.

About Phemex_F

The _F suffix tells Flipr.Cloud to route the order to Phemex Futures (perpetual contracts). Always include this suffix when targeting Phemex. If you have multiple Phemex API keys (for example, separate subaccounts), you can target a specific one by using the key label instead, e.g., BTCUSDT on Phemex-Main.

Step 4: Test with a Small Order

Before deploying your full strategy, always test with the smallest possible position size. This confirms that the entire pipeline works: TradingView fires the alert, Flipr.Cloud receives it, parses the command, and executes the trade on Phemex.

  1. Create a test alert with a condition that will trigger soon (e.g., price crossing a level that is close to the current price).
  2. Use the minimum position size for the pair. For BTCUSDT on Phemex, this is typically 0.001 BTC.
  3. Open the Real-Time Log on your Flipr.Cloud dashboard. This shows every incoming webhook and the resulting trade execution in real time via Server-Sent Events.
  4. Wait for (or manually trigger) the alert. Watch the Real-Time Log for the execution confirmation.
  5. Verify the order on Phemex by checking your Positions and Order History.

Pay attention to the execution speed shown in the Real-Time Log. For Phemex, you should see execution times under 250ms. This is the time from when Flipr.Cloud received the webhook to when the order was confirmed by Phemex.

Use Testnet First

For your very first test, consider using the Phemex testnet instead of real funds. Create a testnet API key on Phemex, add it to Flipr.Cloud with the Testnet toggle enabled, and run your test there. Once everything works on testnet, switch to your live key. This eliminates any risk during the initial setup.

Useful Smart Syntax Commands for Phemex

Flipr.Cloud uses Smart Syntax, a plain-text command format designed for TradingView webhooks. Here are the most common commands you will use with Phemex Futures. Every example assumes the first line is your symbol header (e.g., BTCUSDT on Phemex_F).

Market Entry with Stop Loss and Take Profit

The most common command. Opens a position at market price with protective stop loss and take profit orders placed automatically.

Market Long with SL/TP

BTCUSDT on Phemex_F market long 0.01 sl off 2% tp off 5%

The off prefix means "offset from current price." So sl off 2% places the stop loss 2% below your entry, and tp off 5% places the take profit 5% above.

Limit Entry

Place a limit order at a specific offset from the current price, with stop loss and take profit.

Limit Order

ETHUSDT on Phemex_F limit long 0.1 off 1% sl off 2% tp off 5%

This places a limit buy order 1% below the current price. The SL and TP will be placed after the limit order fills.

Close a Position

Close part or all of an open position. Use percentage of position size for flexible exits.

Close Entire Position

BTCUSDT on Phemex_F close long 100%

Close Half Position

BTCUSDT on Phemex_F close long 50%

Entry-Relative Stop Loss and Take Profit

Use the e prefix to set SL/TP relative to your entry price instead of the current price. This is useful when the market price may have moved by the time the order executes.

Entry-Relative SL/TP

SOLUSDT on Phemex_F market short 1 sl e+1.5% tp e-4%

For a short position, sl e+1.5% places the stop loss 1.5% above entry, and tp e-4% places take profit 4% below entry.

Multiple Take Profits

You can send multiple commands in a single webhook message using a block format. This is useful for scaling out of a position at different price levels.

Entry with Multiple Take Profits

BTCUSDT on Phemex_F market long 0.03 takeprofit long 33%p off 3% takeprofit long 33%p off 5% takeprofit long 100%p off 8%

This opens a 0.03 BTC long, then sets three take profit levels: 33% of the position at 3% profit, another 33% at 5%, and the remaining position at 8%.

Check Balance

You can check your Phemex account balance at any time by sending a simple balance command.

Balance Check

BTCUSDT on Phemex_F balance

Phemex-Specific Tips

Phemex has some exchange-specific characteristics that are worth understanding when setting up your automation. Here are the key points to keep in mind.

USDT-Margined Perpetual Futures

Phemex futures are USDT-margined perpetual contracts. This means your margin and PnL are both denominated in USDT. You need USDT in your contract trading account to open positions. All symbols follow the format SYMBOLUSDT (e.g., BTCUSDT, ETHUSDT, SOLUSDT).

Excellent Testnet Environment

Phemex is known for having one of the most polished testnet environments among crypto exchanges. The testnet closely mirrors live conditions, including order book depth and execution behavior. Use it to thoroughly test your TradingView alerts and Smart Syntax commands before risking real capital. Toggle the Testnet option when adding your API key in Flipr.Cloud to switch between environments.

Leverage Settings

Phemex allows you to set leverage per trading pair on the exchange interface. Flipr.Cloud respects whatever leverage you have configured on Phemex. Set your desired leverage directly on the Phemex platform before running automated trades. This gives you full control over your risk exposure without needing to specify leverage in every webhook command.

Singapore Server Routing

Flipr.Cloud routes all Phemex orders through its Singapore server, which provides low-latency connectivity to Phemex infrastructure. This is handled automatically. When you send a webhook to Flipr.Cloud, the system detects the target exchange and routes the request to the optimal regional server. Combined with connection pooling, this delivers consistent execution speeds of 50 to 250ms.

Growing Altcoin Selection

Phemex has been steadily expanding its perpetual futures offerings beyond the major pairs. In addition to BTC, ETH, SOL, XRP, and DOGE, you will find an growing selection of mid-cap and trending altcoin perpetuals. New pairs are added regularly, giving you more opportunities to automate diversified strategies across multiple assets.

Troubleshooting

If your webhook automation is not working as expected, here are the most common issues and their solutions. Most problems are related to API key configuration or account setup.

"Invalid API Key" Error

  • Verify you copied the API key and secret correctly, with no extra spaces or characters.
  • Confirm the key has Trading permission enabled on Phemex.
  • Make sure the key is for the correct environment (live vs. testnet). A testnet key will not work with the live Testnet toggle off, and vice versa.
  • Use the "Test Connection" button in Flipr.Cloud to re-verify.

"IP Not Whitelisted" Error

  • If you enabled IP whitelisting on Phemex, add the Flipr.Cloud Singapore server IP to the allowed list.
  • The server IP is displayed on the Flipr.Cloud API Keys page when you select Phemex.
  • Alternatively, disable IP restrictions on the Phemex API key if you prefer simplicity (slightly less secure).

"Insufficient Balance" Error

  • Ensure you have sufficient USDT in your Phemex Contract Trading account (not your Spot wallet).
  • Transfer USDT from your Spot wallet to your Contract Trading account on Phemex if needed.
  • Check that your position size multiplied by current price divided by leverage does not exceed your available margin.

"Symbol Not Found" Error

  • Use the format BTCUSDT without slashes or colons. This matches the format shown on the Phemex exchange.
  • Do not use BTC/USDT or BTC/USDT:USDT. Phemex uses the concatenated symbol format.
  • Make sure the pair is listed on Phemex Futures. Not all crypto assets have a corresponding perpetual contract.

Webhook Not Received

  • Confirm the webhook URL is correctly pasted in TradingView. It should start with https://flipr.cloud/webhook/.
  • Check that your TradingView plan supports webhooks (Essential or higher).
  • Look at the Real-Time Log on Flipr.Cloud to see if the webhook arrived but failed to execute.
  • Make sure the alert is active and has not expired.

Frequently Asked Questions

Ready to Automate Your Trading?

Set up TradingView webhook automation in under 2 minutes. No JSON required. Works with 15+ exchanges.

Full Pro features • No time limit • No credit card