Skip to content
All library documents

Using FMZ’s SQLite Database to Store and Display Trading Data

Article FMZ digest · Author: 发明者量化-小小梦

Summary

The article describes FMZ’s built-in database interface, based on SQLite, as a way to persist structured strategy data beyond the simpler state-saving function. It outlines basic relational database operations, including creating tables, inserting records, querying, updating, and deleting them. It also warns that several table names are reserved by the platform and should not be reused.

A worked example subscribes to a swap contract, stores ticker fields in a table, retrieves records, and demonstrates queries and modifications. It then uses the returned columns and values to populate a strategy status display. The article also explains that a prefixed query can use an in-memory database whose contents reset when the robot restarts. These examples teach data handling and presentation rather than a trading signal. They do not address database performance under heavy workloads, transaction safety, or validation of ticker values, and the sample’s fixed record threshold is illustrative rather than a general storage policy.

Key ideas

  • FMZ’s built-in database uses SQLite through a platform function for structured strategy data storage.
  • SQL statements can create tables and insert, select, update, or delete records.
  • Platform-reserved table names should be avoided when defining custom tables.
  • The example stores ticker fields, queries and edits records, and displays query results in a status table.
  • An in-memory database resets when the robot restarts, so it does not provide persistent storage.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.