Signal Entry API using PHP

I am having problems placing orders using PHP Signal Entry API. I can send a URL command. The C2 system reads information and sends out a signal id and stop loss id. I am able to parse the data and return it to my database.



The problem is that I seem to be creating duplicate orders, when I only want one order. I suspect the second order is created when I parse the data. (in PHP I using file_get_contents() function to parse the data)



Any assistance would be greatly appreciated.



Thanks

Chad:



Try adding the following parameter to your API call:



&nodupe=4



(or choose another integer value other than 4; see below).



Here’s why this may help (and here’s what is going on). It appears that the PHP library you are using actually requests the “file resource” twice using GET. Each file “GET” is treated by C2 as an unique API call. This also seems to happen with EXCEL users trying to use our API.



By adding the &nodupe=4 param, you are telling C2 to ignore any duplicate API calls that are sent within 4 seconds of the original request. In theory your parsing request will appear within the timeframe specified. You can shorten or lengthen the no-duplicate window. The units are number of seconds. This must be an integer.



The only problem that might occur is if you do intend to send duplicate transactions (Buy 4 limit 123.4 followed immediately by another exact duplicate Buy 4 limit 123.4). In this case, the second one will be ignored (if it is sent within the first 4 seconds). But this strikes me as very unlikely – why would you send two duplicate orders for the same symbol within a few seconds of each other? – but I thought I would mention this just in case.



Let me know if this helps.

Matt,



Thanks for the assistance. I finally got it work and if I didn’t have to use nodupe function.



In PhP, the program sends two commands to the server. The first is a standard go to this website command. The second command is to go to the server and extract information. From a general perspective they are essential the same (except for the extraction). So I dropped the first command and just used the second command. Dropped the data into a file and parsed the signals back into my database.



I also had few user/beginners errors along the way…



I will be posting the code on my website in the next few days, you are more than welcome to reference if need be? I also don’t know how many people use MySQL / PHP. I think most probably use C+



Oh by the way do you own http://www.youtualfunds.com/ ?



Thanks again.



Chad