softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

Problem with order in braketOrderSample.m #100

Open beppe969 opened 4 years ago

beppe969 commented 4 years ago

Hi First thanks again for this excellent software. I'm trying to get some experience with order placement and I tried your braketOrderSample.m script. However, I get the following error:

No public field m_symbol exists for class com.ib.client.Contract.

Error in bracketOrderSample (line 16) contract.m_symbol = 'SPY' ;

I tried changing contract.m_symbol to contract.symbol but I get the same type of error. Any hint would be appreciated. Thank you!

Giuseppe

Despair2000 commented 4 years ago

This line wasn't updated from the old API version. The newer API requires one of the following syntax': contract.symbol('SPY') or symbol(contract,'SPY')

Both shall work while the later is a little bit faster.

beppe969 commented 4 years ago

I'll try that, thanks!