0
Follow
0
Followers
A quantidade real da transação não corresponde à quantidade definida pelo exchange.Buy.
Created 2018-03-05 18:18:47 Updated 2018-03-05 18:19:29
4
1958
O teste que eu uso é muito simples, eu compro 10 ETH por hora no preço de mercado, o preço inicial é de 10.000, mas quando o teste de simulação foi feito, eu descobri que a transação foi bem sucedida, mas a quantidade de transação não foi de 10.
function onTick() {
var id = exchange.Buy(-1, 10);
Log("Order Id:", id);
Log(exchange.GetOrder(id));
Log(exchange.GetTrades());
Log(exchange.GetAccount());
}
function main() {
Log(exchange.GetAccount());
while (true) {
onTick();
Sleep(3600 * 1000);
}
}
Este é o log de uma das transações.
2018-03-05 06:00:25 信息 {"Balance":9699.61809,"Stocks":0.33250049999999987,"FrozenBalance":0,"FrozenStocks":0}
2018-03-05 06:00:24 信息 [{"Id":31,"Time":1520200824800,"Price":900,"Amount":1,"Type":1}]
2018-03-05 06:00:24 信息 {"Id":31,"Price":-1,"Amount":10,"DealAmount":10,"Type":0,"Status":1,"AvgPrice":900.01}
2018-03-05 06:00:24 信息 Order Id: 31
2018-03-05 06:00:24 OKCoin_EN 买入 市价 10
Sabem porquê?
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 (4)
这里用 市价单 传入的 10 ,指的不是 10个 ETH 币, 而是 10美元, 您把这个 var id = exchange.Buy(-1, 10); 数量 10 改成 900 试下 ,看买入后 Stocks 会不会多 将近1个 ETH 。
9 years ago
- 1
