From 60995106982728a9541a97522a3101a445420bbf Mon Sep 17 00:00:00 2001 From: Vazha Date: Wed, 27 Jan 2021 01:51:18 +0200 Subject: [PATCH] Kraken - fix bugs with wrong indexes (#623) * add Cost param to Kraken GetOrderInfo output * fmt * faulty resp.Time handling in Binance GetOrderInfo method * add orderBookProcess * Update exchanges/binance/binance_websocket.go Co-authored-by: Adrian Gallagher * fmt * comment change * add param for log * fixed wrong indexes Co-authored-by: Vazha Bezhanishvili Co-authored-by: Adrian Gallagher --- exchanges/order/orders.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exchanges/order/orders.go b/exchanges/order/orders.go index 9a5eb8f2..32aeb692 100644 --- a/exchanges/order/orders.go +++ b/exchanges/order/orders.go @@ -160,7 +160,7 @@ func (d *Detail) UpdateOrderFromDetail(m *Detail) { d.Trades[y].Fee = m.Trades[x].Fee updated = true } - if m.Trades[y].Price != 0 && d.Trades[y].Price != m.Trades[x].Price { + if m.Trades[x].Price != 0 && d.Trades[y].Price != m.Trades[x].Price { d.Trades[y].Price = m.Trades[x].Price updated = true } @@ -176,7 +176,7 @@ func (d *Detail) UpdateOrderFromDetail(m *Detail) { d.Trades[y].Description = m.Trades[x].Description updated = true } - if m.Trades[y].Amount != 0 && d.Trades[y].Amount != m.Trades[x].Amount { + if m.Trades[x].Amount != 0 && d.Trades[y].Amount != m.Trades[x].Amount { d.Trades[y].Amount = m.Trades[x].Amount updated = true } @@ -309,7 +309,7 @@ func (d *Detail) UpdateOrderFromModify(m *Modify) { d.Trades[y].Fee = m.Trades[x].Fee updated = true } - if m.Trades[y].Price != 0 && d.Trades[y].Price != m.Trades[x].Price { + if m.Trades[x].Price != 0 && d.Trades[y].Price != m.Trades[x].Price { d.Trades[y].Price = m.Trades[x].Price updated = true } @@ -325,7 +325,7 @@ func (d *Detail) UpdateOrderFromModify(m *Modify) { d.Trades[y].Description = m.Trades[x].Description updated = true } - if m.Trades[y].Amount != 0 && d.Trades[y].Amount != m.Trades[x].Amount { + if m.Trades[x].Amount != 0 && d.Trades[y].Amount != m.Trades[x].Amount { d.Trades[y].Amount = m.Trades[x].Amount updated = true }