Skip Menu |

This queue is for tickets about the Finance-InteractiveBrokers-TWS CPAN distribution.

Report information
The Basics
Id: 32289
Status: new
Priority: 0/
Queue: Finance-InteractiveBrokers-TWS

People
Owner: Nobody in particular
Requestors: ddascalescu+perl [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: v0.0.8
Fixed in: (no value)



Subject: Can't call method "get_EClientSocket" without a package or object reference
I tried to build Finance::Interactive::Brokers against Perl 5.10 on Win32 and ran into two issues: 1. The Java code for the wrapper functions in TWS.pm was outdated. I made the necessary changes to bring them up to date with the IB API released in Oct 2007 (see attached patch). 2. After patching TWS.pm, nmake test failed with the following error: t/01.option_chain....OIO error: Trapped uncaught error Error: Can't call method "get_EClientSocket" without a package or object reference at C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\blib\lib/Finance/InteractiveBrokers/TWS.pm line 161. Package: Finance::InteractiveBrokers::TWS File: C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\blib\lib/Finance/InteractiveBrokers/TWS.pm Line: 161 Trace begun at C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\blib\lib\Finance\InteractiveBrokers\TWS.pm line 161 Finance::InteractiveBrokers::TWS::AUTOLOAD('-ConfigFile', 'C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\b lib\lib\Finance\InteractiveBrokers\tws.conf') called at C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\blib \lib\Finance\InteractiveBrokers\TWS.pm line 95 Finance::InteractiveBrokers::TWS::get_conf_data('Finance::InteractiveBrokers::TWS=SCALAR(0x1ba7c14)') called at C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\blib\lib\Finance\InteractiveBrokers\TWS.pm line 67 Object::InsideOut::new('Finance::InteractiveBrokers::TWS', 'HASH(0x1ae68e4)') called at C:\$download\prg\perl\Finance-In teractiveBrokers-TWS-v0.0.8\blib\lib\Finance\InteractiveBrokers\TWS.pm line 76 Finance::InteractiveBrokers::TWS::new('Finance::InteractiveBrokers::TWS', 'Local::Opt_Chain=HASH(0x1ca2d34)') called at t\01.option_chain.t line 29 Jay, if you are still maintaining this package, and update would be greatly appreciated. Thanks, Dan
Subject: IB_API_2007-Oct_.txt
--- C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\lib\Finance\InteractiveBrokers\lib\TWS.pm 2006-Sep-25 06:30:20 +++ C:\$download\prg\perl\Finance-InteractiveBrokers-TWS-v0.0.8\lib\Finance\InteractiveBrokers\TWS.mine 2008-Jan-14 02:06:56 @@ -298,302 +298,301 @@ public void tickPrice(int tickerId, int field, double price, int canAutoExecute) - { try { @@ -320,329 +319,329 @@ } - public void tickOptionComputation( int tickerId, int field, + public void tickOptionComputation(int tickerId, int field, - double impliedVolatility, double delta) + double impliedVol, double delta, double modelPrice, + double pvDividend) { try { perlobj.InvokeMethod("tickOptionComputation", new Object [] { - tickerId, field, impliedVolatility, delta + tickerId, field, impliedVol, delta, modelPrice, pvDividend }); } @@ -332,346 +332,381 @@ } - + public void tickGeneric(int tickerId, int tickType, double value) { + try { + perlobj.InvokeMethod("tickGeneric", new Object [] { + tickerId, tickType, value + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + public void tickString(int tickerId, int tickType, String value) { + try { + perlobj.InvokeMethod("tickString", new Object [] { + tickerId, tickType, value + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + + public void tickEFP(int tickerId, int tickType, double basisPoints, + String formattedBasisPoints, double impliedFuture, int holdDays, + String futureExpiry, double dividendImpact, + double dividendsToExpiry) + { + try { + perlobj.InvokeMethod("tickEFP", new Object [] { + tickerId, tickType, basisPoints, formattedBasisPoints, + impliedFuture, holdDays, futureExpiry, dividendImpact, + dividendsToExpiry + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } public void orderStatus(int orderId, String status, int filled, - int remaining, double avgFillPrice, int permId, + int remaining, double avgFillPrice, int permId, int parentId, - int parentId, double lastFillPrice, int clientId) + double lastFillPrice, int clientId, String whyHeld) { try { perlobj.InvokeMethod("orderStatus", new Object [] { orderId, status, filled, remaining, avgFillPrice, - permId, parentId, lastFillPrice, clientId + permId, parentId, lastFillPrice, clientId, whyHeld }); } @@ -349,357 +384,393 @@ } - public void openOrder(int orderId, Contract contract, Order order) + public void openOrder(int orderId, Contract contract, Order order, + OrderState orderState) { try { perlobj.InvokeMethod("openOrder", new Object [] { - orderId, contract, order + orderId, contract, order, orderState }); } @@ -360,387 +396,401 @@ } - public void error(String str) + public void updateAccountValue(String key, String value, - { + String currency, String accountName) - try { - perlobj.InvokeMethod("error", new Object [] { - str - }); - } - catch (InlineJavaPerlException pe){ } - catch (InlineJavaException pe) { pe.printStackTrace() ;} - } - - public void connectionClosed() - { - try { - perlobj.InvokeMethod("connectionClosed", new Object [] { - }); - } - catch (InlineJavaPerlException pe){ } - catch (InlineJavaException pe) { pe.printStackTrace() ;} - - } - - public void updateAccountValue(String key, String value, String currency, - String accountName) { try { @@ -396,402 +410,416 @@ public void updatePortfolio(Contract contract, int position, - double marketPrice, double marketValue, + double marketPrice, double marketValue, double averageCost, - double averageCost, double unrealizedPNL, - double realizedPNL, String accountName) { + double unrealizedPNL, double realizedPNL, String accountName) + { try { perlobj.InvokeMethod("updatePortfolio", new Object [] { @@ -453,457 +467,472 @@ public void execDetails(int orderId, Contract contract, - Execution execution) { + Execution execution) + { try { @@ -464,478 +479,482 @@ } - public void error(int id, int errorCode, String errorMsg) - { - try { - perlobj.InvokeMethod("error", new Object [] { - id, errorCode, errorMsg - }); - } - catch (InlineJavaPerlException pe){ } - catch (InlineJavaException pe) { pe.printStackTrace() ;} - } - public void updateMktDepth(int tickerId, int position, int operation, int side, double price, int size) @@ -488,493 +492,496 @@ public void updateMktDepthL2(int tickerId, int position, - String marketMaker, int operation, int side, + String marketMaker, int operation, int side, double price, int size) - double price, int size) { try { @@ -537,547 +540,550 @@ public void historicalData(int reqId, String date, double open, - double high, double low, double close, + double high, double low, double close, int volume, int count, - int volume, double WAP, boolean hasGaps) + double WAP, boolean hasGaps) { try { perlobj.InvokeMethod("historicalData", new Object [] { reqId, date, open, high, low, - close, volume, WAP, hasGaps + close, volume, count, WAP, hasGaps }); } @@ -561,570 +564,574 @@ public void scannerData(int reqId, int rank, - ContractDetails contractDetails, String distance, + ContractDetails contractDetails, String distance, String benchmark, - String benchmark, String projection) { + String projection, String legsStr) + { try { perlobj.InvokeMethod("scannerData", new Object [] { reqId, rank, contractDetails, distance, - benchmark, projection + benchmark, projection, legsStr }); } @@ -572,575 +576,666 @@ catch (InlineJavaException pe) { pe.printStackTrace() ;} } + + + public void scannerDataEnd(int reqId) { + try { + perlobj.InvokeMethod("scannerDataEnd", new Object [] { + reqId + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + + public void realtimeBar(int reqId, long time, double open, double high, + double low, double close, long volume, double wap, int count) + { + try { + perlobj.InvokeMethod("realTimeBar", new Object [] { + reqId, time, open, high, low, close, volume, wap, count + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + + public void currentTime(long time) { + try { + perlobj.InvokeMethod("currentTime", new Object [] { + time + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + +/////////////////// +//////// AnyWrapper +/////////////////// + public void error(Exception e) + { + try { + perlobj.InvokeMethod("error", new Object [] { + e + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + public void error(int id, int errorCode, String errorMsg) + { + try { + perlobj.InvokeMethod("error", new Object [] { + id, errorCode, errorMsg + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + + public void error(String str) + { + try { + perlobj.InvokeMethod("error", new Object [] { + str + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } + + public void connectionClosed() + { + try { + perlobj.InvokeMethod("connectionClosed", new Object [] { + }); + } + catch (InlineJavaPerlException pe){ } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + + } + + + }