Examples of OHLCPoint


Examples of com.quantcomponents.marketdata.OHLCPoint

    Double open = Double.parseDouble(tokens[1]);
    Double high = Double.parseDouble(tokens[2]);
    Double low = Double.parseDouble(tokens[3]);
    Double close = Double.parseDouble(tokens[4]);
    Long volume = Long.parseLong(tokens[5]);
    OHLCPoint point = new OHLCPoint(barSize, date, open, high, low, close, volume, (open + close) / 2, 1);
    return point;
  }
View Full Code Here

Examples of com.quantcomponents.marketdata.OHLCPoint

      Double low = rs.getDouble(5);
      Double close = rs.getDouble(6);
      Long volume = rs.getLong(7);
      Double wap = rs.getDouble(8);
      Integer count = rs.getInt(9);
      OHLCPoint point = new OHLCPoint(barSize, date, open, high, low, close, volume, wap, count);
      Timestamp lastUpdateTs = rs.getTimestamp(10);
      if (lastUpdateTs != null) {
        point.setLastUpdate(new Date(lastUpdateTs.getTime()));
      }
      result.add(point);
    }
    rs.close();
    return result;
View Full Code Here

Examples of com.quantcomponents.marketdata.OHLCPoint

    double open = lastValue;
    double high = lastValue + deltas[2];
    double low = lastValue + deltas[0];
    double close = lastValue + deltas[1];
    long volume = (long)(avgVolume + nextGaussian(random) * volVolume);
    return new OHLCPoint(BAR_SIZES[0], date, open, high, low, close, volume, 0.0, 0);
  }
View Full Code Here

Examples of com.quantcomponents.marketdata.OHLCPoint

              }
            } else {
              Long dateInSecs = Long.valueOf(dateRepr);
              date = new Date(dateInSecs * 1000);
            }
            OHLCPoint data = new OHLCPoint(barSize, date, open, high, low, close, (long)volume, WAP, count);
            result.add(data);
          }
        }
      }
    };
View Full Code Here

Examples of com.quantcomponents.marketdata.OHLCPoint

        }

        @Override
        public void realtimeBar(int reqId, long time, double open, double high, double low, double close, long volume, double wap, int count) {
          if (reqId == getPendingReqId()) {
            final OHLCPoint ohlc = new OHLCPoint(BarSize.FIVE_SECS, new Date((long)time * 1000L), open, high, low, close, volume, wap, count);
            threadPool.execute(new Runnable() {
              @Override
              public void run() {
                for (IRealTimeDataListener listener : currentListeners) {
                  try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.