Replacement for the Deprecated GetMinStock Function
JavaScript strategy by hugo_zhou.
JavaScriptOther
The original spec has no written description. Read the source below.
Source JavaScript
/****************
Get minimum trading volume for different currency pairs on Huobi Pro
Other platforms need to add different error parsing codes themselves.
****************/
function main() {
SetErrorFilter("limit order amount error");
//Add the currency pairs you want to know
var huobipro = ["BTC_USDT","XRP_USDT","EOS_BTC","OMG_ETH"];
for(var i = 0;i<huobipro.length;i++){
exchange.IO("currency", huobipro[i]);
var ticker = exchange.GetTicker();
exchange.Buy(ticker.Sell, 0.00000001); // amountYou can only write as small as possible, and get the correct one returned by the server.min
var error = GetLastError();
// Huobi error code analysis, different trading platforms should be different limit order amount error, min: `0.00000001`
if(error.indexOf("limit order amount error, min") >= 0){
var min = parseFloat(error.split(": `")[1]);
_G(exchange.GetName()+exchange.GetCurrency(),min);
}
}
//Print out from the database
for(var j = 0;j<huobipro.length;j++){
Log(exchange.GetName()+huobipro[j],":",_G(exchange.GetName()+huobipro[j]));
}
}Published by hugo_zhou on the FMZ strategy square · last modified 2018-01-17. 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 production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Replacement-for-the-Deprecated-GetMinStock-Function.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.