コード例 #1
0
 public Observable<OrderEvent> observeClose(final ClosePositionParams closePositionParams) {
   return Observable.defer(
       () -> {
         final Collection<IOrder> ordersToClose =
             ordersForPositionClose.forMode(closePositionParams);
         return ordersToClose.size() > 0
             ? batchChangeTask.close(ordersToClose, closePositionParams)
             : Observable.empty();
       });
 }
コード例 #2
0
 private Observable<OrderEvent> observeMergeForFilledOrders(
     final ClosePositionParams closePositionParams) {
   return Observable.defer(
       () -> {
         final Collection<IOrder> filledOrders =
             ordersForPositionClose.filled(closePositionParams.instrument());
         return filledOrders.size() > 1
             ? mergePositionTask.merge(filledOrders, closePositionParams.mergePositionParams())
             : Observable.empty();
       });
 }
コード例 #3
0
 public Observable<OrderEvent> observeMerge(final ClosePositionParams closePositionParams) {
   return closePositionParams.closeExecutionMode() == CloseExecutionMode.CloseOpened
       ? Observable.empty()
       : observeMergeForFilledOrders(closePositionParams);
 }