# C2 Signal Entry API

**URL:** https://forums.collective2.com/t/c2-signal-entry-api/4745
**Category:** C2
**Created:** [April 20, 2006, 9:31am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745 "2006-04-20T09:31:18Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 20, 2006, 9:31am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/1 "2006-04-20T09:31:18Z")

</div>

Hi,  
  
 Is it possible to request open position status, via C2 Signal Entry API, before executing an API signal entry command?  
  
  
  
Thanks

---

<div class="post-metadata">

### Author: ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)
#### Post date: [April 20, 2006, 9:50am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/2 "2006-04-20T09:50:49Z")

</div>

Currently, you can only request aggregate buying power. The Trade Entry API does not have a command to query account positions or recent executions.  
  
  
  
However, that’s probably a good idea. So I’ll try to add it shortly.  
  
  
  
Keep in mind that, in the meantime, you can always use the AutoTrade API (C2ATI) for stuff like this. It is, however, a step up in complexity. So having a lightweight API call in the Trade Entry API might be a good idea.  
  
  
  
MK

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 20, 2006, 9:58am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/3 "2006-04-20T09:58:12Z")

</div>

How much does the C2ATI cost?

---

<div class="post-metadata">

### Author: ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)
#### Post date: [April 20, 2006, 10:01am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/4 "2006-04-20T10:01:03Z")

</div>

A nice round number. $0.

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 20, 2006, 11:02am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/5 "2006-04-20T11:02:03Z")

</div>

Brill! From where can I download it.

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 20, 2006, 3:47pm UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/6 "2006-04-20T15:47:32Z")

</div>

MK: If possible, I’d like a copy of the C2ATI.

---

<div class="post-metadata">

### Author: ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)
#### Post date: [April 20, 2006, 10:39pm UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/7 "2006-04-20T22:39:51Z")

</div>

Please email me. You have a half-dozen email accounts in my records, but all emails bounce. I need at least one valid email address in order to contact you.

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 21, 2006, 8:07am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/8 "2006-04-21T08:07:49Z")

</div>

Hi,  
  
 Does anyone have a VB code snippet which places a trade via the C2 Signal Entry API? If you do then I’d be grateful if you would share it.  
  
  
  
Thanks

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 21, 2006, 10:07am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/9 "2006-04-21T10:07:46Z")

</div>

```
  Private Sub Form_Load()

```

’ Set a reference to the internet transfer control.  
  
 Set objInet = Me!axInetTran.Object  
  
 End Sub  
  
  
  
 Private Sub cmdWriteFile\_Click()  
  
 Dim b() as Byte  
  
  
  
 ’ Set the internet transfer control protocol and URL.  
  
 objInet.Protocol = icHTTP  
  
 objInet.URL = “[HTTP://www.microsoft.com](HTTP://www.microsoft.com)”  
  
  
  
 ’ Retrieve the HTML data into a byte array.  
  
 b() = objInet.OpenURL(objInet.URL,icByteArray)  
  
  
  
 ’ Create a local file from the retrieved data.  
  
 Open “C:Homepage.htm” For Binary Access Write As #1  
  
 Put #1, , b()  
  
 Close #1  
  
  
  
 MsgBox “Done”  
  
 End Sub  
  
  
  
 Private Sub cmdGetHeader\_Click()  
  
 ’ Set the internet transfer control protocol and URL.  
  
 objInet.Protocol = icHTTP  
  
 objInet.URL = “[HTTP://www.microsoft.com](HTTP://www.microsoft.com)”  
  
  
  
 ’ Open the HTML and display the header information.  
  
 objInet.openURL objInet.URL, icByteArray  
  
 MsgBox objInet.GetHeader  
  
 End Sub

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 21, 2006, 12:00pm UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/10 "2006-04-21T12:00:53Z")

</div>

Hi,  
  
Does anyone have a VB code snippet which places a trade via the C2 Signal Entry API? If you do then I’d be grateful if you would share it.  
  
  
  
Thanks

---

<div class="post-metadata">

### Author: ![CSCS](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/cscs/32/238_2.png) [@CSCS](https://forums.collective2.com/u/CSCS)
#### Post date: [April 25, 2006, 5:13am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/11 "2006-04-25T05:13:22Z")

</div>

Select Project References. In the References dialog box click the Browse button. Navigate to C:WINDOWSMicrosoft.NETFrameworkv1.1.4322. Select the appropriate .tlb file and click Open. Click OK.  
  
  
  
How do you know which assembly to select in Step 4? You need to look up the class of interest in the .Net class library documentation. In the Requirements section, it lists the assembly that contains the class. For example, the SortedList class is in Mscorlib, which means you would select Mscorlib.tlb in step 4 above.  
  
  
  
You also have to register the assembly as a COM object. Unlike standard DLLs, which are registered with the REGSVR32 command line application, your must use the REGASM application that is installed with the .Net runtime. Here’s how:  
  
  
  
Select Run from the Windows Start menu Enter cmd in the box and press Enter. Windows opens a command prompt. Change to the folder C:WINDOWSMicrosoft.NETFrameworkv1.1.4322. Type “regasm system.dll” and press Enter.  
  
  
  
After doing this, you will be able to use some .Net classes as if they were COM objects. You must include the namespace qualifiers when declaring them, because VB6 does not give you the capability to import namespaces.  
  
  
  
To illustrate, let’s use the WebClient class from .Net. This handy class provides the capability to download from and upload to a resource identified by a URL. By using the WebClient class in your program, you avoid the various problems that are known to plague the Internet Transfer control (the usual way to accomplish this in VB6).  
  
  
  
The DownloadFile method in WebClient easily downloads data from a URL and saves it in a local file. This class is in the System assembly, so follow the steps above to add System.tlb to your project references. Be sure to use REGASM to register the assembly as well; you need do this only once.  
  
  
  
Here’s some code that shows how to use this class in VB6 to download an image file and then display it in an Image control:  
  
  
  
Dim wc As System.WebClient  
  
Set wc = New System.WebClient  
  
wc.downloadFile “[http://www.somewhere.com/somefile.jpg](http://www.somewhere.com/somefile.jpg)”, \_  
  
 App.Path & "filename.jpg"  
  
Set Image1.Picture = LoadPicture(App.Path &  
  
“filename.jpg”)When you run the code, the specified image displays in the Image control. Yes, it’s really that simple!

---

<div class="post-metadata">

### Author: ![MarcPerlman](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/marcperlman/32/1487_2.png) [@MarcPerlman](https://forums.collective2.com/u/MarcPerlman)
#### Post date: [June 9, 2006, 10:55pm UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/12 "2006-06-09T22:55:21Z")

</div>

wonder do you have more sample codes for C+++ ? I need to see more sample and able to write my own application for api.  
  
  
  
Thanks

---

<div class="post-metadata">

### Author: ![MarcPerlman](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/marcperlman/32/1487_2.png) [@MarcPerlman](https://forums.collective2.com/u/MarcPerlman)
#### Post date: [June 9, 2006, 10:59pm UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/13 "2006-06-09T22:59:00Z")

</div>

Hello Mark,  
  
  
  
Will you make the program (C2ATI) available for everyone to download from the Collecitve 2 web site? How about a seperate forum exculsively for programming only, anything else can be post on the regular forum.

---

<div class="post-metadata">

### Author: ![EricWagner](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EricWagner](https://forums.collective2.com/u/EricWagner)
#### Post date: [November 21, 2006, 5:59am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/14 "2006-11-21T05:59:56Z")

</div>

Yes Matthew where can I download a sample API of the Order Entry in Basic?  
  
  
  
thanks  
  
Eric

---

<div class="post-metadata">

### Author: ![DuncanMcQueen](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@DuncanMcQueen](https://forums.collective2.com/u/DuncanMcQueen)
#### Post date: [November 21, 2006, 8:21am UTC](https://forums.collective2.com/t/c2-signal-entry-api/4745/15 "2006-11-21T08:21:58Z")

</div>

There are C# samples at my site…you could convert them into [VB.net](http://VB.net)
