time, state iceberg

Custom indicators, trading strategies, data export and recording and more...
juanklow93
Posts: 1
Joined: Sun Jan 09, 2022 12:08 am

time, state iceberg

Post by juanklow93 » Fri Jul 22, 2022 9:07 am

  1. 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); }*/ })
  2. [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?

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: time, state iceberg

Post by Andry API support » Fri Jul 22, 2022 1:26 pm

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

Post Reply