void onBtnUnderComp() {

    UnderCompDlg underCompDlg = new UnderCompDlg(m_underComp, this);

    // show delta neutral dialog
    underCompDlg.setVisible(true);
    if (underCompDlg.ok()) {
      m_contract.m_underComp = m_underComp;
    } else if (underCompDlg.reset()) {
      m_contract.m_underComp = null;
    }
  }
Пример #2
0
  public Contract getContract() {
    Contract c = new Contract();
    c.m_conId = m_conid;
    c.m_symbol = m_symbol;
    c.m_secType = m_secType.toString();
    c.m_expiry = m_expiry;
    c.m_strike = m_strike;
    c.m_right = m_right.getApiString();
    c.m_multiplier = m_multiplier;
    c.m_exchange = m_exchange;
    c.m_currency = m_currency;
    c.m_localSymbol = m_localSymbol;
    c.m_tradingClass = m_tradingClass;
    c.m_primaryExch = m_primaryExch;
    c.m_secIdType = m_secIdType.getApiString();
    c.m_secId = m_secId;

    if (m_underComp != null) {
      c.m_underComp = new UnderComp();
      c.m_underComp.m_conId = m_underComp.conid();
      c.m_underComp.m_delta = m_underComp.delta();
      c.m_underComp.m_price = m_underComp.price();
    }

    c.m_comboLegs = new Vector<ComboLeg>();
    for (NewComboLeg leg : m_comboLegs) {
      c.m_comboLegs.add(leg.getComboLeg());
    }

    return c;
  }