DEFX Futures is a fast-growing decentralized perpetual futures exchange that offers deep liquidity, low fees, and a seamless trading experience. With its powerful futures infrastructure, traders can open long or short positions on various crypto assets directly from their wallets — all without giving up custody.
Now, thanks to TradingView to Defx, you can fully automate your DEFX Futures trading strategy or indicator by linking your TradingView alerts to your DEFX account. This integration ensures every signal or strategy alert executes instantly according to your pre-defined commands.
This guide will show you how to set up the automation and the supported command formats for DEFX Futures.
Step 1: Create a Webhook in TradingView.to
- Visit TradingView.to/anywhere and select DEFX Futures from the list of supported platforms.
- Follow the on-screen instructions to create your webhook URL.
- Copy the webhook — you’ll use it when creating alerts on TradingView.
Step 2: Set Up Your TradingView Alert
On your TradingView chart, create a new alert and:
- Paste the webhook URL you copied earlier into the Webhook URL field.
- Enter your preferred trading command in the Message box (details below).
- Save the alert — now every time your condition is met, the alert will automatically send to DEFX Futures.
Command Syntax Overview
Each command follows this format:
action symbol param=value
Example:
Buy BTC_USDC Quantity=0.01
Important Notes:
- Symbol names must be written as they appear on DEFX (e.g.,
BTC_USDC, notBTCUSDC). - There should be no spaces between parameters and values (e.g.,
Q=0.01notQ = 0.01). - You can send up to 5 commands per alert by writing each command on a new line.
Example with multiple commands:
SELL BTC_USDC Q=0.001
SELL ETH_USDC Q=50%
BUY XRP_USDC Q=100
BUY SUI_USDC Q=200
BALANCE B=FREE
Tip: One-word parameters can be written in full or shortened (e.g., both quantity and q work the same).
1. Open an Order
Use BUY, LONG, or 1 to open long positions, and SELL, SHORT, or -1 for short positions.
Optional Parameters
| Parameter | Description | Example |
|---|---|---|
| Q (Quantity) | Order size in tokens or as a % of balance. | Q=0.01, Q=50% |
| OQ (Opening Quantity) | Alternative to Q for opening trades. | OQ=0.01 |
| P (Price) | Entry price for limit orders. | P=16572.35 or P=2% |
| L (Leverage) | Sets leverage multiplier. | L=5 |
| D (Delay) | Execution delay (max 5 sec). | D=3 |
Examples:
BUY PUMP_USDC Q=50%
Opens a long position of PUMP_USDC using 50% of your balance.
{{strategy.order.action}} BTC_USDC q=0.01 L=3
Opens a position according to your TradingView strategy direction with 3x leverage.
Buy SUI_USDC Q=50 P=2.5668
Places a buy limit order at 2.5668 or executes a market order if the price is already above that level.
Sell DOGE_USDC Q=1500 P=2%
Places a sell limit order 2% above the market price.
2. Close an Open Trade
To exit existing positions, use CLOSE, FLAT, or 0.
Optional Parameters
| Parameter | Description | Example |
|---|---|---|
| Q (Quantity) | Amount to close in tokens or %. Default: 100%. | Q=0.01, Q=50% |
| CQ (Closing Quantity) | Alternative to Q for closing trades. | CQ=0.01 |
| T (Type) | Direction to close (BUY or SELL). |
T=BUY |
| D (Delay) | Delay before execution (max 5 sec). | D=3 |
Examples:
Close BTC_USDC
Closes all open BTC_USDC trades.
FLAT SOL_USDC Q=50%
Closes half of your SOL_USDC position.
0 BTC_USDC Q=0.01
Closes 0.01 of your BTC_USDC open position.
3. Cancel a Limit Order
Use CANCEL or EXIT to remove unfilled limit orders.
Examples:
Cancel BTC_USDC
Cancels all BTC_USDC pending limit orders.
Exit ETH_USDC
Cancels all ETH_USDC pending limit orders.
4. Balance Check
Balance, Bal, and Funds are actions to request your account balance.
Optional Parameters
| Parameter | Description | Example |
|---|---|---|
| B (Balance Type) | Specifies the balance type. Options are Free (portion of funds not in use) and Total (entire account balance). Default: B=Free. |
B=Free, B=Total |
Examples:
Balance USDC
Returns your total USDC balance.
Balance B=Free
Displays only the portion of your funds that are not currently committed to active positions.
Funds
Returns balances for all available assets.
By connecting TradingView to DEFX Futures you can execute trades, close positions, cancel pending orders, or even check your balance — all directly from TradingView alerts. This makes your trading faster, automated, and emotion-free.
Set it up today and take full advantage of the DEFX Futures integration.