?? ereader.java
字號:
order.m_faProfile = readStr(); } if (version >= 8) { order.m_goodTillDate = readStr(); } if (version >= 9) { order.m_rule80A = readStr(); order.m_percentOffset = readDouble(); order.m_settlingFirm = readStr(); order.m_shortSaleSlot = readInt(); order.m_designatedLocation = readStr(); order.m_auctionStrategy = readInt(); order.m_startingPrice = readDouble(); order.m_stockRefPrice = readDouble(); order.m_delta = readDouble(); order.m_stockRangeLower = readDouble(); order.m_stockRangeUpper = readDouble(); order.m_displaySize = readInt(); order.m_rthOnly = readBoolFromInt(); order.m_blockOrder = readBoolFromInt(); order.m_sweepToFill = readBoolFromInt(); order.m_allOrNone = readBoolFromInt(); order.m_minQty = readInt(); order.m_ocaType = readInt(); order.m_eTradeOnly = readBoolFromInt(); order.m_firmQuoteOnly = readBoolFromInt(); order.m_nbboPriceCap = readDouble(); } if (version >= 10) { order.m_parentId = readInt(); order.m_triggerMethod = readInt(); } if (version >= 11) { order.m_volatility = readDouble(); order.m_volatilityType = readInt(); if (version == 11) { int receivedInt = readInt(); order.m_deltaNeutralOrderType = ( (receivedInt == 0) ? "NONE" : "MKT"); } else { // version 12 and up order.m_deltaNeutralOrderType = readStr(); order.m_deltaNeutralAuxPrice = readDouble(); } order.m_continuousUpdate = readInt(); if (m_parent.serverVersion() == 26) { order.m_stockRangeLower = readDouble(); order.m_stockRangeUpper = readDouble(); } order.m_referencePriceType = readInt(); } if (version >= 13) { order.m_trailStopPrice = readDouble(); } eWrapper().openOrder(order.m_orderId, contract, order); break; } case NEXT_VALID_ID: { int version = readInt(); int orderId = readInt(); eWrapper().nextValidId(orderId); break; } case SCANNER_DATA: { ContractDetails contract = new ContractDetails(); int version = readInt(); int tickerId = readInt(); int numberOfElements = readInt(); for (int ctr = 0; ctr < numberOfElements; ctr++) { int rank = readInt(); contract.m_summary.m_symbol = readStr(); contract.m_summary.m_secType = readStr(); contract.m_summary.m_expiry = readStr(); contract.m_summary.m_strike = readDouble(); contract.m_summary.m_right = readStr(); contract.m_summary.m_exchange = readStr(); contract.m_summary.m_currency = readStr(); contract.m_summary.m_localSymbol = readStr(); contract.m_marketName = readStr(); contract.m_tradingClass = readStr(); String distance = readStr(); String benchmark = readStr(); String projection = readStr(); eWrapper().scannerData(tickerId, rank, contract, distance, benchmark, projection); } break; } case CONTRACT_DATA: { int version = readInt(); ContractDetails contract = new ContractDetails(); contract.m_summary.m_symbol = readStr(); contract.m_summary.m_secType = readStr(); contract.m_summary.m_expiry = readStr(); contract.m_summary.m_strike = readDouble(); contract.m_summary.m_right = readStr(); contract.m_summary.m_exchange = readStr(); contract.m_summary.m_currency = readStr(); contract.m_summary.m_localSymbol = readStr(); contract.m_marketName = readStr(); contract.m_tradingClass = readStr(); contract.m_conid = readInt(); contract.m_minTick = readDouble(); contract.m_multiplier = readStr(); contract.m_orderTypes = readStr(); contract.m_validExchanges = readStr(); if (version >= 2) { contract.m_priceMagnifier = readInt(); } eWrapper().contractDetails(contract); break; } case BOND_CONTRACT_DATA: { int version = readInt(); ContractDetails contract = new ContractDetails(); contract.m_summary.m_symbol = readStr(); contract.m_summary.m_secType = readStr(); contract.m_summary.m_cusip = readStr(); contract.m_summary.m_coupon = readDouble(); contract.m_summary.m_maturity = readStr(); contract.m_summary.m_issueDate = readStr(); contract.m_summary.m_ratings = readStr(); contract.m_summary.m_bondType = readStr(); contract.m_summary.m_couponType = readStr(); contract.m_summary.m_convertible = readBoolFromInt(); contract.m_summary.m_callable = readBoolFromInt(); contract.m_summary.m_putable = readBoolFromInt(); contract.m_summary.m_descAppend = readStr(); contract.m_summary.m_exchange = readStr(); contract.m_summary.m_currency = readStr(); contract.m_marketName = readStr(); contract.m_tradingClass = readStr(); contract.m_conid = readInt(); contract.m_minTick = readDouble(); contract.m_orderTypes = readStr(); contract.m_validExchanges = readStr(); if (version >= 2) { contract.m_summary.m_nextOptionDate = readStr(); contract.m_summary.m_nextOptionType = readStr(); contract.m_summary.m_nextOptionPartial = readBoolFromInt(); contract.m_summary.m_notes = readStr(); } eWrapper().bondContractDetails(contract); break; } case EXECUTION_DATA: { int version = readInt(); int orderId = readInt(); Contract contract = new Contract(); contract.m_symbol = readStr(); contract.m_secType = readStr(); contract.m_expiry = readStr(); contract.m_strike = readDouble(); contract.m_right = readStr(); contract.m_exchange = readStr(); contract.m_currency = readStr(); contract.m_localSymbol = readStr(); Execution exec = new Execution(); exec.m_orderId = orderId; exec.m_execId = readStr(); exec.m_time = readStr(); exec.m_acctNumber = readStr(); exec.m_exchange = readStr(); exec.m_side = readStr(); exec.m_shares = readInt(); exec.m_price = readDouble(); if (version >= 2) { exec.m_permId = readInt(); } if (version >= 3) { exec.m_clientId = readInt(); } if (version >= 4) { exec.m_liquidation = readInt(); } eWrapper().execDetails(orderId, contract, exec); break; } case MARKET_DEPTH: { int version = readInt(); int id = readInt(); int position = readInt(); int operation = readInt(); int side = readInt(); double price = readDouble(); int size = readInt(); eWrapper().updateMktDepth(id, position, operation, side, price, size); break; } case MARKET_DEPTH_L2: { int version = readInt(); int id = readInt(); int position = readInt(); String marketMaker = readStr(); int operation = readInt(); int side = readInt(); double price = readDouble(); int size = readInt(); eWrapper().updateMktDepthL2(id, position, marketMaker, operation, side, price, size); break; } case NEWS_BULLETINS: { int version = readInt(); int newsMsgId = readInt(); int newsMsgType = readInt(); String newsMessage = readStr(); String originatingExch = readStr(); eWrapper().updateNewsBulletin(newsMsgId, newsMsgType, newsMessage, originatingExch); break; } case MANAGED_ACCTS: { int version = readInt(); String accountsList = readStr(); eWrapper().managedAccounts(accountsList); break; } case RECEIVE_FA: { int version = readInt(); int faDataType = readInt(); String xml = readStr(); eWrapper().receiveFA(faDataType, xml); break; } case HISTORICAL_DATA: { int version = readInt(); int reqId = readInt(); String startDateStr; String endDateStr; String completedIndicator = "finished"; if (version >= 2) { startDateStr = readStr(); endDateStr = readStr(); completedIndicator += "-" + startDateStr + "-" + endDateStr; } int itemCount = readInt(); for (int ctr = 0; ctr < itemCount; ctr++) { String date = readStr(); double open = readDouble(); double high = readDouble(); double low = readDouble(); double close = readDouble(); int volume = readInt(); double WAP = readDouble(); String hasGaps = readStr(); int barCount = -1; if (version >= 3) { barCount = readInt(); } eWrapper().historicalData(reqId, date, open, high, low, close, volume, barCount, WAP, Boolean.valueOf(hasGaps).booleanValue()); } // send end of dataset marker eWrapper().historicalData(reqId, completedIndicator, -1, -1, -1, -1, -1, -1, -1, false); break; } case SCANNER_PARAMETERS: { int version = readInt(); String xml = readStr(); eWrapper().scannerParameters(xml); break; } default: { m_parent.error(EClientErrors.NO_VALID_ID, EClientErrors.UNKNOWN_ID.code(), EClientErrors.UNKNOWN_ID.msg()); return false; } } return true; } protected String readStr() throws IOException { StringBuffer buf = new StringBuffer(); while (true) { byte c = m_dis.readByte(); if (c == 0) { break; } buf.append( (char) c); } String str = buf.toString(); return str.length() == 0 ? null : str; } boolean readBoolFromInt() throws IOException { String str = readStr(); return str == null ? false : (Integer.parseInt(str) != 0); } protected int readInt() throws IOException { String str = readStr(); return str == null ? 0 : Integer.parseInt(str); } protected long readLong() throws IOException { String str = readStr(); return str == null ? 0l : Long.parseLong(str); } protected double readDouble() throws IOException { String str = readStr(); return str == null ? 0 : Double.parseDouble(str); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -