SmartTrade
The SmartTrade allows users to open, manage, and close orders on the exchange with predefined conditions.
3Commas provides a set of methods to create and manage SmartTrade entities and their associated trade entities.
A SmartTrade entity holds information, including:
Exchange account and trading pair;
Position data;
Conditions for Take Profit and Stop Loss;
Conditions for closing at market;
Conditions for reducing funds.
The process starts with a SmartTrade entity, where all conditions are configured. SmartTrade then manages trades, which are automatically created by 3Commas based on the conditions set within the SmartTrade entity.
SmartTrade can include the following trade types:
Position trade;
Take profit trade;
Stop-loss trade;
Reduce funds trade;
Market close trade.
Attributes
id integer
Unique 3Commas ID for this SmartTrade entity
account object
Details about user account
id integer
Unique 3Commas ID for this exchange account entity
type string
Exchange types where this SmartTrade was created
name string
Name of this exchange account
market string
[TBD]
link string
The URL of the account where this SmartTrade was created
pair string Trading pair in 3Commas format
instant `boolean` [TBD]
status object
The common status and information about this status for this SmartTrade entity
basic_type string
3Commas status for this SmartTrade
title string
Brief description of this status
error string
Description of the error for this SmartTrade if it fails
leverage object
Details of the leverage for this SmartTrade
enabled boolean
Information about this leverage for a futures account
false
if editing is not available
type string
Shows the leverage type that was set when creating a SmartTrade on a futures account
value number
Shows the leverage value that was set when creating a SmartTrade on a futures account
type_editable boolean
Indicates whether the user can modify the leverage[type]
settings when editing SmartTrade.
true
means editing is allowed
position object
Details of the Position applied to this SmartTrade
type string
The side of the order to be created by this trade
editable boolean
Indicates whether the user can modify the settings of position when editing SmartTrade.
true
if editing is available
units Details of Units
value string
Amount of units for position trade
editable boolean
Indicates whether the user can modify the value of the unit parameter when editing SmartTrade
price object
Details of price
value number
The price of the position order, including commission
value_without_commission number
The price of the position order, excluding commission
editable boolean
Indicates whether the user can modify the group of price settings parameters when editing SmartTrade
total number
The total value of the position, including all relevant factors such as price and quantity
order_type string
The type of order used to open the position (e.g., `market`, `limit`, `conditional`)
conditional object
[TBD]
editable boolean
Indicates whether the user can modify the settings of conditional of position when editing SmartTrade
price object
[TBD]
value number
The specific price value set for the conditional order trigger
type string
The type of price for the conditional order used to open the position
order_type string
The type of conditional order used to open the position
(e.g., market
, limit
, conditional
)
trailing object
[TBD]
editable boolean
Indicates whether the trailing stop settings for the conditional order can be edited
percent number
The trailing stop percentage for the conditional order, specifying the distance from the market price at which the trailing stop is triggered
take_profit object
Details of the Take Profit and its steps applied to this SmartTrade
enabled boolean
Indicates whether the take profit settings for this SmartTrade can be edited
price_type string
The price type for the take profit trade(s) that was set when creating the SmartTrade.
Can be either value
or percentage
steps array
Detailed conditions for each step of the Take Profit
id integer
Unique 3Commas trade ID for this SmartTrade entity
order_type string
The type of order for this trade's take profit
editable boolean
Indicates whether the step of take profit settings for this SmartTrade can be edited
units[value] number
Amount of units for this trade
price object
Details of the price applied for one step of Take Profit
type integer
The type of price for the take profit order used to open the position
value number
The specific price value set to trigger the take profit order
percent number
The specific percentage of the price set to trigger this take profit trade
trailing object
Details of the trailing applied for one step of Take Profit
editable boolean
Indicates whether the trailing settings for the take profit in this SmartTrade can be edited
percent number
The specific trailing percentage applied to the price for this take profit trade
status object
Status of this the step of Take Profit. Set automatically by 3Commas
basic_type string
3Commas status for this take profit trade
title string
Brief description of this status for this trade
error string
Error description for this take profit trade if it fails
data object
Available actions for one step Take Profit
cancelable integer
Indicates whether the take profit trade can be canceled
panic_sell_available boolean
Indicates whether the one step of Take Profit can be closed at market based on its current status
position string
Indicates the position of this take profit step for this SmartTrade
stop_loss object
Details of the Stop Loss applied to this SmartTrade
enabled boolean
Indicates whether the stop loss settings for this SmartTrade can be edited
price_type string
The price type for the stop loss trade(s) that was set when creating the SmartTrade.
Can be either value
or percentage
breakeven boolean
Indicates whether the stop loss has been set at the breakeven point
order_type string
The type of order for this trade's stop loss
editable boolean
Indicates whether the stop loss settings for this SmartTrade can be edited
status object
Status of this the step of Stop Loss. Set automatically by 3Commas
basic_type string
3Commas status for this stop loss trade
title string
Brief description of this status for this trade
error string
Error description for this stop loss trade if it fails
units object
[TBD]
value number
The specific price value set for the stope loss order trigger
total object
[TBD]
value number
The total value of the stop loss trade
price object
[TBD]
value number
[TBD]
conditional object
[TBD]
price object
Details of the price applied the Stop Loss
type string
The type of price for the stop loss order used to close the position
value number
The specific price value set to trigger the Stop Loss order
percent number
The specific percentage of the price set to trigger this Stop Loss trade
trailing object
Details of the trailing applied for one step of Stop Loss
editable boolean
Indicates whether trailing is enabled for the conditional stop loss
percent number
The trailing percentage for the conditional stop loss
timeout object
TBD
enabled boolean
Indicates whether the timeout setting for the stop loss is enabled
value integer
The value of the timeout setting for the stop loss trade
reduce_funds array
Details of the Reduce Funds applied to this SmartTrade
steps array
[TBD]
id integer
Unique 3Commas trade ID for this market close trade in the SmartTrade
type string
The order type for this reduce funds trade
status object
Detailed information about the status and any errors for a single Reduce Funds step
basic_type string
3Commas status for this Reduce funds trade
title string
Brief description of this status for this trade
error string
Error description for this reduce funds trade if it fails
units object
[TBD]
value number
Amount of units for this reduce funds trade
price object
[TBD]
value number
The price of the reduce funds trade, including the commission
value_without_commission number
The price of the reduce funds trade, excluding commission
total object
[TBD]
value integer
The total value of the reduce funds trade, including all relevant factors such as price
and quantity
data object
Available actions for a single Reduce Funds step
cancelable boolean
Indicates whether the reduce funds trade can be canceled
panic_sell_available boolean
Indicates whether a drawdown transaction can be closed at market
market_close object
Details of the Market Close applied to this SmartTrade
id integer
Unique 3Commas trade ID for this market close trade in the SmartTrade
typeinteger
The type of order for this trade's market close
statusobject
Detailed information about the status and any errors for this Market Clode
basic_type string
The status type of the market close trade for this SmartTrade
title string
3Commas status for this market close trade
error string
Error description for this market close trade if it fails
units
value number
Amount of units for position trade
price
value number
The price of the market close trade, including commission
value_without_commission number
The price of the market close trade, excluding commission
total object
[TBD]
value number
Indicates whether the reduce funds trade can be closed at market
note string
Optional user-defined note for this SmartTrade
note_raw string
[TBD]
skip_enter_step boolean
Shows whether the position opening step was skipped
note string
Optional user-defined note for this SmartTrade
note_raw string
[TBD]
skip_enter_step boolean
Shows whether the position opening step was skipped
data object
Available actions applicable to the entire SmartTrade entity
editable boolean
Indicates whether the user can modify the settings of this SmartTrade.
true
if editing is available
current_price object
[TBD]
bid number
The current highest bid price of the asset
ask number
The current lowest ask price of the asset
last number
The last traded price of the asset
quote_volume number
[TBD]
day_change_percent number
Percentage price change for the asset over the last 24 hours
target_price_type string
[TBD]
orderbook_price_currency string
[TBD]
base_order_finished boolean
[TBD]
missing_funds_to_close number
[TBD]
liquidation_price number
The liquidation price of the asset on the futures exchange
average_enter_price number
The average entering price of the asset with fees
average_close_price number
The average closing price of the asset with fees
average_enter_price_without_commission number
The average entering price of the asset without accounting for any fees
average_close_price_without_commission number
The average closing price of the asset without accounting for any fees
panic_sell_available boolean
Indicates whether the SmartTrade can be closed at market based on its current status
add_funds_available boolean
Indicates whether adding funds is available for this SmartTrade based on its current status
reduce_funds_available boolean
Indicates whether reducing funds is available for this SmartTrade based on its current status
force_start_available boolean
Indicates whether the option to force a market entry for the SmartTrade is available based on its current status
force_process_available boolean
Indicates whether the SmartTrade can be force processed
cancel_available boolean
Indicates whether the SmartTrade can be canceled
finished boolean
Indicates whether the SmartTrade has been completed or finished.
true
means SmartTrade finished
base_position_step_finished boolean
Shows whether entry into the position has been completed.
true
means the entry process is finished
entered_amount number
The total amount of funds used to enter the position for this SmartTrade,
including all additional funds trades, specified in base
entered_total number
Total amount of funds used to enter the position for this SmartTrade, specified in quote
closed_amount number
Total amount of SmartTrade closing volume in base
closed_total number
Total amount of SmartTrade closing volume in quote
commission number
The trading fee of exchange for transaction
created_at string <date-time>
ISO 8601 datetime string of when this SmartTrade entity was created
updated_at string <date-time>
or null
ISO 8601 datetime string of when this SmartTrade entity was updated
type string
Type of SmartTrade
profit object
Detailed information about the profit received on this SmartTrade
volume number
The total profit volume generated by this SmartTrade in quote
usd number
The total profit volume generated by this SmartTrade in USD
percent number
The total profit volume generated by this SmartTrade in percent
roe number
or null
The return on equity (ROE) for this SmartTrade's profit, applicable only for futures accounts
margin object
Detailed information about the margin for this SmartTrade
amount number
or null
The total margin amount required for this SmartTrade (base)
total number
or null
The total margin value for this SmartTrade (quote)
is_position_not_filled boolean
Indicates whether a position has been successfully entered for this SmartTrade
Last updated
Was this helpful?