Пример #1
0
  /* (non-Javadoc)
   * @see org.eclipsetrader.core.trading.IOrderMonitor#submit()
   */
  @Override
  public void submit() throws BrokerException {
    if (!connector.isLoggedIn()) {
      connector.login();
      if (!connector.isLoggedIn()) {
        throw new BrokerException(Messages.OrderMonitor_UnableToLogin);
      }
    }

    if (connector.sendOrder(this)) {
      brokerConnector.addWithNotification(this);
    }
  }
Пример #2
0
  /* (non-Javadoc)
   * @see org.eclipsetrader.core.trading.IOrderMonitor#cancel()
   */
  @Override
  public void cancel() throws BrokerException {
    if (!connector.isLoggedIn()) {
      connector.login();
      if (!connector.isLoggedIn()) {
        throw new BrokerException(Messages.OrderMonitor_UnableToLogin);
      }
    }

    if (getId() == null) {
      throw new BrokerException(Messages.OrderMonitor_InvalidOrder);
    }

    connector.cancelOrder(this);
  }