The error message "Error using COM.CQG_CQGCEL_4/NewInstrument" typically occurs when there is a connection issue between MATLAB and the CQG realtime data servers. This error can occur due to a variety of reasons, such as network connectivity issues, a problem with the CQG server, or an issue with the credentials being used.
The error "Object is disposed. No method can be called" in the context of connecting to CQG realtime data in MATLAB using the CQG Toolbox typically indicates that the CQG session object has been disposed or closed. This could occur due to various reasons, such as network connectivity issues, invalid login credentials, or timeouts.
To resolve this error, you can try the following steps:
- Check your network connectivity to ensure that you are connected to the internet and that the connection is stable.
- Verify that your CQG API Username and Password are correct and that you have proper permissions for accessing CQG realtime data. You can contact CQG support if you have any issues or questions related to your account.
- Try restarting MATLAB or the CQG Toolbox and reconnect to CQG Realtime Data. Sometimes, simply restarting the application can resolve the issue.
- Disable firewalls: If you have a firewall enabled, it may be blocking the connection to the CQG server. You can try temporarily disabling the firewall to see if that resolves the issue.
- Check if the CQG server is down: Occasionally, CQG servers go down or experience issues that prevent them from functioning properly. You can check the CQG Status page to see if there are any known issues or outages.
- Use the clear command to clear any existing objects related to the CQG session, then try reconnecting. For example:
c = cqgconnect();
clear c
c = cqgconnect();
These steps should help you resolve the issue. If the error persists, you may need to contact CQG support for further assistance.