Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining Futures Contracts #16

Open
bginvestor opened this issue Nov 28, 2017 · 3 comments
Open

Defining Futures Contracts #16

bginvestor opened this issue Nov 28, 2017 · 3 comments

Comments

@bginvestor
Copy link

Hi Abel,

Say, I need a little help with downloading historical FUTURES contract data. Can you please help?
Here's the equivalent commands in IB Trader Workstation format. Thank you!

PS Is there a disconnection command necessary to disconnect a TWS session using your code ? How does that work? Thank you!!!
Brian

symbol = 'ES';
ib = ibtws('',7496);

ibContract = ib.Handle.createContract;
ibContract.symbol=symbol;
ibContract.secType='FUT';
ibContract.expiry='201712';
ibContract.exchange='GLOBEX';
ibContract.currency='USD';

startdate = floor(now)-.5;
enddate = now;
barsize = '15 mins';

d = timeseries(ib,ibContract,startdate,enddate,barsize);
close(ib)

@softwarespartan
Copy link
Owner

softwarespartan commented Nov 29, 2017 via email

@bginvestor
Copy link
Author

bginvestor commented Nov 29, 2017 via email

@deano1949
Copy link

Just a quick comment on this subject...

In order to download expired futures contracts, you have to include m_includeExpired when setting up contracts.
To set 'm_includeExpired=1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants