Type/to search
Getting Started
Welcome to FMZ Quant Trading Platform
Quick Start
Key Security
Platform Basics
Account and Billing
Live Robot Billing and Top-up
Sub-accounts
Exchange
General Protocol
Local Credential Files
Exchange-Specific Notes
Securities and Futures
Crypto
Docker
Strategy Library
Live Trading
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations

How it works

A trading plugin is a short piece of code executed on a docker: when you click "Execute" on the trading terminal page, the platform sends the plugin code and the exchange account selected in the module to the selected docker, runs it, and shows the return value in the module. The following entry points share the same execution mechanism:

Entry pointCode that runsNotes
Trading terminal pluginA strategy of type "Trading Plugin" in your strategy libraryAdded and executed on the trading terminal page
Debug Tool (development tools)JavaScript code written on the pageFor testing API calls
Extended API PluginRunsource in the request, or an existing strategy of the accountFor programs
MCP plugin_* toolsBuilt-in functions for market data, orders and so onFor AI assistants, authorized by the trade permission, see Integrations → AI Integration

No live trading bot is created and nothing is charged; one run lasts at most 5 minutes and is interrupted on timeout. It suits simple tasks that assist manual trading, such as iceberg orders, placing or cancelling orders in bulk, or calculations; logic that has to run for a long time should be a live trading bot.

Writing a plugin

Create a strategy and set its type to "Trading Plugin" on the new-strategy page. Trading plugins, the debugging tool and PluginRun support JavaScript only.

The plugin's entry point is main(), and its return value is the result: a returned table or chart object is shown as a table or chart in the module (see Integrations → Trading Terminal → Plugin Examples). Logs written with Log() are not shown in the module.

Using a plugin

  • Add: open the module menu on the trading terminal page; the trading plugins in your strategy library are listed there. Choose one to add it.
  • Execute: click "Execute" in the plugin module to run it.

Data directory

When plugins and the debug tool run on a docker, their working directory is logs/storage/p<number>/ under the docker's running directory (one directory starting with p per platform account, created on the first run). If an exchange account used by the trading terminal configures its key as a key file path (file:///xxx.txt), put the key file in this directory.