Ejemplo n.º 1
0
  @Override
  public void start() {

    while (true) {
      try {
        Thread.sleep(2000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      orderBookEventListener.notify(
          new OrderBookEvent() {
            @Override
            public long getInstrumentId() {
              return 1234;
            }

            @Override
            public FixedPointNumber getValuationBidPrice() {
              return null;
            }

            @Override
            public FixedPointNumber getValuationAskPrice() {
              return null;
            }

            @Override
            public List<PricePoint> getBidPrices() {
              List<PricePoint> list = new LinkedList<PricePoint>();
              list.add(
                  new PricePoint() {

                    @Override
                    public FixedPointNumber getPrice() {
                      return FixedPointNumber.valueOf(12345);
                    }

                    @Override
                    public FixedPointNumber getQuantity() {
                      return FixedPointNumber.TEN;
                    }
                  });
              return list;
            }

            @Override
            public List<PricePoint> getAskPrices() {
              List<PricePoint> list = new LinkedList<PricePoint>();
              list.add(
                  new PricePoint() {

                    @Override
                    public FixedPointNumber getPrice() {
                      return FixedPointNumber.valueOf(12456);
                    }

                    @Override
                    public FixedPointNumber getQuantity() {
                      return FixedPointNumber.TEN;
                    }
                  });
              return list;
            }

            @Override
            public FixedPointNumber getLastMarketClosePrice() {
              return null;
            }

            @Override
            public String getLastMarketClosePriceTimeStamp() {
              return null;
            }

            @Override
            public FixedPointNumber getMarketClosePrice() {
              return null;
            }

            @Override
            public long getMarketClosePriceTimeStamp() {
              return 0;
            }

            @Override
            public FixedPointNumber getLastTradedPrice() {
              return null;
            }

            @Override
            public FixedPointNumber getDailyHighestTradedPrice() {
              return null;
            }

            @Override
            public FixedPointNumber getDailyLowestTradedPrice() {
              return null;
            }

            @Override
            public long getTimeStamp() {
              return 0;
            }
          });
    }
  }
Ejemplo n.º 2
0
  @Override
  public void placeMarketOrder(
      MarketOrderSpecification marketOrderSpecification, OrderCallback orderCallback) {
    orderCallback.onSuccess(123l);
    orderBookEventListener.notify(
        new OrderBookEvent() {
          @Override
          public long getInstrumentId() {
            return 123;
          }

          @Override
          public FixedPointNumber getValuationBidPrice() {
            return null;
          }

          @Override
          public FixedPointNumber getValuationAskPrice() {
            return null;
          }

          @Override
          public List<PricePoint> getBidPrices() {
            return null;
          }

          @Override
          public List<PricePoint> getAskPrices() {
            return null;
          }

          @Override
          public FixedPointNumber getLastMarketClosePrice() {
            return null;
          }

          @Override
          public String getLastMarketClosePriceTimeStamp() {
            return null;
          }

          @Override
          public FixedPointNumber getMarketClosePrice() {
            return null;
          }

          @Override
          public long getMarketClosePriceTimeStamp() {
            return 0;
          }

          @Override
          public FixedPointNumber getLastTradedPrice() {
            return null;
          }

          @Override
          public FixedPointNumber getDailyHighestTradedPrice() {
            return null;
          }

          @Override
          public FixedPointNumber getDailyLowestTradedPrice() {
            return null;
          }

          @Override
          public long getTimeStamp() {
            return 0;
          }
        });
  }