/**
   * Streams random prices into the system.
   *
   * @param g Grid.
   * @throws GridException If failed.
   */
  private static void streamData(final Grid g) throws GridException {
    GridStreamer streamer = g.streamer("priceBars");

    for (int i = 0; i < CNT; i++) {
      for (int j = 0; j < INSTRUMENTS.length; j++) {
        // Use gaussian distribution to ensure that
        // numbers closer to 0 have higher probability.
        double price = round2(INITIAL_PRICES[j] + RAND.nextGaussian());

        Quote quote = new Quote(INSTRUMENTS[j], price);

        streamer.addEvent(quote);
      }
    }
  }