⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ewrappermsggenerator.java

📁 TWS Source code for IB interface
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    }        private static String contractDetailsMsg(ContractDetails contractDetails) {    	String msg = "marketName = " + contractDetails.m_marketName + "\n"        + "tradingClass = " + contractDetails.m_tradingClass + "\n"        + "minTick = " + contractDetails.m_minTick + "\n"        + "price magnifier = " + contractDetails.m_priceMagnifier + "\n"        + "orderTypes = " + contractDetails.m_orderTypes + "\n"        + "validExchanges = " + contractDetails.m_validExchanges + "\n";    	return msg;    }    	static public String contractMsg(Contract contract) {    	String msg = " ---- Contract Details begin ----\n"        + "conid = " + contract.m_conId + "\n"        + "symbol = " + contract.m_symbol + "\n"        + "secType = " + contract.m_secType + "\n"        + "expiry = " + contract.m_expiry + "\n"        + "strike = " + contract.m_strike + "\n"        + "right = " + contract.m_right + "\n"        + "multiplier = " + contract.m_multiplier + "\n"        + "exchange = " + contract.m_exchange + "\n"        + "currency = " + contract.m_currency + "\n"        + "localSymbol = " + contract.m_localSymbol + "\n";    	return msg;    }	    static public String bondContractDetails(ContractDetails contractDetails) {        Contract contract = contractDetails.m_summary;        String msg = " ---- Bond Contract Details begin ----\n"        + "symbol = " + contract.m_symbol + "\n"        + "secType = " + contract.m_secType + "\n"        + "cusip = " + contractDetails.m_cusip + "\n"        + "coupon = " + contractDetails.m_coupon + "\n"        + "maturity = " + contractDetails.m_maturity + "\n"        + "issueDate = " + contractDetails.m_issueDate + "\n"        + "ratings = " + contractDetails.m_ratings + "\n"        + "bondType = " + contractDetails.m_bondType + "\n"        + "couponType = " + contractDetails.m_couponType + "\n"        + "convertible = " + contractDetails.m_convertible + "\n"        + "callable = " + contractDetails.m_callable + "\n"        + "putable = " + contractDetails.m_putable + "\n"        + "descAppend = " + contractDetails.m_descAppend + "\n"        + "exchange = " + contract.m_exchange + "\n"        + "currency = " + contract.m_currency + "\n"        + "marketName = " + contractDetails.m_marketName + "\n"        + "tradingClass = " + contractDetails.m_tradingClass + "\n"        + "conid = " + contract.m_conId + "\n"        + "minTick = " + contractDetails.m_minTick + "\n"        + "orderTypes = " + contractDetails.m_orderTypes + "\n"        + "validExchanges = " + contractDetails.m_validExchanges + "\n"        + "nextOptionDate = " + contractDetails.m_nextOptionDate + "\n"        + "nextOptionType = " + contractDetails.m_nextOptionType + "\n"        + "nextOptionPartial = " + contractDetails.m_nextOptionPartial + "\n"        + "notes = " + contractDetails.m_notes + "\n"        + " ---- Bond Contract Details End ----\n";        return msg;    }        static public String execDetails( int orderId, Contract contract, Execution execution) {        String msg = " ---- Execution Details begin ----\n"        + "orderId = " + Integer.toString(orderId) + "\n"        + "clientId = " + Integer.toString(execution.m_clientId) + "\n"        + "symbol = " + contract.m_symbol + "\n"        + "secType = " + contract.m_secType + "\n"        + "expiry = " + contract.m_expiry + "\n"        + "strike = " + contract.m_strike + "\n"        + "right = " + contract.m_right + "\n"        + "contractExchange = " + contract.m_exchange + "\n"        + "currency = " + contract.m_currency + "\n"        + "localSymbol = " + contract.m_localSymbol + "\n"        + "execId = " + execution.m_execId + "\n"        + "time = " + execution.m_time + "\n"        + "acctNumber = " + execution.m_acctNumber + "\n"        + "executionExchange = " + execution.m_exchange + "\n"        + "side = " + execution.m_side + "\n"        + "shares = " + execution.m_shares + "\n"        + "price = " + execution.m_price + "\n"        + "permId = " + execution.m_permId + "\n"        + "liquidation = " + execution.m_liquidation + "\n"        + " ---- Execution Details end ----\n";        return msg;    }        static public String updateMktDepth( int tickerId, int position, int operation, int side,    									 double price, int size) {    	return "updateMktDepth: " + tickerId + " " + position + " " + operation + " " + side + " " + price + " " + size;    }        static public String updateMktDepthL2( int tickerId, int position, String marketMaker,    									   int operation, int side, double price, int size) {    	return "updateMktDepth: " + tickerId + " " + position + " " + marketMaker + " " + operation + " " + side + " " + price + " " + size;    }        static public String updateNewsBulletin( int msgId, int msgType, String message, String origExchange) {    	return "MsgId=" + msgId + " :: MsgType=" + msgType +  " :: Origin=" + origExchange + " :: Message=" + message;    }        static public String managedAccounts( String accountsList) {    	return "Connected : The list of managed accounts are : [" + accountsList + "]";    }        static public String receiveFA(int faDataType, String xml) {    	return FINANCIAL_ADVISOR + " " + EClientSocket.faMsgTypeName(faDataType) + " " + xml;    }        static public String historicalData(int reqId, String date, double open, double high, double low,                      					double close, int volume, int count, double WAP, boolean hasGaps) {    	return "id=" + reqId +        " date = " + date +        " open=" + open +        " high=" + high +        " low=" + low +        " close=" + close +        " volume=" + volume +        " count=" + count +        " WAP=" + WAP +        " hasGaps=" + hasGaps;    }	public static String realtimeBar(int reqId, long time, double open,			double high, double low, double close, long volume, double wap, int count) {        return "id=" + reqId +        " time = " + time +        " open=" + open +        " high=" + high +        " low=" + low +        " close=" + close +        " volume=" + volume +        " count=" + count +        " WAP=" + wap;	}	    static public String scannerParameters(String xml) {    	return SCANNER_PARAMETERS + "\n" + xml;    }        static public String scannerData(int reqId, int rank, ContractDetails contractDetails,    								 String distance, String benchmark, String projection,    								 String legsStr) {        Contract contract = contractDetails.m_summary;    	return "id = " + reqId +        " rank=" + rank +        " symbol=" + contract.m_symbol +        " secType=" + contract.m_secType +        " expiry=" + contract.m_expiry +        " strike=" + contract.m_strike +        " right=" + contract.m_right +        " exchange=" + contract.m_exchange +        " currency=" + contract.m_currency +        " localSymbol=" + contract.m_localSymbol +        " marketName=" + contractDetails.m_marketName +        " tradingClass=" + contractDetails.m_tradingClass +        " distance=" + distance +        " benchmark=" + benchmark +        " projection=" + projection +        " legsStr=" + legsStr;    }        static public String scannerDataEnd(int reqId) {    	return "id = " + reqId + " =============== end ===============";    }        static public String currentTime(long time) {		return "current time = " + time +		" (" + DateFormat.getDateTimeInstance().format(new Date(time * 1000)) + ")";    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -