We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent faebd5d commit efcb657Copy full SHA for efcb657
routes.lua
@@ -196,6 +196,9 @@ function routes.get_trades_by_num(orderNumber)
196
end
197
198
function routes.fill_order_with_trades_data(order)
199
+ if order.qty == order.balance then
200
+ return order
201
+ end
202
local qty_of_trades = 0
203
local price_qty = 0
204
for i = 0, getNumberOf("trades") - 1 do
@@ -205,6 +208,9 @@ function routes.fill_order_with_trades_data(order)
205
208
qty_of_trades = qty_of_trades + trade.qty
206
209
order.last_trade_datetime_ex = trade.datetime
207
210
211
+ if qty_of_trades == order.qty then
212
+ break
213
214
215
if qty_of_trades > 0 then
216
order.average_price_ex = price_qty / qty_of_trades
0 commit comments