Strategy vault / Tools & templates
Trading Terminal Plugin Example
For demonstrating trading terminal plugin embedding function. https://www.fmz.com/api %E4%BA%A4%E6%98%93%E6%8F%92%E4%BB%B6
For demonstrating trading terminal plugin embedding function. https://www.fmz.com/api#%E4%BA%A4%E6%98%93%E6%8F%92%E4%BB%B6
Parameters
| Name | Default | What it controls |
|---|---|---|
| TransactionTimes | Number of trades | Number of trades |
| Amount | Number of coins per trade | number of coins per trade |
| Side | Trading direction | Trading direction |
Source JavaScript
function main() {
var initAcc = _C(exchange.GetAccount)
var tbl = {
"type" : "table",
"title" : "Table",
"cols" : ["Project', 'Content"],
"rows" : [],
}
for (var i = 0 ; i < TransactionTimes ; i++) {
var info = null
if (Side == 0) {
info = $.Buy(Amount)
} else if (Side == 1) {
info = $.Sell(Amount)
} else {
throw "side error!"
}
tbl.rows.push([i + "Order number, transaction status:", JSON.stringify(info)])
Sleep(300)
}
var nowAcc = _C(exchange.GetAccount)
Log("balance:", nowAcc.Balance)
delete initAcc.Info
delete nowAcc.Info
tbl.rows.push(["Initial account:", JSON.stringify(initAcc)])
tbl.rows.push(["Post-execution account:", JSON.stringify(nowAcc)])
return tbl
}Published by 发明者量化-小小梦 on the FMZ strategy square · last modified 2025-04-08. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a tested, production-ready module from strategies/Trading-Terminal-Plugin-Example.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Binance Account Cross Transfer Small ToolJavaScript · Tools & templates
- Get cryptocurrency current and max supplyJavaScript · Tools & templates
- Interaction TemplateJavaScript · Tools & templates
- KuCoin Fund Transfer PluginJavaScript · Tools & templates
- Moving Average Bot 30 linesJavaScript · Tools & templates · 1d
- OKEx V5 Candlestick Data Paginated Query ExampleJavaScript · Tools & templates