Strategies

Strategies are the core of 24Robot — they define how your trading bot behaves, including buy/sell settings, DCA, trailing options, and more. On this page, we'll dive into the different strategies endpoints you can use to manage strategies programmatically. We'll look at how to query, create, update, and delete strategies.

The strategy model

Properties

  • Name
    strategy_id
    Type
    int
    Description

    Unique identifier for the strategy.

  • Name
    name
    Type
    string
    Description

    Name of strategy (max 255 characters)

  • Name
    description
    Type
    string
    Description

    Short description of the strategy (max 500 characters)

  • Name
    active
    Type
    bool
    Description

    State of strategy.

  • Name
    public
    Type
    bool
    Description

    When public, other users will be able to use your strategy.

  • Name
    default_quote_currency
    Type
    string
    Description

    Base currency for trading (USDT, BTC, ETH, USD)

  • Name
    default_exchange_name
    Type
    string
    Description

    Default exchange name to use for trading bots (e.g., "Binance", "KuCoin")

  • Name
    maker_fee
    Type
    float
    Description

    Maker fee percentage (e.g., 0.1 for 0.1%)

  • Name
    taker_fee
    Type
    float
    Description

    Taker fee percentage (e.g., 0.1 for 0.1%)

  • Name
    buy_percentage
    Type
    float
    Description

    Percentage of balance to use for buying (0-100)

  • Name
    min_profit_percent
    Type
    float
    Description

    Minimum profit percentage before selling

  • Name
    dca_enabled
    Type
    bool
    Description

    Dollar Cost Averaging enabled

  • Name
    dca_after_time
    Type
    int
    Description

    Minutes to wait before DCA order

  • Name
    dca_max_retries
    Type
    int
    Description

    Maximum number of DCA orders

  • Name
    dca_percentage_trigger
    Type
    float
    Description

    Percentage drop to trigger DCA

  • Name
    dca_order_size
    Type
    float
    Description

    Size of DCA orders as percentage

  • Name
    buy_trailing_enabled
    Type
    bool
    Description

    Trailing buy enabled

  • Name
    buy_trailing_percent
    Type
    float
    Description

    Trailing buy percentage

  • Name
    sell_trailing_enabled
    Type
    bool
    Description

    Trailing sell enabled

  • Name
    sell_trailing_arm
    Type
    float
    Description

    Profit threshold to arm trailing sell

  • Name
    sell_trailing_percent
    Type
    float
    Description

    Trailing sell percentage

  • Name
    stop_loss_enabled
    Type
    bool
    Description

    Stop loss enabled

  • Name
    stop_loss_percent
    Type
    float
    Description

    Stop loss percentage

  • Name
    balance_takeprofit_enabled
    Type
    bool
    Description

    Balance take profit enabled

  • Name
    balance_takeprofit_trigger
    Type
    float
    Description

    Balance percentage to trigger take profit

  • Name
    balance_takeprofit_cooldown
    Type
    int
    Description

    Minutes to wait before next take profit

  • Name
    balance_stoploss_enabled
    Type
    bool
    Description

    Balance stop loss enabled

  • Name
    balance_stoploss_trigger
    Type
    float
    Description

    Balance percentage to trigger stop loss

  • Name
    balance_stoploss_cooldown
    Type
    int
    Description

    Minutes to wait before next stop loss

  • Name
    auto_close_position_enabled
    Type
    bool
    Description

    Auto close position enabled

  • Name
    auto_close_position_value
    Type
    int
    Description

    Minutes to hold position before auto close

  • Name
    signal_id
    Type
    int
    Description

    Associated signal ID (optional)

  • Name
    signal_ignores_sell_min_profit_percent
    Type
    bool
    Description

    Whether signal ignores minimum profit requirement

  • Name
    created_at
    Type
    timestamp
    Description

    Measured in seconds since the Unix epoch.

  • Name
    updated_at
    Type
    timestamp
    Description

    Measured in seconds since the Unix epoch.

  • Name
    performance
    Type
    object
    Description

    Real-time performance metrics calculated from completed trades

  • Name
    performance.summary
    Type
    object
    Description

    Performance summary containing all key metrics

  • Name
    performance.summary.period
    Type
    object
    Description

    Trading period information

  • Name
    performance.summary.period.start
    Type
    string
    Description

    Start date of the performance period (YYYY-MM-DD format)

  • Name
    performance.summary.period.end
    Type
    string
    Description

    End date of the performance period (YYYY-MM-DD format)

  • Name
    performance.summary.period.timezone
    Type
    string
    Description

    Timezone used for performance calculations (UTC)

  • Name
    performance.summary.starting_equity
    Type
    float
    Description

    Initial balance when the strategy started trading

  • Name
    performance.summary.ending_equity
    Type
    float
    Description

    Current balance of the strategy

  • Name
    performance.summary.net_pnl
    Type
    float
    Description

    Net profit/loss in quote currency (ending_equity - starting_equity)

  • Name
    performance.summary.roi_pct
    Type
    float
    Description

    Return on investment as percentage

  • Name
    performance.summary.max_drawdown_pct
    Type
    float
    Description

    Maximum drawdown percentage (negative value indicating largest loss from peak)

  • Name
    performance.summary.win_rate_pct
    Type
    float
    Description

    Percentage of profitable trades

  • Name
    performance.summary.profit_factor
    Type
    float
    Description

    Ratio of gross profit to gross loss (values >1 indicate profitability)

  • Name
    performance.summary.trade_count
    Type
    int
    Description

    Total number of completed trades

  • Name
    performance.summary.avg_trade
    Type
    float
    Description

    Average profit/loss per trade in quote currency

  • Name
    performance.summary.avg_hold_time_min
    Type
    int
    Description

    Average holding time per trade in minutes

  • Name
    performance.summary.best_trade
    Type
    float
    Description

    Largest single trade profit in quote currency

  • Name
    performance.summary.worst_trade
    Type
    float
    Description

    Largest single trade loss in quote currency (negative value)

  • Name
    performance.summary.fees_paid
    Type
    float
    Description

    Total trading fees paid across all trades (in quote currency)

  • Name
    performance.summary.volatility_pct
    Type
    float
    Description

    Standard deviation of daily returns as percentage


GET/v1/strategies

List all strategies

This endpoint allows you to retrieve a list of all your strategies. Max 2 requests per second.

Request

GET
/v1/strategies
curl -G https://api.24robot.com/v1/strategies \
-H "Authorization: Bearer {token}"

Response

{
    "data": [
        {
            "strategy_id": 1,
            "name": "Strategy name",
            "description": "Strategy description",
            "active": true,
            "public": false,
            "default_quote_currency": "USDT",
            "default_exchange_name": "Binance",
            "maker_fee": 0.1,
            "taker_fee": 0.1,
            "buy_percentage": 50.0,
            "min_profit_percent": 2.5,
            "exchanges": [
                {
                    "exchange_name": "Binance",
                    "coin_pairs": ["BTC/USDT", "ETH/USDT"]
                }
            ],
            "performance": {
                "summary": {
                    "period": { "start": "2025-08-01", "end": "2025-09-09", "timezone": "UTC" },
                    "starting_equity": 10000.0,
                    "ending_equity": 11240.55,
                    "net_pnl": 1240.55,
                    "roi_pct": 12.41,
                    "max_drawdown_pct": -7.8,
                    "win_rate_pct": 58.2,
                    "profit_factor": 1.63,
                    "trade_count": 256,
                    "avg_trade": 4.85,
                    "avg_hold_time_min": 320,
                    "best_trade": 142.10,
                    "worst_trade": -96.70,
                    "fees_paid": 84.22,
                    "volatility_pct": 2.9
                }
            },
            "created_at": 1686089970,
            "updated_at": 1686089971
        },
        {
            "strategy_id": 2
            // ...
        }
    ]
}

POST/v1/strategies

Create a strategy

This endpoint allows you to create a new strategy. Max 2 requests per second.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of strategy (max 255 characters)

  • Name
    description
    Type
    string
    Description

    Short description of the strategy (max 500 characters)

  • Name
    active
    Type
    bool
    Description

    State of strategy.

  • Name
    public
    Type
    bool
    Description

    When public, other users will be able to use your strategy.

  • Name
    default_quote_currency
    Type
    string
    Description

    Base currency for trading (USDT, BTC, ETH, USD)

  • Name
    default_exchange_name
    Type
    string
    Description

    Default exchange name to use for trading bots (e.g., "Binance", "KuCoin") (required)

  • Name
    buy_percentage
    Type
    float
    Description

    Percentage of balance to use for buying (0-100)

  • Name
    exchanges
    Type
    array
    Description

    Array of exchanges and their selected coin pairs for trading

  • Name
    exchanges[].exchange_name
    Type
    string
    Description

    Name of the exchange (must be one of: Binance, Gate.io, KuCoin, Kraken, OKX, Bybit, MEXC). Exchange must be active.

  • Name
    exchanges[].coin_pairs
    Type
    array
    Description

    Array of coin pairs to trade on this exchange (e.g., BTC/USDT, ETH/USDT). Each coin pair must be active, enabled for buying, and available on the selected exchange.

Optional attributes

  • Name
    maker_fee
    Type
    float
    Description

    Maker fee percentage (e.g., 0.1 for 0.1%). If not provided, exchange defaults will be used.

  • Name
    taker_fee
    Type
    float
    Description

    Taker fee percentage (e.g., 0.1 for 0.1%). If not provided, exchange defaults will be used.

  • Name
    strategy_trailing_buy_switch
    Type
    bool
    Description

    Enable trailing buy (requires trailing_buy_percentage)

  • Name
    trailing_buy_percentage
    Type
    float
    Description

    Trailing buy percentage (required when trailing buy enabled)

  • Name
    strategy_dca_switch
    Type
    bool
    Description

    Enable DCA (requires all DCA fields)

  • Name
    dca_aftertime
    Type
    int
    Description

    Minutes to wait before DCA order (required when DCA enabled)

  • Name
    dca_maxretries
    Type
    int
    Description

    Maximum number of DCA orders (required when DCA enabled)

  • Name
    dca_percentagetrigger
    Type
    float
    Description

    Percentage drop to trigger DCA (required when DCA enabled)

  • Name
    dca_ordersize
    Type
    float
    Description

    Size of DCA orders as percentage (required when DCA enabled)

  • Name
    sell_minprofitpercent
    Type
    float
    Description

    Minimum profit percentage before selling

  • Name
    trailing_sell
    Type
    bool
    Description

    Enable trailing sell (requires trailing_sell_arm and trailing_sell_percentage)

  • Name
    trailing_sell_arm
    Type
    float
    Description

    Profit threshold to arm trailing sell (required when trailing sell enabled)

  • Name
    trailing_sell_percentage
    Type
    float
    Description

    Trailing sell percentage (required when trailing sell enabled)

  • Name
    stop_loss
    Type
    bool
    Description

    Enable stop loss (requires stop_loss_percentage)

  • Name
    stop_loss_percentage
    Type
    float
    Description

    Stop loss percentage (required when stop loss enabled)

  • Name
    balance_take_profit
    Type
    bool
    Description

    Enable balance take profit (requires trigger and cooldown)

  • Name
    balance_take_profit_trigger
    Type
    float
    Description

    Balance percentage to trigger take profit (required when enabled)

  • Name
    balance_take_profit_cooldown
    Type
    int
    Description

    Minutes to wait before next take profit (required when enabled)

  • Name
    balance_stop_loss
    Type
    bool
    Description

    Enable balance stop loss (requires trigger and cooldown)

  • Name
    balance_stop_loss_trigger
    Type
    float
    Description

    Balance percentage to trigger stop loss (required when enabled)

  • Name
    balance_stop_loss_cooldown
    Type
    int
    Description

    Minutes to wait before next stop loss (required when enabled)

  • Name
    auto_close_position_enabled
    Type
    bool
    Description

    Enable auto close position

  • Name
    auto_close_position_value
    Type
    int
    Description

    Minutes to hold position before auto close

  • Name
    signal_id
    Type
    int
    Description

    Associated signal ID (must be active and accessible)

  • Name
    signal_ignores_sell_min_profit_percent
    Type
    bool
    Description

    Whether signal ignores minimum profit requirement

Request

POST
/v1/strategies
curl https://api.24robot.com/v1/strategies \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
    "name": "My Trading Strategy",
    "description": "A conservative USDT strategy",
    "active": true,
    "public": false,
    "default_quote_currency": "USDT",
    "default_exchange_name": "Binance",
    "maker_fee": 0.1,
    "taker_fee": 0.1,
    "buy_percentage": 25.0,
    "sell_minprofitpercent": 2.5,
    "exchanges": [
        {
            "exchange_name": "Binance",
            "coin_pairs": ["BTC/USDT", "ETH/USDT", "ADA/USDT"]
        }
    ]
}'

Response

{
    "strategy_id": 1,
    "name": "My Trading Strategy",
    "description": "A conservative USDT strategy",
    "active": true,
    "public": false,
    "default_quote_currency": "USDT",
    "default_exchange_name": "Binance",
    "maker_fee": 0.1,
    "taker_fee": 0.1,
    "buy_percentage": 25.0,
    "min_profit_percent": 2.5,
    "exchanges": [
        {
            "exchange_name": "Binance",
            "coin_pairs": ["BTC/USDT", "ETH/USDT", "ADA/USDT"]
        }
    ],
    "performance": {
        "summary": {
            "period": { "start": "2025-08-01", "end": "2025-09-09", "timezone": "UTC" },
            "starting_equity": 10000.0,
            "ending_equity": 10325.75,
            "net_pnl": 325.75,
            "roi_pct": 3.26,
            "max_drawdown_pct": -2.1,
            "win_rate_pct": 65.0,
            "profit_factor": 1.42,
            "trade_count": 12,
            "avg_trade": 27.15,
            "avg_hold_time_min": 180,
            "best_trade": 95.30,
            "worst_trade": -45.20,
            "fees_paid": 15.75,
            "volatility_pct": 1.8
        }
    },
    "created_at": 1686089970,
    "updated_at": 1686089971
}

GET/v1/strategies/:id

Retrieve a strategy

This endpoint allows you to retrieve a strategy by providing the strategy id. Refer to the list at the top of this page to see which properties are included with strategy objects. Max 2 requests per second.

Request

GET
/v1/strategies/1
curl https://api.24robot.com/v1/strategies/1 \
-H "Authorization: Bearer {token}"

Response

{
    "strategy_id": 1,
    "name": "My Trading Strategy",
    "description": "A conservative USDT strategy",
    "active": true,
    "public": false,
    "default_quote_currency": "USDT",
    "buy_percentage": 25.0,
    "dca_enabled": false,
    "dca_after_time": null,
    "dca_max_retries": null,
    "dca_percentage_trigger": null,
    "dca_order_size": null,
    "balance_takeprofit_enabled": false,
    "balance_takeprofit_trigger": null,
    "balance_takeprofit_cooldown": null,
    "balance_stoploss_enabled": false,
    "balance_stoploss_trigger": null,
    "balance_stoploss_cooldown": null,
    "buy_trailing_enabled": false,
    "buy_trailing_percent": null,
    "sell_trailing_enabled": false,
    "sell_trailing_arm": null,
    "sell_trailing_percent": null,
    "min_profit_percent": 2.5,
    "stop_loss_enabled": false,
    "stop_loss_percent": null,
    "auto_close_position_enabled": false,
    "auto_close_position_value": null,
    "signal_ignores_sell_min_profit_percent": false,
    "signal_id": null,
    "exchanges": [
        {
            "exchange_name": "Binance",
            "coin_pairs": ["BTC/USDT", "ETH/USDT", "ADA/USDT"]
        }
    ],
    "performance": {
        "summary": {
            "period": { "start": "2025-08-01", "end": "2025-09-09", "timezone": "UTC" },
            "starting_equity": 1000.0,
            "ending_equity": 1156.40,
            "net_pnl": 156.40,
            "roi_pct": 15.64,
            "max_drawdown_pct": -5.2,
            "win_rate_pct": 72.5,
            "profit_factor": 1.89,
            "trade_count": 40,
            "avg_trade": 3.91,
            "avg_hold_time_min": 245,
            "best_trade": 28.50,
            "worst_trade": -18.75,
            "fees_paid": 8.20,
            "volatility_pct": 2.1
        }
    },
    "created_at": 1686089970,
    "updated_at": 1686089971
}

PUT/v1/strategies/:id

Update a strategy

This endpoint allows you to perform an update on a strategy. All validation rules from creation apply. Max 2 requests per second.

Optional attributes

  • Name
    name
    Type
    string
    Description

    Name of strategy (max 255 characters)

  • Name
    description
    Type
    string
    Description

    Short description of the strategy (max 500 characters)

  • Name
    active
    Type
    bool
    Description

    State of strategy.

  • Name
    public
    Type
    bool
    Description

    When public, other users will be able to use your strategy.

  • Name
    default_quote_currency
    Type
    string
    Description

    Base currency for trading (USDT, BTC, ETH, USD)

  • Name
    default_exchange_name
    Type
    string
    Description

    Default exchange name to use for trading bots (e.g., "Binance", "KuCoin")

  • Name
    maker_fee
    Type
    float
    Description

    Maker fee percentage (e.g., 0.1 for 0.1%)

  • Name
    taker_fee
    Type
    float
    Description

    Taker fee percentage (e.g., 0.1 for 0.1%)

  • Name
    buy_percentage
    Type
    float
    Description

    Percentage of balance to use for buying (0-100)

  • Name
    strategy_trailing_buy_switch
    Type
    bool
    Description

    Enable trailing buy (requires trailing_buy_percentage)

  • Name
    trailing_buy_percentage
    Type
    float
    Description

    Trailing buy percentage (required when trailing buy enabled)

  • Name
    strategy_dca_switch
    Type
    bool
    Description

    Enable DCA (requires all DCA fields when enabled)

  • Name
    dca_aftertime
    Type
    int
    Description

    Minutes to wait before DCA order

  • Name
    dca_maxretries
    Type
    int
    Description

    Maximum number of DCA orders

  • Name
    dca_percentagetrigger
    Type
    float
    Description

    Percentage drop to trigger DCA

  • Name
    dca_ordersize
    Type
    float
    Description

    Size of DCA orders as percentage

  • Name
    sell_minprofitpercent
    Type
    float
    Description

    Minimum profit percentage before selling

  • Name
    trailing_sell
    Type
    bool
    Description

    Enable trailing sell (requires arm and percentage when enabled)

  • Name
    trailing_sell_arm
    Type
    float
    Description

    Profit threshold to arm trailing sell

  • Name
    trailing_sell_percentage
    Type
    float
    Description

    Trailing sell percentage

  • Name
    stop_loss
    Type
    bool
    Description

    Enable stop loss (requires percentage when enabled)

  • Name
    stop_loss_percentage
    Type
    float
    Description

    Stop loss percentage

  • Name
    balance_take_profit
    Type
    bool
    Description

    Enable balance take profit (requires trigger and cooldown when enabled)

  • Name
    balance_take_profit_trigger
    Type
    float
    Description

    Balance percentage to trigger take profit

  • Name
    balance_take_profit_cooldown
    Type
    int
    Description

    Minutes to wait before next take profit

  • Name
    balance_stop_loss
    Type
    bool
    Description

    Enable balance stop loss (requires trigger and cooldown when enabled)

  • Name
    balance_stop_loss_trigger
    Type
    float
    Description

    Balance percentage to trigger stop loss

  • Name
    balance_stop_loss_cooldown
    Type
    int
    Description

    Minutes to wait before next stop loss

  • Name
    auto_close_position_enabled
    Type
    bool
    Description

    Enable auto close position

  • Name
    auto_close_position_value
    Type
    int
    Description

    Minutes to hold position before auto close

  • Name
    signal_id
    Type
    int
    Description

    Associated signal ID (must be active and accessible)

  • Name
    signal_ignores_sell_min_profit_percent
    Type
    bool
    Description

    Whether signal ignores minimum profit requirement

  • Name
    exchanges
    Type
    array
    Description

    Array of exchanges and their selected coin pairs for trading (replaces all existing coins when provided)

  • Name
    exchanges[].exchange_name
    Type
    string
    Description

    Name of the exchange (must be one of: Binance, Gate.io, KuCoin, Kraken, OKX, Bybit, MEXC). Exchange must be active.

  • Name
    exchanges[].coin_pairs
    Type
    array
    Description

    Array of coin pairs to trade on this exchange (e.g., BTC/USDT, ETH/USDT). Each coin pair must be active, enabled for buying, and available on the selected exchange.

Request

PUT
/v1/strategies/1
curl -X PUT https://api.24robot.com/v1/strategies/1 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
    "buy_percentage": 30.0,
    "active": false,
    "exchanges": [
        {
            "exchange_name": "KuCoin",
            "coin_pairs": ["DOT/USDT", "LINK/USDT", "UNI/USDT"]
        }
    ]
}'

Response

{
    "strategy_id": 1,
    "name": "My Trading Strategy",
    "description": "A conservative USDT strategy",
    "active": false,
    "public": false,
    "default_quote_currency": "USDT",
    "buy_percentage": 30.0,
    "min_profit_percent": 2.5,
    "exchanges": [
        {
            "exchange_name": "KuCoin",
            "coin_pairs": ["DOT/USDT", "LINK/USDT", "UNI/USDT"]
        }
    ],
    "performance": {
        "summary": {
            "period": { "start": "2025-08-01", "end": "2025-09-09", "timezone": "UTC" },
            "starting_equity": 1000.0,
            "ending_equity": 1156.40,
            "net_pnl": 156.40,
            "roi_pct": 15.64,
            "max_drawdown_pct": -5.2,
            "win_rate_pct": 72.5,
            "profit_factor": 1.89,
            "trade_count": 42,
            "avg_trade": 3.72,
            "avg_hold_time_min": 245,
            "best_trade": 28.50,
            "worst_trade": -18.75,
            "fees_paid": 8.45,
            "volatility_pct": 2.1
        }
    },
    "created_at": 1686089970,
    "updated_at": 1686089975
}

DELETE/v1/strategies/:id

Delete a strategy

This endpoint allows you to delete your strategy in 24Robot. Note: This will permanently delete the strategy, associated trading bot, and strategy coins. Max 2 requests per second.

Request

DELETE
/v1/strategies/1
curl -X DELETE https://api.24robot.com/v1/strategies/1 \
-H "Authorization: Bearer {token}"

Response

{
    "type": "success",
    "message": "Strategy deleted successfully"
}

Was this page helpful?