Skip to content

Exporting the history to CSV

The bot can give you the history as a CSV file — you can open it in Excel or Google Sheets and calculate anything you like: the result by pair, by bot, by month. The file arrives right in the chat with the main bot.

Where it is in the bot

WayWhat it exports
💼 TradesHistory📥 Export CSVAll the closed trades
The command /export_historyThe same
The command /export_grid_history <gridBotId>The level history of one Grid bot
The command /export_dca_history <dcaBotId>The cycle history of one DCA bot
The command /export_all_historyThe whole history of all your DCA and Grid bots in one file

The commands are sent as text in the chat with the main bot @sync_trading_bot. The ID of a Grid or a DCA bot is the number after the “#” that the bot shows in the notifications about that bot. Exporting the signal history of a channel is a separate button in the channel admin cabinet, see Exporting the signal history.

How it works

  1. Press 📥 Export CSV or send the command.
  2. The bot sends a file with a caption, for example: “📊 Closed trades history: 37 records. CSV file (UTF-8).” and confirms: “✅ Trade history file has been sent.”
  3. For Grid and DCA the caption is “📊 Grid bot #12 levels history. CSV file (Excel-compatible).” and “📊 DCA bot #7 cycle history. CSV file (Excel-compatible).”
  4. A large export with /export_all_history is split into parts automatically: “📊 DCA + Grid history — part 2”.

The button in the history exports all the closed trades in full — the filters by period and pair selected on the screen do not affect the file. It is easier to filter the data in the spreadsheet.

What is inside the files

FileColumns
The trade historytrade_id, bot_id, pair, direction, creation_date, position_qty, state
The Grid historylevel_index; price; state; buy_filled_qty; sell_filled_qty; level_pnl and the summary block: the bot ID, the symbol, the state, Realized PnL, Funding, Unrealized PnL
The DCA historytrade_id; creation_date; direction; leverage; position_qty; state; cycle_archived; tp_strategy; tp_levels_count; tp_geometric_ratio; sl_timeout_seconds; accumulated_funding; net_pnl and the totals: the bot ID, the symbol, the state, Total PnL, Funding, Net PnL, completed cycles

The state column of the Grid file marks each level as empty, buy pending, buy placed, bought, sell pending, sell placed, sold, partially filled, a placement error or cancelled. In the file itself these labels are written in Russian — the English names above only explain what they mean.

The encoding is UTF-8. If Excel showed garbled characters, import the file through “Data → From Text” with the UTF-8 encoding, or open it in Google Sheets.

How long the data is kept

DataTerm
The trades themselves (the trade history, the DCA export)Never deleted
The levels of closed Grid bots90 days, after that they go to the archive
The cycles of DCA bots30 days; the trades stay

The practical consequence: /export_grid_history for a Grid bot closed more than 90 days ago returns an empty list of levels. If the history of a particular grid matters to you, download the file while the bot is fresh. The trade history and the DCA export are not affected by this.

Limits and allowed values

ParameterValue
FormatCSV, UTF-8
Who can exportThe owner of the bot only
Large filesSplit into parts automatically
The Grid levelsAvailable for 90 days after the bot is closed

Common errors and what the bot says

  • “ℹ️ You have no closed trades to export yet.” — not a single trade has finished yet.
  • “ℹ️ Usage: /export_grid_history <gridBotId>” / “ℹ️ Usage: /export_dca_history <dcaBotId>” — the command was sent without an ID.
  • “❌ ID must be a number.” — put only the number after the command, without the “#”.
  • “❌ Grid bot with this ID was not found or belongs to another user.” / “❌ DCA bot with this ID was not found or belongs to another user.” — check the ID.
  • “ℹ️ You don't have any DCA or Grid bots yet for export.” — /export_all_history has nothing to export.
  • “❌ Could not send the file. Please try later or contact support.” / “❌ Failed to send combined export. Please try later.” — a temporary sending failure; try again in a minute, and if it repeats write to support.