Skip to content

Get Trades By Filter

MngGetTradesByFilter

Description: Returns a filtered list of trades for managers. Supports pagination, tradeType, optional where/whereNot, and optional orderBy sorting.

Request Parameters

Name Type Required Description
groupFilter string Yes Group mask to filter trades
limit int Yes Max number of records to return
offset int Yes Number of records to skip
tradeType int Yes Trade type filter in range 0..4
where array No Additional conditions for filtering trades
whereNot array No Exclusion conditions for filtering trades
whereIn array No Inclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereNotIn array No Exclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereBetween array No Range filter rules in [[field, [from, to]], ...] format
whereNotBetween array No Negative range filter rules in [[field, [from, to]], ...] format
orderBy array No Sort instructions

net_profit can be used in where, whereNot, whereIn, whereNotIn, range filters, and orderBy as a calculated field. It is calculated as profit + commission + storage.

Trade Types

  • 0 = all trades
  • 1 = open trades
  • 2 = closed trades
  • 3 = pending trades
  • 4 = finance trades

Request Example

{
  "groupFilter": "*",
  "limit": 100,
  "offset": 0,
  "tradeType": 1,
  "where": [],
  "whereNot": [],
  "orderBy": [["open_time", "desc"]]
}

Response Parameters

Name Type Description
structure array List of trade fields in the result
rows array List of trades
count int Total number of trades matched
total_profit double Cumulative profit
total_net_profit double Cumulative net profit: profit + commission + storage
total_storage double Cumulative storage
total_commission double Cumulative commission
total_volume int Cumulative volume

The default structure includes net_profit after profit.