6
Follow
942
Followers
打勾调用此模板后会自动对指定的Api函数进行重试容错, 支持多交易所
Source
JavaScript
// 模板初始化时调用
function init() {
// 过滤常见错误
if (EnableErrorFilter) {
SetErrorFilter("502:|503:|tcp|character|connection|unexpected|network|timeout|WSARecv|Connect|GetAddr|no such|reset|http|received|EOF|reused");
}
// 重定义需要容错的函数
var names = ApiList.split(',');
_.each(exchanges, function(e) {
_.each(names, function(name) {
if (typeof(e[name]) !== 'function') {
throw "尝试容错 " + name + " 失败, 请确认存在此API并且输入正确.";Strategy parameters
Related strategies

