Strategy vault / Tools & templates
Switch OKEx V5 Simulated Trading Terminal Plugin
When the OKEX V5 exchange object is configured (using OKEX V5's simulated disk API KEY configuration), since the simulated disk environment is not switched, the following error will be reported: Can use this plugin…
Trading terminal OKEX_V5 simulation disk switching plug-in
When the OKEX V5 exchange object is configured (using OKEX V5's simulated disk API KEY configuration), since the simulated disk environment is not switched, the following error will be reported:
{"msg":"Broker id of APIKey does not match current environment.","code":"50101"}
Can use this plugin to switch, as shown in the figure:
Click the add button:
Select plugin:
Execute plugin
Execute immediately
The simulated account assets are then read out

If you want to switch back to the real disk environment, just uncheck the option and execute it again.
Source JavaScript
function main() {
exchange.IO("simulate", true)
return "Switched toOKEX V5Simulation Account"
}Published by 发明者量化-小小梦 on the FMZ strategy square · last modified 2021-06-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/Switch-OKEx-V5-Simulated-Trading-Terminal-Plugin.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