Error in getting current data from Interactive Brokers

11 vues (au cours des 30 derniers jours)
Nancy
Nancy le 3 Avr 2015
Modifié(e) : Chris Reid le 9 Avr 2015
I have a problem with the function getdata . Here is my code:
ibContract = ib.Handle.createContract;
ibContract.symbol = 'AAPL';
ibContract.secType = 'STK';
ibContract.exchange = 'SMART/NASDAQ';
ibContract.currency = 'USD';
d = getdata(ib,ibContract)
I have tried symbols of different stocks but the output is always
d =
BID_PRICE: -1
BID_SIZE: 0
ASK_PRICE: -1
ASK_SIZE: 0
LAST_SIZE: 0
Can anyone help me with this problem? Thanks a lot!

Réponses (1)

Chris Reid
Chris Reid le 9 Avr 2015
Modifié(e) : Chris Reid le 9 Avr 2015
Its not an error - you get a response like this if you run the query outside of market hours.
Try it when the exchanges are open.

Catégories

En savoir plus sur Transaction Cost Analysis dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by