Closed ecpgieicg closed 4 years ago
Indeed by adding "false" I get a better result
But still have a problem
I have connected Matlab to TWS, all seems OK because AccountSummaryExample returns all the info about my IB account
Then I execute contract = com.tws.ContractFactory.GenericStockContract('FB');
and get the variable contract well filled in:
val = conid 0 symbol FB strike 0.0 exchange SMART currency USD primaryExch ISLAND
Then I execute session.eClientSocket.reqHistoricalData(1000001,contract,'20141230 16:00:00','1 Y','1 day','TRADES',false,1,1,[]);
but get the following error:
1000001 321 Error validating request:-'bP' : cause - Please enter a valid security type
Why is the stock FB invalid here ?
You need to specify the security type. I am not with my computer atm. If memory serves, it's either STK or STOCK. Let me know if you can make it work.
Thank you for helping I forced STK into contract and stopped getting the invalid security error, sounds good But I got another error: enddates not supported with live updates
Please see below my short session:
clear session = TWS.Session.getInstance(); session.eClientSocket.eConnect('127.0.0.1',7496,0); -1 2104 Market data farm connection is OK:hfarm
-1 2104 Market data farm connection is OK:eufarm
-1 2104 Market data farm connection is OK:usfarm.nj
-1 2104 Market data farm connection is OK:jfarm
-1 2104 Market data farm connection is OK:usfuture
-1 2104 Market data farm connection is OK:cashfarm
-1 2104 Market data farm connection is OK:usfarm
-1 2106 HMDS data farm connection is OK:euhmds
-1 2106 HMDS data farm connection is OK:fundfarm
-1 2106 HMDS data farm connection is OK:ushmds
[buf,lh] = TWS.initBufferForEvent(TWS.Events.HISTORICALDATA); contract = com.tws.ContractFactory.GenericStockContract('FB'); contract.secType('STK');
session.eClientSocket.reqHistoricalData(1000001,contract,'20181230 16:00:00','1 Y','1 day','TRADES',false,1,1,[]); 1000001 321 Error validating request:-'bP' : cause - End date not supported with live updates
@GIL1105 You should follow the example in docs. Not sure why you are using contract factory. Please open a separate issue
On Fri, Jul 12, 2019 at 5:28 AM GIL1105 notifications@github.com wrote:
Thank you for helping I forced STK into contract and stopped getting the invalid security error, sounds good But I got another error: enddates not supported with live updates
Please see below my short session:
clear session = TWS.Session.getInstance(); session.eClientSocket.eConnect('127.0.0.1',7496,0); -1 2104 Market data farm connection is OK:hfarm
-1 2104 Market data farm connection is OK:eufarm
-1 2104 Market data farm connection is OK:usfarm.nj
-1 2104 Market data farm connection is OK:jfarm
-1 2104 Market data farm connection is OK:usfuture
-1 2104 Market data farm connection is OK:cashfarm
-1 2104 Market data farm connection is OK:usfarm
-1 2106 HMDS data farm connection is OK:euhmds
-1 2106 HMDS data farm connection is OK:fundfarm
-1 2106 HMDS data farm connection is OK:ushmds
[buf,lh] = TWS.initBufferForEvent(TWS.Events.HISTORICALDATA); contract = com.tws.ContractFactory.GenericStockContract('FB'); contract.secType('STK');
session.eClientSocket.reqHistoricalData(1000001,contract,'20181230 16:00:00','1 Y','1 day','TRADES',false,1,1,[]); 1000001 321 Error validating request:-'bP' : cause - End date not supported with live updates
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/softwarespartan/IB4m/issues/53?email_source=notifications&email_token=ABC2VVEG2FLRXI2QSMJJITTP7BFDNA5CNFSM4H2VHP5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZHWMI#issuecomment-510819121, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC2VVBP54VJW6VJPG5VTYDP7BFDNANCNFSM4H2VHP5A .
@GIL1105 Be sure to initialize contracts as specified in the docs and as we discussed in your email yesterday
contract = com.ib.client.Contract(); contract.symbol('FB') contract.exchange('SMART'); contract.primaryExch('ISLAND'); contract.currency('USD'); contract.secType('STK');
Sent from my iPhone
On Jul 12, 2019, at 5:28 AM, GIL1105 notifications@github.com wrote:
Thank you for helping I forced STK into contract and stopped getting the invalid security error, sounds good But I got another error: enddates not supported with live updates
Please see below my short session:
clear session = TWS.Session.getInstance(); session.eClientSocket.eConnect('127.0.0.1',7496,0); -1 2104 Market data farm connection is OK:hfarm
-1 2104 Market data farm connection is OK:eufarm
-1 2104 Market data farm connection is OK:usfarm.nj
-1 2104 Market data farm connection is OK:jfarm
-1 2104 Market data farm connection is OK:usfuture
-1 2104 Market data farm connection is OK:cashfarm
-1 2104 Market data farm connection is OK:usfarm
-1 2106 HMDS data farm connection is OK:euhmds
-1 2106 HMDS data farm connection is OK:fundfarm
-1 2106 HMDS data farm connection is OK:ushmds
[buf,lh] = TWS.initBufferForEvent(TWS.Events.HISTORICALDATA); contract = com.tws.ContractFactory.GenericStockContract('FB'); contract.secType('STK');
session.eClientSocket.reqHistoricalData(1000001,contract,'20181230 16:00:00','1 Y','1 day','TRADES',false,1,1,[]); 1000001 321 Error validating request:-'bP' : cause - End date not supported with live updates
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@ecpgieicg looks like I didn't update the html
when I did the code updates for v9.73. The actual codes (*.m) in the docs
folder have been updated but the html is stale. I'll try to get that regenerated soon. Apologies for the confusion.
Sounds good. Cheers
Hi Abel,
Thank you for creating and sharing this package.
FYI, v9.72+ reqHistoricalData() requires an additional boolean before the empty list in the input. (Stipulated here.) So in the example,
would need to be replaced with
Your package itself still works smoothly.
Cheers