Loading ...

请教num 替换成具体数字,能成功。但代入变量就不行,这如何处理

Author: sunsjk, Created: 2018-11-08 10:27:20, Updated:

var num = Number(sell_one_price); Log(“测试是否输出数字”,num);

        exchange.IO("api","POST","/api/v1/order","symbol=XBTUSD&side=Sell&orderQty=40&price=num&ordType=Limit&execInst=ParticipateDoNotInitiate");
        
        
        
        
        2018-11-08 10:24:55	Futures_BitMEX	错误	Futures_OP 4: 400: {"error":{"message":"'price' must be a number.","name":"HTTPError"}}

2018-11-08 10:24:55 信息 测试是否输出数字 6504.5


More

sunsjk exchange.IO("api","POST","/api/v1/order","symbol=XBTUSD&side=Buy&orderQty="+last_Amount+"&price="+buy_price+"&ordType=Limit&execInst=ParticipateDoNotInitiate");

sunsjk 感谢小小梦给了例子,下面给后人参考使用

小小梦 num 您写在 ``` "symbol=XBTUSD&side=Sell&orderQty=40&price=num&ordType=Limit& ``` 就是一个 字符串了 是 num , 并不是 变量 num ! 这个需要先弄明白 字符串的概念, 变量名的概念。