Logs
Hi there, I am really interested by what you have done here!
small stuff: you actually need a export LD_LIBRARY_PATH=pathtoForexConnectAPI/lib/
before using python or you will get: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: XXX.so: cannot open shared object file: No such file or directory
(or possibly move them to /usr/local/lib or smth)
Could you add some logs?
I fail on login with RuntimeError: Login fail. and am sure the credentials are correct.
Cheers!
Thank you, Lepthy.
The message, RuntimeError: Login fail., means python importing is ok, but login session can't get login status.
If you create login session normally, you get the message, [2015-11-27 23:54:04.805880] [0x60d53740] [info] status::connecting before runtime error.
Did you get this message?
Yes importing works fine.
I do no get the [2015-11-27 23:54:04.805880] [0x60d53740] [info] status::connecting message =( the credentials are the same as those from the webapp right?
No, status::connecting message means only connecting login session.
If credentials are correct, you get the message like this,
[2015-11-27 23:53:31.735702] [0x60d53740] [info] status::connecting
[2015-11-27 23:53:33.216418] [0x3be3b700] [info] status::connected
If credentials are wrong, you get the message like this,
[2015-11-28 00:56:59.414207] [0x60d53740] [info] status::connecting
[2015-11-28 00:57:00.100241] [0x3be3b700] [error] Login error:...
Can I see your executed python code and the full log?
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import forexconnect
>>> cl = forexconnect.ForexConnectClient(<account>, <passzord>, "Real")
[2015-11-27 17:56:31.532988] [0x92639740] [info] status::connecting
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Login fail.
This is just taken from your example, did i miss something obvious? (i logged into the webinterface using the same account&password with success)
Thank you. I think the connected URL is wrong. I wrote the URL in forexconnect/src/ForexConnectClient.cpp:8
static std::string FOREX_URL = "http://www40.fxcorporate.com/Hosts.jsp";
If you know the URL you should access, can you try to change the URL and re-install?
If you don't know the URL, please try to execute original cpp samples.
cd ForexConnectAPI/samples/cpp/NonTableManagerSamples/Login/
./fxbuild.sh
cd bin
./Login -l <your account> -p <your password> -u http://www40.fxcorporate.com/Hosts.jsp -c Real
Still no luck it seems
Running Login with arguments:
7200106621 * www.fxcorporate.com/Hosts.jsp Real
status::connecting
Login error: 19915;DAS 19915: ZDas Exception
ORA-20101: Wrong user name or password
ORA-06512: at "E10R2.API", line 429
ORA-06512: at line 1
status::disconnected
Segmentation fault (core dumped)
Good thing is, it's not in your code, ill contact the support, thanks!
Thank you.
Hi neka-nat, starting off I would like to thank you for the great work you are doing. Excellent job!
Currently I am running into a similar issue as the one described by Lepthy. When connecting to my demo account with forexconnect I get the following error message:
cl = forexconnect.ForexConnectClient("myusername","mypassword","Demo")
[2016-01-24 15:44:54.803018] [0xacc76740] [info] status::connecting
Traceback (most recent call last):
File "
I followed your previous advice to execute the original cpp samples and the connection works fine. Any idea what could be the issue here?
Thanks in advance
Hi peterhilde, I'd like you to check the connected URL. I changed how to change the URL. In the latest version, you can change the URL using cmake. Please try the following command.
cd build
cmake .. -DDEFAULT_FOREX_URL="Correct URL"
make install
Hi neka-nat, thanks for the quick reply. I followed your advice to set the URL manually but unfortunately I am getting the same error. When executing the cpp samples directly I use the default URL and that works nicely. Is there any way to print the used URL to make sure it is correctly forwarded internally? Cheers
I update this repository and in the latest version, you can print the used URL to check login parameters. Can you try the following script?
import forexconnect
forexconnect.set_log_level(forexconnect.LOG_DEBUG)
forexconnect.ForexConnectClient("myusername","mypassword","Demo")
Unfortunately no luck so far. I was able to run your updated code and it appears that the credentials are correct. Unfortunately I am not an expert in C++ otherwise I could do some debugging myself. Any other suggestion to solve the issue would be appreciated. Some other observation I am making: When logging in to the demo account with the cpp samples directly I get the following:
status::connecting status::connected AccountID: ---, Balance: ---, Used margin: --- Done! status::disconnecting status::disconnected
Is the immediate disconnection to be expected?
It's working for the cpp samples. I update this repository again to add traceable logs. Can you try the following script again and send the feedback?
import forexconnect
forexconnect.set_log_level(forexconnect.LOG_TRACE)
forexconnect.ForexConnectClient("myusername","mypassword","Demo")
This is what I get:
cl = forexconnect.ForexConnectClient('_','_','Demo') [2016-01-26 17:41:39.388344] [0xc80fd740] [trace] void pyforexconnect::SessionStatusListener::reset() [2016-01-26 17:41:39.388363] [0xc80fd740] [trace] virtual long int pyforexconnect::SessionStatusListener::addRef() [2016-01-26 17:41:39.388368] [0xc80fd740] [trace] void pyforexconnect::SessionStatusListener::reset() [2016-01-26 17:41:39.388372] [0xc80fd740] [debug] user name: *** [2016-01-26 17:41:39.388375] [0xc80fd740] [debug] password: *** [2016-01-26 17:41:39.388378] [0xc80fd740] [debug] url: http://www40.fxcorporate.com/Hosts.jsp [2016-01-26 17:41:39.388381] [0xc80fd740] [debug] connection: Demo [2016-01-26 17:41:39.388390] [0xc80fd740] [trace] virtual long int pyforexconnect::SessionStatusListener::addRef() [2016-01-26 17:41:39.388394] [0xc80fd740] [trace] virtual void pyforexconnect::SessionStatusListener::onSessionStatusChanged(IO2GSessionStatus::O2GSessionStatus) [2016-01-26 17:41:39.388398] [0xc80fd740] [info] status::connecting [2016-01-26 17:41:39.388401] [0xc80fd740] [trace] virtual long int pyforexconnect::SessionStatusListener::release() [2016-01-26 17:41:39.388559] [0xc80fd740] [trace] bool pyforexconnect::SessionStatusListener::waitEvents()
Just dropping by to say that I am following this!
Lephty, glad to hear this might be of relevance to you as well. I highly appreciate the effort neka-nat puts into this one!
Thank you, peterhilde. I checked the log message but I have't understood why it wasn't working yet. I will prepare some test programs and want you to execute them in your environment to solve this issue. Please, wait for several days.
I updated this repository to add checking login code. Can you try to make and execute a program? Please send me the logs.
make
cd forexconnect
./login <username> <password> <url> <Real/Demo>
Just a probably related quote from a recent chat I had with a FXCM person:
"All other servers except servers in Japan TY3 data center, should use http://www.fxcorporate.com/Hosts.jsp "
Below the output when I run ./login. The programme gets kind of stuck as it does not return to the command line. I waited several minutes without any change. It does not make a difference if I use http://www.fxcorporate.com/Hosts.jsp or http://www40.fxcorporate.com/Hosts.jsp although both domains work when running the cpp samples directly.
[2016-02-01 22:06:46.616604] [0x267c1780] [trace] void SessionStatusListener::reset() [2016-02-01 22:06:46.616652] [0x267c1780] [trace] virtual long int SessionStatusListener::addRef() [2016-02-01 22:06:46.616659] [0x267c1780] [trace] void SessionStatusListener::reset() [2016-02-01 22:06:46.616672] [0x267c1780] [trace] virtual long int SessionStatusListener::addRef() [2016-02-01 22:06:46.616680] [0x267c1780] [trace] virtual void SessionStatusListener::onSessionStatusChanged(IO2GSessionStatus::O2GSessionStatus) [2016-02-01 22:06:46.616685] [0x267c1780] [info] status::connecting [2016-02-01 22:06:46.616690] [0x267c1780] [trace] virtual long int SessionStatusListener::release() [2016-02-01 22:06:46.616799] [0x267c1780] [trace] bool SessionStatusListener::waitEvents() [2016-02-01 22:07:16.616909] [0x267c1780] [trace] virtual long int SessionStatusListener::release() [2016-02-01 22:07:16.616927] [0x267c1780] [trace] virtual long int SessionStatusListener::release()