Skip to main content

UpsertDcaBot (REST)


Complete DCABot settings. Edit uses the same full upsert payload as create. Exactly one take-profit target with a positive priceDeviation is required. Indicator, entry order, and other exit fields depend on the selected modes.

namestringrequired

Name shown in the cabinet.

Example: My DCA Bot
exchangeCodestringrequired

Enabled exchange code.

Example: BINANCE
pairsCodesstring[]required

Trading pair codes on the selected exchange.

Possible values: >= 1

Example: ["BTCUSDT"]
profilesCodesstring[]required

API profile codes for the selected exchange.

Possible values: >= 1

Example: ["my-profile-code"]
dcaTradingTypestringrequired

Trade long, short or both directions.

Possible values: [long, short, both]

amountPerTradenumberrequired

Amount used for each entry order, in amountPerTradeType units.

Possible values: > 0

amountPerTradeTypestring

Unit of amountPerTrade. Spot: ref, base, $, percents. Derivative: contracts, base, $, percents. Legacy ref is the conventional base asset (BTC in BTC/USDT); base is the conventional quote asset (USDT).

Possible values: [base, ref, $, contracts, percents]

amountPerTradeMultipliernumber | nullnullable

Order amount multiplier on derivative exchanges.

Possible values: >= 1 and <= 125

orderTypestring

Entry order type.

Possible values: [market, best_bid_ask_limit]

orderTypeSettings objectnull

Settings for best_bid_ask_limit entry orders.

postOnlyboolean

Place the limit order without taking existing liquidity.

maxAttemptsinteger

Maximum attempts to place a conditional limit order.

Possible values: >= 1 and <= 5

afterMaxAttemptsReachedstring

Cancel or use a market order after the last attempt.

Possible values: [cancel, market]

maxChaseDistancenumber | nullnullable

Maximum price drift to chase for a limit order, as a fraction (5% = 0.05).

Possible values: >= 0.0001 and <= 0.05

entrySignalConditionstring

immediate starts without an indicator; indicator requires one to five distinct indicators. immediate cannot be combined with dcaTradingType both.

Possible values: [immediate, indicator]

indicators object[]

Required for indicator entry: one to five distinct types. In advanced mode, RSI needs period and rsiValue; MACD needs fastPeriod, slowPeriod and signalPeriod; BB needs period and stdDev. price_change always needs priceDeviation. Long/Short also need the type's condition and, for MACD/BB, trigger; with advancedIndicators=false the server supplies RSI/MACD/BB defaults. Both directions require condition and trigger to be null. timeframe defaults to 15 minutes.

Possible values: >= 1, <= 5

  • Array [
  • typestringrequired

    rsi, macd, bb, or price_change. Choose the matching settings below; price_change requires priceDeviation even with advancedIndicators false.

    Possible values: [rsi, macd, bb, price_change]

    timeframeinteger

    Candle timeframe in minutes; defaults to 15 when omitted. The default server supports 1, 15 and 60 minutes. Deployments can override TIMEFRAMES; the cabinet timeframe selector uses the server's current list, and other values fail validation.

    conditionstring | nullnullable

    For Long or Short, RSI and BB use less_than, greater_than, crossing_down, or crossing_up; MACD uses crossing_down or crossing_up. For both directions, leave null. price_change does not use this field.

    Possible values: [less_than, greater_than, crossing_down, crossing_up, null]

    triggerstring | nullnullable

    For Long or Short, MACD uses greater_0 or less_0 and BB uses upper or lower. For both directions, leave null. RSI and price_change do not use this field.

    Possible values: [upper, lower, greater_0, less_0, null]

    periodinteger

    RSI or Bollinger Bands period.

    Possible values: >= 1 and <= 100

    rsiValuenumber

    RSI threshold for the entry signal.

    Possible values: >= 0.01 and <= 100

    rsiOppositeValuenumber | nullnullable

    RSI threshold for the opposite trading direction.

    Possible values: >= 0.01 and <= 100

    fastPeriodinteger

    Fast moving-average period for MACD.

    Possible values: >= 1 and <= 100

    slowPeriodinteger

    Slow moving-average period for MACD.

    Possible values: >= 1 and <= 100

    signalPeriodinteger

    Signal-line period for MACD.

    Possible values: >= 1 and <= 100

    stdDevnumber

    Standard-deviation multiplier for Bollinger Bands.

    Possible values: >= 1 and <= 100

    priceDeviationnumber

    Price-change fraction.

    Possible values: >= 0.005 and <= 0.1

  • ]
  • advancedIndicatorsboolean

    true uses supplied RSI/MACD/BB periods, thresholds, conditions and triggers; false applies server defaults. price_change.priceDeviation is always required.

    Default value: false
    extraOrderCountintegerrequired

    Maximum entry orders including the initial entry; 5 permits the entry and four extra orders.

    Possible values: >= 1 and <= 30

    extraOrderDeviationnumberrequired

    Price spacing before an extra order, as a fraction (0.8% = 0.008). Long orders follow falling prices; Short orders follow rising prices.

    Possible values: >= 0.001 and <= 0.2

    extraOrderVolumeMultipliernumberrequired

    Scales successive extra-order sizes. The first extra order receives it in Order Averaging mode; Position Averaging starts with the initial size.

    Possible values: >= 0.1 and <= 10

    extraOrderDeviationMultipliernumberrequired

    Scales successive extra-order price spacing. Order Averaging applies it to the first extra order; Position Averaging starts with unmultiplied spacing.

    Possible values: >= 0.1 and <= 10

    extraOrderCostAveragingstring | nullnullable

    Conventional asset used as the amount reference: base keeps the traded-asset quantity (BTC in BTC/USDT); quote keeps its cost (USDT). Exchange rules round final orders.

    Possible values: [base, quote, null]

    extraOrderTypestring | nullnullable

    market waits until price crosses the calculated level, then submits at the current price; limit places a resting order at that level, including the first extra order immediately after entry.

    Possible values: [market, limit, null]

    applyDcaForFirstSafetyOrderboolean

    UI DCA mode: true = Order Averaging, applying size and spacing multipliers to the first extra order; false = Position Averaging, starting that order with the initial size and unmultiplied spacing.

    Default value: false
    takeProfits object[]required

    Exactly one take-profit target is required. priceDeviation is a price fraction (2% = 0.02); portfolio must be 1, meaning the whole position.

    Possible values: >= 1, <= 1

  • Array [
  • priceDeviationnumberrequired

    Target price change from the reference price, as a fraction.

    Possible values: > 0

    portfolionumberrequired

    Share of the position to close at this target, as a fraction.

    Possible values: [1]

  • ]
  • takeProfitBaseOnstring

    Price used as the base for take-profit targets.

    Possible values: [entry_order, average_price]

    Default value: average_price
    takeProfitOrderTypestring

    Order type used to take profit.

    Possible values: [market, best_bid_ask_limit]

    takeProfitOrderTypeSettings objectnull

    Settings for best_bid_ask_limit take-profit orders.

    postOnlyboolean

    Place the take-profit limit order without taking existing liquidity.

    stopLossnumber | nullnullable

    Price loss that triggers stop loss, as a fraction (2% = 0.02).

    Possible values: > 0

    stopLossBaseOnstring

    Price used as the base for stop loss.

    Possible values: [entry_order, average_price]

    Default value: entry_order
    stopLossOrderTypestring

    Order type used to execute stop loss.

    Possible values: [market, best_bid_ask_limit]

    stopLossOrderTypeSettings objectnull

    Settings for best_bid_ask_limit stop-loss orders.

    postOnlyboolean

    Place the stop-loss limit order without taking existing liquidity.

    stopLossMovenumber | nullnullable

    Favorable price move from entry that triggers a one-time stop-loss update when monitored: Long rises, Short falls. Send a fraction (2% = 0.02).

    Possible values: > 0

    stopLossMoveExecutenumber | nullnullable

    New stop-loss price relative to entry: Long adds this fraction, Short subtracts it. If omitted, move to current average entry price; when set, it must be below stopLossMove.

    trailingStopActivationnumber | nullnullable

    Favorable price move that activates trailing stop, as a fraction (2% = 0.02).

    Possible values: > 0

    trailingStopExecutenumber | nullnullable

    Trailing-stop price distance after activation, as a fraction (2% = 0.02).

    Possible values: > 0

    priceDeviationnumber | nullnullable

    Limit-entry price distance from the last price, as a fraction.

    Possible values: > 0

    maxOpenPositionsinteger | nullnullable

    Maximum positions this bot may keep open at once.

    Possible values: >= 1

    leveragenumber | nullnullable

    Leverage configured for the bot.

    Possible values: >= 1 and <= 125

    exchangeLeveragenumber | nullnullable

    Leverage setting applied on the exchange.

    Possible values: >= 1 and <= 125

    maxRequiredAmountstring | nullnullable

    Client-side required-amount estimate stored with the bot.




    UpsertDcaBot — REST API
    {
    "name": "My DCA Bot",
    "exchangeCode": "BINANCE",
    "pairsCodes": [
    "BTCUSDT"
    ],
    "profilesCodes": [
    "my-profile-code"
    ],
    "dcaTradingType": "long",
    "amountPerTrade": 20,
    "amountPerTradeType": "base",
    "orderType": "market",
    "entrySignalCondition": "immediate",
    "applyDcaForFirstSafetyOrder": false,
    "extraOrderCount": 20,
    "extraOrderDeviation": 0.008,
    "extraOrderVolumeMultiplier": 1,
    "extraOrderDeviationMultiplier": 1.2,
    "extraOrderCostAveraging": "base",
    "takeProfits": [
    {
    "priceDeviation": 0.02,
    "portfolio": 1
    }
    ],
    "leverage": 1,
    "advancedIndicators": false
    }