- api.addConsolidatedTradeDataListener((price, size, tradeInfo) => { let icebergVolumeJava = tradeInfo.executedOrders.stream().filter(x => x.isIceberg).mapToInt(x => x.tradeSize).sum() if (icebergVolumeJava > 0) { Log.info('icebergVolumeJava: ' + icebergVolumeJava + " tradeInfo: " + tradeInfo + " price: " + price + " size: " + size); } /* let stopVolumeJava = tradeInfo.executedOrders.stream().filter(x => x.isStop).mapToInt(x => x.tradeSize).sum() if (stopVolumeJava > 0) { Log.info('StopVolumeJava: ' + stopVolumeJava + " tradeInfo: " + tradeInfo); }*/ })
- [3:49]
Does anyone know how to obtain the time of that iceberg order to track and if it is executed or not? Or what state is it in?
time, state iceberg
-
- Posts: 1
- Joined: Sun Jan 09, 2022 12:08 am
time, state iceberg
-
- Posts: 552
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: time, state iceberg
Hi, the JS-API+SIT keeps no time or state of icebergs. You may want to make it yourselves:
- store all new icebergs in a key(id)-value(an object that will contain an order, its time and isExecuted value) datastructure (map)
- the first time an order appears in your module will be the incoming time which you can store
- get isExecutionEnd value of every tradeInfo and if true the order is executed (finished) so you can add this value to your datastructure
- store all new icebergs in a key(id)-value(an object that will contain an order, its time and isExecuted value) datastructure (map)
- the first time an order appears in your module will be the incoming time which you can store
- get isExecutionEnd value of every tradeInfo and if true the order is executed (finished) so you can add this value to your datastructure