- 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:
How do I connect to CQG realtime data?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have an active CQG Trader account.
I have follow the instruction on this Link to setup my CQG connection with Matlab.
After that, i have follow the instruction on this page to setup the realtime data:
c = cqg
c =
Handle: [1×1 COM.CQG_CQGCEL_4]
APIConfig: [1×1 Interface.C3E14FEA_ED20_478B_...]
c.APIConfig.TimeZoneCode = 'tzEastern';
startUp(c)
eventNames = {'CELStarted','DataError','IsReady', ...
'DataConnectionStatusChanged','GWConnectionStatusChanged', ...
'GWEnvironmentChanged'}
for i = 1:length(eventNames)
registerevent(c.Handle,{eventNames{i}, ...
@(varargin)cqgconnectioneventhandler(varargin{:})})
end
streamEventNames = {'InstrumentSubscribed','InstrumentChanged', ...
'IncorrectSymbol'};
for i = 1:length(streamEventNames)
registerevent(c.Handle,{streamEventNames{i}, ...
@(varargin)cqgrealtimeeventhandler(varargin{:})})
end
instrument = 'EPU21';
realtime(c,instrument)
cqgDataEZC(1,1)
Error using COM.CQG_CQGCEL_4/NewInstrument
Invoke Error, Dispatch Exception:
Description: Object is disposed. No method can be called.
c.Handle.NewInstrument(s)
It gives me the above error message.
How do I make it work?
0 Commenti
Risposte (1)
Anavi Somani
il 15 Giu 2023
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:
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.
0 Commenti
Vedere anche
Categorie
Scopri di più su CQG in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!