I understand that you receive the error message related to 'No historical data query found for ticker id:1418'. As per my understanding this error message is provided by IB API and MATLAB just displays the message.
You can consider ensuring the following steps:
- You are using a "non-demo" account with historical data present.
- You have the latest version of TWS API installed.
- Upgrading MATLAB version might also help resolve the issue.
The following MATLAB Answers provide a good resource for understanding similar concerns related to 'ibtws':
The following MATLAB File Exchange submission can also be considered:
Thanks.