0
Follow
0
Followers
举个最简单的例子,如果我想每隔1秒种就在交易所挂一个价格为100,数量为1的买单,可以这么写:
2.1 经典策略框架
function onTick(){
exchange.Buy(100,1);
}
function main(){
while(true){
onTick();
Sleep(1000);//暂停多久可自定义,单位为毫秒(1秒=1000毫秒)
}
}
系统报错
ReferenceError: identifier 'onTick' undefined at main (FILE:22)
如果要实现不断问询API订单情况,应该用哪个函数
Related Recommendations
in main TypeError: IO() takes at most 3 arguments (5 given)symbol not setGetTicker: 400: {"code": 2, "data": {}, "message": "invalid params"}gateio getdepth 502Decrypt: Secret key decrypt failedGetOrders: 400: {"code":-1121,"msg":"Invalid symbol."}HTTP 403 errorBitcoin trading by using botsPlease translate the buy plan pageRunning botvs docker on android
Comment
All comments (2)
我直接复制 您上面的代码测试了下 , 运行是没问题。这个报错 ReferenceError: identifier 'onTick' undefined at main (FILE:22) 是说 22行 onTick 没有定义,方便的话您发下 22行代码 看下。查询订单 使用GetOrder 函数 , 详情参看 API 文档: https://www.botvs.com/api#GetOrder
9 years ago
- 1
