Skip to content
Sign In

Command Syntax Reference

Complete guide to Flipr.Cloud webhook commands

Webhook Structure

Start the message with a symbol and the exact label of one of your saved API keys. Place commands and comments after that header:

Smart Syntax
SYMBOL on ApiKeyLabel
// Basic structure
command1 parameters
command2 parameters
// Comments start with //

Example:

Smart Syntax
BTCUSDT on My_API_Key
// Buy Bitcoin using 50% of USDT balance at current market price
market long 50%
// Create SL at -2% and TP at +5% orders for full position with OCO
sl-or-tp short 100%p sl off 2% tp off 5%

In sl-or-tp, the side is optional when a preceding market command identifies the position, or when the exchange reports a single open position. With both long and short open in hedge mode and no preceding market command, select the position to protect; see SL-or-TP: closing side and supported exchanges.

One Header, Multiple API Keys

Separate saved key labels with commas. Commands are repeated for each key; each account supplies its own balance, available funds and position. Execution is not atomic or guaranteed simultaneous.

Smart Syntax
BTCUSDT on Key_A, Key_B
// Read each account separately
balance

Multiple Blocks

A new header starts another block. Key_A and Key_B below stand for your saved labels, not arbitrary exchange names. Keep explanatory comments on their own lines after a header.

Smart Syntax
BTCUSDT on Key_A
balance

ETHUSDT on Key_B
balance

Key Concepts

Amount Formats

  • 0.5

    - Exact quantity

  • 50%

    - Percentage of total balance

  • 50%%

    - Percentage of available (free) balance

  • 50%p

    - Percentage of position

  • 2%r

    - Risk budget from total USDT balance and the inline stop distance

%r requires a market entry with inline SL on Bybit or WEEX USDT linear futures. It is an estimated loss budget, distinct from a balance percentage or a TP risk/reward ratio. See Market: risk sizing and restrictions.

Balance Percentages and Multipliers

Balance percentages are converted into quantity using the reference price. For a USDT market with total balance 1000, available 400 and price 100, 50% gives 5 units and 50%% gives 2. This is position value, not the margin committed. Exchange quantity rules still apply.

3*50% multiplies the calculated quantity by 3. lev*10% uses the leverage set earlier in the same block; setting leverage alone does not multiply quantity.

Smart Syntax
BTCUSDT on My_API_Key
set leverage 10
market long lev*10%

Exchange Settings explains leverage and set hedge on. Position-mode changes depend on the exchange; check its supported modes first.

Offset Formats

  • off 50

    - 50 quote-currency units from the reference (auto-direction)

  • off 2%

    - 2% from reference (auto-direction)

  • at 50000

    - Exact price of 50000 in the symbol’s quote currency

  • @ 50000

    - Same absolute price as at 50000

The reference depends on the command: a plain limit offset uses current price; the second stop-limit offset uses its trigger price. Protection commands can use an entry reference. Follow the relevant guide before choosing an offset.

Entry-Relative Offsets

For inline market SL/TP, keep the required price prefix before an entry-relative value:

  • sl off e2%

    - SL 2% from entry: below for long, above for short

  • tp at e+3%

    - TP explicitly 3% above entry, regardless of side

  • sl @e-1.5%

    - SL explicitly 1.5% below entry, regardless of side

e selects the entry reference; it does not replace off, at or @. With an explicit + or − sign, choose a price appropriate for your position side. These are inline parameters, not standalone commands; see the Market guide for complete examples. Entry-relative stops are not supported with %r.

Risk/Reward Notation

Set take profit based on stop loss risk:

  • rr3

    - TP at 3x the SL distance (3:1 R/R)

  • rr2.5

    - TP at 2.5x the SL distance (2.5:1 R/R)

Position Targeting

Use pos to reach a target at market for the current block’s symbol and key. These are alternative targets, not a trading sequence:

Smart Syntax
// Close position
pos 0
// Target 1 BTC long
pos 1
// Target 1 BTC short
pos -1
// Target 50% balance
pos 50%

For pos 50%p, the target is long at half the current position size; pos -50%p targets short. The sign chooses the desired direction. It does not always flip the position. See Position and close commands.

Protection quantity has its own context: an omitted inline SL/TP amount follows the entry quantity, while explicit 100%p refers to the position on futures. See Market protection amounts for the supported paths and spot differences.

Core Trading Commands

Order Management

Utility Commands

Common Trading Patterns

Real-world strategy examples and best practices

Important Notes

  • Test First: Use Bybit Demo Trading, or the Demo/Testnet environment supported by your other exchange. Create matching credentials and select the simulated environment in API Keys. Bybit Testnet keys cannot be used for Demo.
  • Set Stop Losses: Protect your capital with proper risk management
  • Check Logs: Review execution history to verify commands
  • Understand Leverage: High leverage = high risk
  • Use Tags: On supported order commands, #ladder labels an order; // starts a comment on its own line. For example, limit long 0.01 off 2% #ladder can later be selected with cancel #ladder for the same symbol and key.