@icgio/icg-exchanges-wrapper 1.14.167 → 1.14.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/middleware/orders.js +3 -1
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -92,6 +92,7 @@ module.exports = class Orders {
|
|
|
92
92
|
this.check_init_order_opened = true
|
|
93
93
|
this.check_init_order_opened_timeout = 5 * 1000
|
|
94
94
|
this.cancel_previous_orders = settings.cancel_previous_orders || false
|
|
95
|
+
this.cancel_previous_orders_with_delay = settings.cancel_previous_orders_with_delay || false
|
|
95
96
|
this.cancel_range_orders = settings.cancel_range_orders || false
|
|
96
97
|
this.delete_connection_error_orders_timeout = 2 * 60 * 1000
|
|
97
98
|
this.delete_finished_orders_timeout = 30 * 1000 // CANCELED or F-FILLED
|
|
@@ -866,8 +867,9 @@ module.exports = class Orders {
|
|
|
866
867
|
}
|
|
867
868
|
// cancel previous orders with delay
|
|
868
869
|
else if (this.cancel_previous_orders && this.cancel_previous_orders_with_delay) {
|
|
870
|
+
const previous_orders = _.cloneDeep(orders)
|
|
869
871
|
setTimeout(() => {
|
|
870
|
-
|
|
872
|
+
previous_orders.map((order) => {
|
|
871
873
|
console.log('cancel original order: %s %s %j', exchange, pair, order)
|
|
872
874
|
this.Exchanges[exchange].cancel_order_by_order(order, (res) => {})
|
|
873
875
|
})
|