Example #1
0
  public void tickSize(int tickerId, int field, int size) {
    TickType tick = TickType.get(field);
    consoleMsg(
        "tickSize:" + tickerId + " field:" + field + " (" + tick.field() + ") value:" + size);

    synchronized (m_mutex) {
      if (m_status == Status.Ticks) {
        switch (tick) {
          case BID_SIZE:
            m_bidSize = size;
            if (!(m_bidSize == 0 && m_bidPrice == -1)) {
              m_receivedTicks |= MaskBidSize;
            }
            break;
          case ASK_SIZE:
            m_askSize = size;
            if (!(m_askSize == 0 && m_askPrice == -1)) {
              m_receivedTicks |= MaskAskSize;
            }
            break;
          default:
            break;
        }
        checkReceivedAllTicks();
      }
    }
  }
Example #2
0
  ///////////////////////////////////////////////////////////////////////
  // Data logging
  ///////////////////////////////////////////////////////////////////////
  public void tickPrice(int tickerId, int field, double price, int canAutoExecute) {
    Hashtable f = new Hashtable();
    f.put(TickType.getField(field), String.valueOf(price));
    f.put("canAutoExecute", String.valueOf(canAutoExecute));

    EventBus.publish(new MktDataEvent(tickerId, f));
  }
Example #3
0
  public void tickPrice(int tickerId, int field, double price, int canAutoExecute) {
    TickType tick = TickType.get(field);
    consoleMsg(
        "tickPrice:" + tickerId + " field:" + field + " (" + tick.field() + ") value:" + price);

    synchronized (m_mutex) {
      if (m_status == Status.Ticks) {
        switch (tick) {
          case BID:
            m_bidPrice = price;
            m_receivedTicks |= MaskBidPrice;
            break;
          case ASK:
            m_askPrice = price;
            m_receivedTicks |= MaskAskPrice;
            break;
          default:
            break;
        }
        checkReceivedAllTicks();
      }
    }
  }
Example #4
0
  public void tickGeneric(int tickerId, int tickType, double value) {
    Hashtable f = new Hashtable();
    f.put(TickType.getField(tickType), String.valueOf(value));

    EventBus.publish(new MktDataEvent(tickerId, f));
  }
Example #5
0
  public void tickString(int tickerId, int tickType, String value) {
    Hashtable f = new Hashtable();
    f.put(TickType.getField(tickType), value);

    EventBus.publish(new MktDataEvent(tickerId, f));
  }
Example #6
0
  public void tickSize(int tickerId, int field, int size) {
    Hashtable f = new Hashtable();
    f.put(TickType.getField(field), String.valueOf(size));

    EventBus.publish(new MktDataEvent(tickerId, f));
  }