Genesis API Questions

Discussion in 'Automated Trading' started by Zlatan, Oct 5, 2006.

  1. Zlatan


    I wrote a system using the basic Genesis API and recently got a demo account to test it. Unfortunatly things went a bit wrong from the off, with the program logging in successfully and receiving quotes but when my test strategy sent an order the gtbPlaceOrder() failed and returned -1. I tried passing all sorts of different arguments but it always fails no matter what I use.

    After trying various things I remembered the demo program that came with the API so I thought I’d see if that works. I built it and ran it and it ran into the exact same problem with gtbPlaceOrder() always failing, so if their program doesn’t work then it’s unlikely to be a problem with the code but possibly with the account. There’s no .pdb with the debug .dll so I can’t debug into it to see exactly why it’s failing so I’m rather at a loss to what to do.

    Has anyone tried their demo program at the below link and if so did it send orders correctly?

    If anyone has a spare minute I’d be grateful if you could download it, build it and run it with a demo account and tell me if it also fails for them. If you don’t have a demo account PM me and I’ll let you know the login for the one I have been given.

    The second issue I have is with the documentation - the names of the servers don’t seem to be defined so I get a lot of unknown servers when I log in as you can see here:

    Below is a screenshot of all the servers defined in the API header file:

    As you can see in the below screenshot my function returns a name for all servers defined in the header file:

    Despite handling all defined servers I’m still getting unknown servers. The documentation for the API doesn’t even cover all the servers in the header file so that’s no use:

    They’re also not documented in the .chm that comes with the API and only the 28 that are defined in the header file are covered.

    Does anybody know where the identity of these unknown servers is documented or if it’s documented at all?

    One final question, as you can see when I log in I get no status report for the major ECNs like ARCA, INET, BRUT etc.

    As you can see from the earlier screenshots there are defines for the major ECN servers so either these have changed and the ECNs are actually the unknown servers or I’m simply not getting a report. Without this status report my program has no way of knowing if an ECN has gone offline which could result in me routing orders to an ECN that is having problems.

    I’d be very grateful for any advice you can offer me with any of these three issues. Thanks in advance.
  2. Hi Zlatan,
    I use Genesis API and I can place orders successfuly, maybe there is something wrong with the way you place the order "post here how you place it" or your login has something wrong that prevent it from sending orders "send me your test login if you would like me to test it on my system"

    Regarding the unknown servers, believe it or not you just have to live with it and believe it or not I asked someone at Genesis about it and he said he doesn't know, anyhow they wont cause you many problems so just pass them for now.
  3. Zlatan


    Thanks a lot for the reply. I would be very grateful if you could test my training account login. I’ll PM you with the login details now.

    As for how I place the order, I’ve tried a massive variety of parameters to the function but it always fails. The TestAPIB project that is distributed with the API has four calls to the gtbPlaceOrder() function and all of them fail as well so I’m not sure that it’s a problem with my code. This is the code from the TestAPIB project that comes with the API and the only thing I have changed it to add the MessageBox lines so I could show it failing:

    Here’s what happens when I run the TestAPIB project and click and order button:

    As you can see it logged in and got a few Level 1 quotes but the order fails.

    With their code failing in the same way I’m rather at a loss so having someone else test the training account login will be extremely useful in narrowing down the cause.

    Thanks again for your help. I’ll send that PM now.
  4. Hi zaltan,
    I just tried your login, it doesn't work !!
    I tried it using Laser and it worked just fine but when I tried it using the API it just doesn't send the orders. Very strange.

    I didn't go through your code since now we have a problem with the login.

    I think you should contact the guy who gave you this login and tell him about the problem
  5. Zlatan


    Thanks a lot for all your help. It was impossible to narrow down with the problem without someone else trying the login so I’m really grateful for that. I’ll get in touch with them and get the account sorted out.

    On a different note, I was trying to sort out the other two issues I mentioned in the first post. With regards to the ECN status it appears that the status is only reported if the ECN is down so the way to handle it is to assume all ECNs are working unless it is reported otherwise. This is not actually documented but is what I have surmised based on watching the status log at the end of the day, since you start to receive reports about ECNs going offline a few hours after the close.

    I still haven’t found the documentation for identity of the additional unknown servers yet. It seems Genesis aren’t too big on documentation.
  6. you are welcomed anytime.

    Don't depend too much on the documentation, unfortunately they lack lots of information.

    you will have to dig your way by try and error.

    Good Luck