Strategy vault / Tools & templates
Digital Currency Futures Switching Plugin for Full and Isolated Positions
JavaScript strategy by 发明者量化-小小梦.
JavaScriptTools & templates
The original spec has no written description. Read the source below.
Parameters
| Name | Default | What it controls |
|---|---|---|
| type | 0 | Cross/Isolated margin mode: Isolated | Cross |
Source JavaScript
function main() {
var posType = [false, true][type]
var name = exchange.GetName()
if (name == "Futures_Binance") {
exchange.IO("cross", posType)
} else if (name == "Futures_HuobiDM") {
exchange.IO("cross", posType)
} else if (name == "Futures_Bibox") {
exchange.IO("cross", posType)
} else if (name == "Futures_Bitget") {
exchange.IO("cross", posType)
} else if (name == "Futures_AOFEX") {
exchange.IO("cross", posType)
} else if (name == "Futures_Pionex") {
exchange.IO("cross", posType)
} else {
throw "not support!"
}
return name + "Switch cross :" + posType
}Published by 发明者量化-小小梦 on the FMZ strategy square · last modified 2023-09-06. 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/Digital-Currency-Futures-Switching-Plugin-for-Full-and-Isolated-Positions.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