trade ideas window · web viewtrade-ideas window activex control integration manual...

45
Trade-Ideas Window ActiveX Control Integration Manual

Upload: trinhxuyen

Post on 30-Mar-2018

220 views

Category:

Documents


1 download

TRANSCRIPT

Trade-Ideas WindowActiveX Control

Integration Manual

INTRODUCTION..........................................................................................................................................4

DOCUMENTATION OVERVIEW.......................................................................................................................4PRODUCT OVERVIEW....................................................................................................................................4VERSION INFORMATION................................................................................................................................4CONTACT INFORMATION...............................................................................................................................7

RESPONSIBILITIES.....................................................................................................................................7

ACTIVEX RESPONSIBILITIES.........................................................................................................................7HOST APPLICATION RESPONSIBILITIES.........................................................................................................8CERTIFICATION REQUIREMENTS...................................................................................................................8

GENERAL USAGE........................................................................................................................................9

INSTALLATION...............................................................................................................................................9OBJECTS AND COMPONENTS.........................................................................................................................9

Trade-Ideas Alert Control........................................................................................................................9Connection Control................................................................................................................................10Symbol List Control................................................................................................................................11List of Lists Control................................................................................................................................11GenericDispatchX..................................................................................................................................11Status Bar...............................................................................................................................................11

MAJOR INTERFACES....................................................................................................................................12

DETAILED USAGE....................................................................................................................................12

NETWORK REQUIREMENTS.........................................................................................................................12PRODUCT UPGRADES..................................................................................................................................12CONFIGURATION INFORMATION..................................................................................................................13

Saving.....................................................................................................................................................13Restoring.................................................................................................................................................13Duplicating.............................................................................................................................................13Sharing...................................................................................................................................................13Modifying................................................................................................................................................13Field Names............................................................................................................................................13Window Name.........................................................................................................................................14

PASSWORDS AND USER ACCOUNTS............................................................................................................14Symbol Lists............................................................................................................................................14Multiple Users........................................................................................................................................14Web Access.............................................................................................................................................14Account Status........................................................................................................................................14DEMO User............................................................................................................................................14

UPDATING SYMBOL LISTS..........................................................................................................................15Normal Usage.........................................................................................................................................15Starting Fresh.........................................................................................................................................15Names and IDs.......................................................................................................................................15Symbol List Control Objects...................................................................................................................15Bulk Changes..........................................................................................................................................16Connecting..............................................................................................................................................16Reading Values.......................................................................................................................................16Reading Lists in XML.............................................................................................................................17Updating Multiple Users........................................................................................................................17

CUSTOMIZING THE MENU...........................................................................................................................17

TESTING......................................................................................................................................................18

TEST DATA..................................................................................................................................................18

2

SAMPLE SCRIPT...........................................................................................................................................18

DETAILED OBJECT, PROPERTY, AND EVENT DESCRIPTIONS..................................................19

TRADEIDEASWINDOWX..............................................................................................................................19Properties...............................................................................................................................................19Methods..................................................................................................................................................21Events.....................................................................................................................................................21

STATUSBARX..............................................................................................................................................22CONNECTIONCONTROL...............................................................................................................................23

Properties...............................................................................................................................................23Methods..................................................................................................................................................26

SYMBOLLISTCONTROL...............................................................................................................................27Properties...............................................................................................................................................27Methods..................................................................................................................................................28Events.....................................................................................................................................................28

LISTOFLISTS...............................................................................................................................................29Properties...............................................................................................................................................29Methods..................................................................................................................................................29Events.....................................................................................................................................................29

GENERICDISPATCHX...................................................................................................................................30Properties...............................................................................................................................................30Methods..................................................................................................................................................30Events.....................................................................................................................................................30

ALERTDATA................................................................................................................................................30Properties...............................................................................................................................................31

Issues..............................................................................................................................................................31

3

Introduction

Documentation OverviewThis document describes how to integrate with the Trade-Ideas ActiveX Control. This control is a way to view the same alerts that are available on our web site, but in a way that is easy to embed into other software.

Product OverviewThe primary purpose of this control is to allow other companies to integrate with our data with a minimum amount of effort. This control can be embedded into virtually any MS Windows application written in C++, Visual Basic, Delphi, or similar tools. The Trade-Ideas name is not visible to end-users.

The ActiveX control can be embedded in, among other things, a web page. We sometimes do this for tests and demonstrations because JavaScript is so simple. However, if you want to develop a product using our alerts in a web page, please contact us about HTML solutions, which may be more appropriate.

A variety of sample applications in different programming languages are available from our web site.

Version informationThis describes version 4.3.0 of the product.

Version Changes1.0 This version number describes a series of alpha and beta releases before we started strict version

controls.1.1 This is the first official release of the product. All features have passed initial testing and are

stable.1.2 Removed some unused interfaces and unnecessary DLL requirements. Added better error

checking, including verifying that that the list id was a positive number. No change in functionality.

1.3 Improved scrolling algorithm. This version will always show the most recent alert, like previous versions, if the most recent alert was already visible. If the user scrolls to anything else, the software will automatically scroll to keep the same alerts visible as new alerts are added to the top. No change to the API for this GUI change.

Added OnNewAlert event. The host program can receive a callback on each new alert received. Added NotifyOnEachAlert flag which must be turned on to use OnNewAlert. This preserves performance and binary compatibility for old code host code which does not require this event.

1.4, 1.5, 1.6

Development / test releases. Not for end users.

1.7 Added the ShowConfigWindow function. This is useful is the alerts window is hidden.

Added the IconDirectory property. Set this property to access the images that represent each alert type.

Added the SendFakeAlert function. This is useful for testing the software after hours, when real data is not available.

Added the CurrentAlert* properties. These provide an alternate way to receive data in the callback functions.

1.8 Added the ListOfLists object, accessible from the controller.1.9 Added the ability to request the contents of a list from the server via the SymbolListControl.

Added the ability to delete an entire list, not just its contents, via the SymbolListControl.

4

Improved the compression between the client and the server.1.10, 2.0

Development only

2.1 Added GenericDispatchX object.2.2 Added support for customizing the menu.2.3 Added the ApiDir property.

Added improvements visible to the user, which do not change the API: A broken network connection is detected and fixed more quickly. Added the ability to change the color scheme of the alert window. Added the ability to change the direction that the alerts move in the alert window. Added the collaboration feature in the alert window. Added the "samples" menu to the alert window. Added the double-click feature to the header row in the alert window. Removed flickering which occurred in certain specific cases in the alert window.

2.4 Added the window name property.Added the DeleteAllLists method.User can now resize the description row.

2.5 Performance enhancements. No changes to the GUI or the API.2.6 Development only2.7 GUI Improvements:

Added "Recent Settings" menu. Added icons to the "Samples" menu.API Improvements: Added the ability to listen for a single-click or a double-click on an alert. The default is still

double-click. See the AllowAlertSelectionType and CurrentAlertSelectionType properties. Added the VendorID property. Added the AddContextSensitiveMenuItem method and the associated callback. Added the AddCustomMenuItemToTop method. Added the OnBeforeModal callback, to warn the host program before displaying a modal

dialog box. Added the OnAccountStatusChanged callback and the so the host program will know when

to prompt the user for a username and password. Added the MinTimeout, ExportPrefix, DevelopmentUsername, and DevelopmentPassword

properties.2.8 GUI Improvements:

Added formatting and context to the "Quality" column. Added the weekly and daily chart columns.Bug Fixed: The status light is now red until the first request for alerts. It was previously green when we

first started. In certain cases it would stay green even if the user entered a bad user name.API Improvements: Added http://www.trade-ideas.com/API2/AX_AllSymbolLists.html.

2.8.1 Bug Fix: Version 2.8 introduced a bug. Under Windows NT the software did not display icons property. This bug was not visible under Windows XP. This bug was fixed in this release.

2.9 Added AccountExpires property to API2.901 Added the following properties to the Connection Control object: AdditionalSamplesUrl,

HideNormalSamples, and HideConfigWindow.2.902 Added support for AlertWindow.ini to the Connection Control object.3.0 GUI Improvements:

Added the row at the bottom which displays the description of the selected alert.API Improvements: Added the FontColor property.

3.1 Bug fix:In certain cases, if you created multiple symbol list objects at the same time, the application

5

would hang. This bug was fixed.3.3 Added Count and DayRange fields to the AlertData object.

Added SocksHost, SocksPort, SocksVersion, SocksUserName, and SocksPassword properties to the ConnectionControl object to support a SOCKS proxy server.

3.4 This version of the software connects to our new server. This is more efficient for the client and our server.

This looks generally similar for the end user, but he will see a few improvements. A user can now log in with the username "DEMO" and any password and see limited samples of our data. If a user is not logged in as DEMO, the data will appear noticeably more quickly than before. Each alert window will display a limited amount of history when it first starts.

There are no changes to the API.3.4.1, 3.4.2

Performance improvements.

3.4.3 Bug fix. There was a problem in the IconDirectory property.3.4.4 Bug fix. Sometimes the application would crash when shutting down. This happened most

often when there was a network problem, like setting the proxy host incorrectly. However, it is possible for this to happen at other times.

3.5 Bug fix: People in some countries could not see any data. This had to do with the locale setting.New Properties: UseHttpTunnel HttpTunnelAddress TcpIpServerAddressThis gives people additional ways to get around a firewall.

3.5.1 GUI Improvement. There are now more icons on the "samples" menu.3.6 Added the history feature. This is available in the GUI on the pop-up menu, on the

"History" sub-menu. Added new HistoryType field to the IAlertData interface. Added new warning related to history in the detailed description of NotifyOnBeforeModal

in this document.3.7 Development release only.3.8 Bug fix:

Config window had intermittent problems in some locales.New properties:

HelpMode TimeOffset ShowGrid TimeFormatList

3.9 Bug fixes: OnBeforeModal was broken in a recent release, but is working again now. If a user displayed enough charts, the software would slow down and/or not display

new charts. That is now fixed.Documentation changes:

Minor corrections to the description of AlertWindow.ini. Added certification requirements.

3.9.1 Recovers from certain types of network errors more quickly. Does not print “NAN” in the CSV file when you say “Save Contents…”

4.0 GUI Changes: Added panels for the odds maker. New config window.

New Properties: BaseWindowName

Other changes: AdditionalSamplesUrl

6

HideNormalSamples4.0.1 No changes to the API.

Bug fixes: The previous version would not work on the Chinese version of Windows XP. The pervious version used HTTP for some obscure features. This version only uses the

new, more robust connection, unless you configure it otherwise. The old version would not always display the charts properly if you switched between

DEMO and a real user account. 4.0.2 No changes to the API.

This includes several bug fixes and new features. This is the version used in Trade-Ideas Pro 2.1.

4.1.0 New properties: IAlertData.Volatility IAlertData.StandardDeviation

4.1.1 New properties: IConnectionControl.HelpURL ITradeIdeasWindowX.StrategyConfig

4.2.0 New method: IConnectionControl.RecordExecutionMessage

Minor bug fixes and changes: Select & focus Window Name edit field when “Window Name” page is automatically

selected Use correct socks proxy password The selected tab of the Configuration window is highlighted Custom icon provided by host application is used for all dialog windows inside ActiveX

4.3.0 Added SetCustomIcon method

Last update to this document: 9/5/2007

Contact Informationhttp://www.trade-ideas.com/ForDevelopers/[email protected]

ResponsibilitiesThis ActiveX control was designed to be dropped into another application with a minimum amount of effort. In some areas the ActiveX control is completely self-sufficient. In other places the developer of the host application has to do work. This work is limited to items that are required for meaningful integration. If you don't want to do this work, consider using the web based version or Trade-Ideas Pro, which are already a complete products. If you want this to look like it is your software, not ours, ask us about a white-labeled version of Trade-Ideas Pro.

There are numerous options listed below in the ActiveX control's API. Some host applications will do more or less in particular areas. Some will do things in a different way. These lists only show the minimum effort required to make a useful combination of the ActiveX control and a host application.

ActiveX Responsibilities The ActiveX control works like the main alert window in the web-based version of the product.

http://www.trade-ideas.com/View.php?O=300000000030_1d_0. It automatically and continuously requests data from the server and displays it on the screen.

The ActiveX control allows the user to change some options. The user can change the layout of the control and/or the data requested and displayed by the control. This corresponds to the configuration web page. http://www.trade-ideas.com/Config.php. This requires no work on the part of the host application.

7

Host Application Responsibilities The host application will have to create one or more windows that include the ActiveX control. There

can be multiple copies of the ActiveX control, each showing different data. These windows should be created and the layout information should be saved just like any other windows in the host application. These windows should have all the same features, like "free floating," as other windows in the host application.

When a user double-clicks on an alert in the ActiveX control, the control notifies the host application. The host application should update other windows based on the stock symbol. The details can depend on the host application. This typically looks like the normal grouping features that already exist in the host application. This reduces the number of steps required between a user seeing an alert and that user buying or selling stock. This is the primary reason why a broker would want to do this integration.

The host application typically manages many symbol lists. Examples include the users' portfolio data, the contents of a market view window, etc. The host application should give copies of these lists to the ActiveX control. The user can then use these lists as part of the configuration of the control. The details will depend on the host application. This feature corresponds to the Personal Symbol Lists web page. http://www.trade-ideas.com/EditSymbolLists.php. However, if the host application only creates a copy of this web page, rather than giving the user access to lists that already exist, consider just using the web based version of the product. Note: A program can send symbol lists directly to the web-based product, without using the ActiveX control. See http://www.trade-ideas.com/Integration/#Upload for an alternative.

The host application will have to supply a Trade-Ideas username and password to the control. Note that the same accounts, passwords, and usernames can be used by either the ActiveX control or the web based version of the product. The user can switch between the two environments at any time. Some host applications manage these usernames and passwords completely internally. Others allow or require the user to update these values. This typically depends on who will be paying for the account, the user or the broker.

The host application should save and restore configuration information. The user can reconfigure the control any time it is visible. Whenever the host application saves the layout, it should ask each control for a copy of its configuration information, and save that information with the rest of the layout. Whenever the host application loads a layout, it should give the configuration information back to the control.

Detailed instructions for accomplishing these tasks and others are listed below.

Certification RequirementsTrade-Ideas requires that standard benchmarks be achieved (see Integration Matrix below) in this integration process to ensure maximum trade lift benefits to brokers as well as superior customer satisfaction to their clients.

REQUIRED: SILVER CERTIFIEDSUPPLY USERNAME AND PASSWORDHOST APPLICATION WILL NEED TO SUPPLY A TRADE-IDEAS USERNAME AND PASSWORD TO THE CONTROL. IF NOT LIVE BY DEFAULT, SUPPLIED USERNAME = DEMOPOINTER ON WHERE TO SIGN UP NEXT TO USERNAME LOGIN IF NOT AUTOMATICALLY SUPPLIEDDEFAULT ALERT WINDOW THAT INITIALLY LOADS WITH A CONFIGURATION THAT GENERATES ALERTSTHIS SHOULD NOT BE BLANK RATHER A CONFIGURATION THAT IS A GOOD STARTING POINT.LINK TO OTHER HOST APPLICATION WINDOW COMPONENTSWHEN A USER CLICKS ON THE ALERT GENERATED FROM THE ACTIVE X CONTROL, SYMBOL SHOULD BE SENT TO HOST APPLICATION FOR LINKING TO INTERNAL

8

COMPONENTS.SAVE LAYOUT WINDOW POSITION(S), COLUMNS, LAST ALERT SETTING(S)DISPLAY TI WINDOW NAME IN HOST APPLICATION’S WINDOW TITLE BAR

CREATE, EDIT, LOAD AND SAVE CUSTOM SYMBOL LISTSREAD PORTFOLIO LIST(S) INTO SYMBOL LIST(S) OF TRADE IDEASLONG, SHORT, ALL

ABILITY TO CREATE MORE THAN 1 ALERT WINDOW IN A LAYOUT

RECOMMENDED: GOLD CERTIFIED

SET WINDOW AS DEFAULT

CONFIGURE FONTSSAVE / LOAD ALERT WINDOWCONFIGURATION SETTING, COLUMNS, COLOR, FONTDUPLICATE ALERT WINDOWALLOW FOR EASY DUPLICATION OF A CONFIGURED ALERT WINDOW

OPTIONAL: PLATINUM CERTIFIEDMARKET VIEW / STOCK LIST INTEGRATIONMIRROR HOST APPLICATIONS SYMBOL LISTSTATUS INDICATORPROVIDE STATUS INDICATOR BETWEEN ACTIVE X CONTROL AND SERVERALERT WINDOW ACTIONSBEEP ON ALERT, SHOW ALERT WINDOW, SINGLE/DOUBLE-CLICK LINKING CONFIG

ADD ALERT SYMBOL TO MARKETVIEW WINDOWADVANCED NOTIFICATIONCUSTOM AUDIO ALERT / CUSTOM POP-UP

General Usage

InstallationThis package is delivered as a single file, TradeIdeasWindowProj1.ocx.

Add this file to your visual development environment as you would any OCX file. In Delphi you do this by selecting "Import ActiveX Control…" from the "Components" menu, and following the prompts. Be sure your install program is also aware of this OCX file.

Objects and ComponentsThe ActiveX control automatically connects to the server when it needs to. The connection typically stays up as long as at least one of these objects exists. The connection is automatically goes away when the last of these objects is destroyed.

Trade-Ideas Alert ControlThe primary component in this library is the Trade-Ideas alert control, shown here.

9

This control should appear on your tool palette when you install the OCX file. Use your standard GUI tools to create and manipulate this control.

This should work just like a button, a panel, a text entry box, or any other standard control. You can mix this with other controls, or make a window with just this control.

This control includes a callback. Any time the user double-clicks on an alert, the window will notify any registered listeners. Typically the host application will include this control in a group, just like graphs, execution panels, etc. Double-clicking on an alert will cause the symbol to be loaded into the other controls in the group. This is implemented as a standard ActiveX event.

Connection ControlAll windows in the application are controlled though one common connection. You can create multiple ActiveX windows to access this control, but they will all perform the same functions and they will all report the same status.

The primary purpose of this control is to allow you to enter a username and password. You can also input proxy info, select a server, access the symbol list controls, etc.

By default the control has no username or password. It will not be able to access any data until you set these fields.

There are two ways to access this object. Create an OLE object with the class named "TradeIdeasWindow.ConnectionControl". Or read the "Connection" property from any alert control.

The first time you create a connection control object, the software automatically looks for a file named AlertWindow.ini. It looks for this in the same directory as the OCX file. If this file exists, the software reads the section labeled "[ConnectionControl]". For each item in this section, it tries to find a corresponding property in the Connection Control object, and set that value of that property accordingly. This allows the user to take advantage of new features of the ActiveX control without getting a new version of the host software. For example, add a line "MinTimeout=20000" if you have a very bad internet connection and you want to wait 20 seconds before you give up on the network connection.

10

Symbol List Control

Use a symbol list control object to update a symbol list. Use the SymbolList property of the connection control object to create symbol list control objects. Create at least one symbol list control object for each list of symbols you need to update.

Symbol lists can contain anything. Typically the software will maintain 3 symbol lists: All long positions, all short positions, all recent positions.

More details are listed below.

List of Lists ControlThe list of lists control is a way to ask the server for the names and ids of the user's symbol lists.

In the simplest case Trade-Ideas contains a mirror of the host application's symbol lists. In this case, the host can always use the same names and ids for the symbol lists. For example, the list of long positions might always be list 2, and the list of short positions might always be list 2.

In some cases, however, the user might create lists using the web based interface, and might also use the host application. The host application might want to see which lists already exist. The application can look for the list named "long positions". If it doesn't find a list with that name, it can create a new list using the next unused list id number.

GenericDispatchXThis control gives the developer another way to receive events from the Symbol List Control and the List of Lists Control. Because this is a standard ActiveX control with a GUI, the developer can insert one of these into a project just like the main alerts control. The compiler will then make it very easy for the developer to attach event / callback code.

This visible part of the control is only useful for developers. The control looks like a button, but pressing it does nothing. The caption on the button shows a debug message describing the last event. In production code this object should always be invisible.

The developer can create any number of these objects. Each of these objects will report all events.

Status BarThis should also show up as a tool on your tool palette. This monitors the connection between the ActiveX control and the server. You can create any number of these, but they all show the same status.

When the sphere representing the current state turns red, to show the server disconnected the ActiveX control, the user can double click on this to reconnect. Alternatively, the host program can add a different GUI, and access the Reset function of the Connection Control.

When a user logs on to a new machine, without logging out of an old machine, the software on the old machine is cut off. When the user returns to the new machine he needs a way to reconnect. He can double-click on the red circle, go through some other GUI to get to the reset function, or shutdown and restart the host application.

11

Major Interfaces

Trade-IdeasServer

EndUser

HostApplication

Trade-IdeasActiveXControl

1. Stock Selection

1. Stock Selection

2. Alerts Data

2. Alerts Data3. FilterSelection

3. FilterSelection

4. StockLists

4. StockLists

1) The end user can double-click on an alert to load the symbol into a window in the host application. This should be similar to the way that windows in the host application integrate with each other. This is the most important part of the integration. Our largest value proposition to the broker is "two clicks to a trade." Double click to send the stock symbol from the alerts window to the execution panel, graph panel, etc. Then click on the buy or sell button.

2) The alerts server sends the alerts data, and the ActiveX control displays it for the user.3) The ActiveX control provides a configuration window to the user, and sends the result to the server.

(The server does the filtering, to reduce the bandwidth and processing requirements on the client.)4) The host application sends stock lists through the ActiveX control to the server. These can be

anything. Typically we get a list of short symbols, a list of long symbols, and a list of recently traded symbols. The host application can also request symbol lists from the server, however this should be minimized for simplicity. The simplest option is for the Trade-Ideas server to contain a mirror of the symbol lists that the host application is already maintaining.

Detailed Usage

Network RequirementsThe ActiveX control communicates with our servers over an HTTP connection.

If port 80 is open, there should be no problems. Alternatively, the control can go through a standard HTTP proxy using basic authentication. Set the proxy settings on the Connection Control object.

Product UpgradesMany server upgrades do not require a corresponding client upgrade. In particular, new types of alerts, and new types of filters are instantly available to the user.

12

Each time you receive a new version of the OCX file, to be on the safe side, you should re-import this into your development tools. Ideally, newer versions of the OCX can replace older versions without re-importing or recompiling, but you will not be able to access the new features that way.

Configuration InformationConfiguration information is divided into two pieces. There is the data request (alerts, filters, etc) and the layout (column order, column widths, etc).

SavingThe host application should save this information just like it saves any other layout information (i.e. open windows, current stock symbols, type of graph).

The host application can read this information from two properties on each alert component. These properties will pack the config information into a string. This string will have no meaning to the host application, and should be saved verbatim.

RestoringSet the string properties which were saved earlier.

The control automatically takes care of the details of upgrades. Do not worry about old versions of the config info.

DuplicatingIt is perfectly legal to send the same config info to multiple controls at the same time. In fact, it is encouraged. We often find it helpful to give the user an option to duplicate a window with the exact same configuration. Just read the config info from an existing control, create a new control, and set the config info to match the original control.

SharingConfig info can be shared between users. Config info can reference symbol lists (like show me all the running up alerts on my short positions) but they will not contain the list (so each user will get his or her own list of short positions).

Config info is ugly, so the user shouldn't be exposed to it in its raw form.

ModifyingThe only legitimate way to modify the configuration of a control is through our GUI. The user can drag columns to change the layout. The user can right click on a control to access the config window and change the alert types, filters, etc.

Field NamesThe DataConfig property holds a description of the filters. This is what the users are mostly to want to save, name, and/or share. This is analogous to the URLs in our web based product.

The WindowConfig property holds a description of which fields are visible, etc. This should be saved with standard layout information. Otherwise there is no specific need save, name, or share this information.

The StrategyConfig property holds configuration of OddsMaker module. OddsMaker is a special part of ActiveX for calculation of the odds of winning trades on any alert and filter combination. More information about OddsMaker is available at http://www.trade-ideas.com/OddsMaker/Help.html.

13

Alternatively, the host software can save and restore all information about the control at once. There are several standard ways to do this in ActiveX.

Window NameThe window name is a special part of the DataConfig property. The host application may want to display this in the window's title bar.

The window name is directly attached to the DataConfig so that the user can select a window name at the same time as he selects data. The window name typically describes the data. The predefined samples come with window names matching the names that appear on the menu. The user can change this name in the configuration dialog box.

The host application can ask for the window name property at any time by examining the WindowName property of an Alert Control.

The host application can register a callback function for when this value changes. This value can change at any time. The user typically initiates the change. But the property does not actually update until server acknowledges the change, and starts sending the new data. The callback is made immediately after this value changes. Use the WindowNameChanged event to listen for these changes. Be sure to set the NotifyOnEachWindowNameChanged property to true to see these events.

Passwords and User AccountsTo access any data, you need a user account and a password.

Symbol ListsAll symbol lists are associated with a user account. These are considered sensitive information, so we always protect them with passwords.

Multiple UsersOnly one person at a time can access a user account. If you try to access an account from a second computer, data will be shut off on the first computer. If you try to launch multiple copies of the application on the same machine, only the last one will get data.

Web AccessAn account for our normal web and an account for this product are one and the same. The user can freely switch between the two. The user cannot log into both at the same time.

Account StatusThe API provides account status information. If the user is expected to pay for his own account, the host application should provide this information to the user. The AccountStatus, AccountStatusAction, and AccountExpires properties provide this information.

DEMO UserThe special user name “DEMO” will allow limited access to the software. The password is ignored in this case.

14

Updating Symbol Lists

Normal UsageNormally the symbol lists are maintained in two phases. When the user first starts the software, the software will send complete copies of each list to our server. Then, when the user's portfolio changes, the software sends just the changes to our server.

Starting FreshThe host application should treat Trade-Ideas just like any other data feed, when it comes to symbol lists. The host application already has various symbol lists specific to each user. Some of these come from the users' portfolio, some come from lists that the user has manually entered into other windows, etc. The host application should send these symbol lists to Trade-Ideas, so that Trade-Ideas can make them available to the user, and show the user data about his symbols.

Trade-Ideas is different from a lot of data feeds in an important way. If the connection to the Trade-Ideas server is broken, the Trade-Ideas library will automatically try to reconnect, and the Trade-Ideas server will remember the symbol lists. The host application does not have to monitor the connection, and it does not have to send any additional data when the connection is restored.

As a consequence, the host application must tell the Trade-Ideas when to start fresh. Typically the host application should send a DeleteAllSymbolLists request when it first connects to the Trade-Ideas server, then send current copies of the user's symbol lists. It should also do this whenever it updates the username and password, possibly switching to another account. At all other times, the host application should just notify the Trade-Ideas server about incremental changes to these lists.

Names and IDsEach list contains a human readable name, and a numeric ID.

The ID must be a positive integer. IDs are unique. If two list control objects refer to the same ID, they will write to the same list.

IDs are never directly displayed to the user. However, when the user sees the lists available to him, they will always be sorted by ID. When the user chooses a list, the software stores the ID, not the name. So, if the name changes, it doesn't matter.

If users share a window configuration, they will share the ID number of the list. So the ID numbers should be consistent for all users, if that makes sense. For example, 1 should always be long positions, 2 should always be short positions, etc.

Names can be anything, but only printable characters make sense. There is no command to explicitly change a name. Each time you update a symbol list, you implicitly send the name. Names can be duplicates, although that is not recommended. The software keeps track of them by ID, and displays them by ID, so things will still work.

Symbol List Control ObjectsEach symbol list control object is a connection to a list on the server. This object is the only way to change a list. Typically the host software will create a small number of these at initialization time, one for each list. The name is set at initialization time.

Duplicates object can exist. These objects can be created and released at other times. The previous description just describes the common case.

15

Use this object's AddSymbol and DeleteSymbol methods to add and delete symbols from the list. Adding a symbol which already exists does nothing. Deleting a symbol which does not exist does nothing.

Bulk ChangesThere are several ways to add and remove multiple symbols at one.

If you just have several add and delete requests, you do not have to do anything special. The software automatically groups these requests if you send them to the ActiveX control faster than the ActiveX control can send them to the server.

If you want to completely replace the current list with a new list, you have multiple options.

The easiest way to update an entire list is as follows. First use the Clear method to delete the current contents of the list. Then use AddSymbol to add each symbol. The disadvantage of this method is that it is not atomic. This is not usually a problem because you normally only do this at initialization time, before the user has requested any data.

The other alternative is to create a working copy of the list before you send it. Each symbol list control object contains a work list. If multiple objects each point to the same list on the server, the objects still have their own separate work lists. Use the AddToWorkList method to add each stock symbol. As always, duplicates are ignored. Call SendWorkList to replace the current list on the server with the work list. This is atomic, the control will always use the old list or the new list, never anything in between. ClearWorkList is available if you change your mind in the middle of creating a work this. This is seldom required. New symbol list control objects always start with empty work lists, and the work lists are automatically cleared when you send them to the server, or when you release the object.

ConnectingAs described above, the software will automatically disconnect from the server whenever the host application releases all ActiveX objects. The software will not wait for any requests to complete. All requests are performed in a separate thread to ensure that the GUI can continue operating before the request has seen sent, well before the request has been honored and confirmed.

If you create a list object, send a request to update the list, then release the list object, the request might not succeed before the connection is broken.

The proper way to deal with this is to ensure some object stays alive between when you start initialization and when you finish initialization. It often makes sense to create the connection control object once, and store it in a global variable for the lifetime of the program. Any object will do, but this one is often the most convenient.

Reading ValuesIdeally the host application will already have it's own symbols lists, which it will copy to the ActiveX control as needed. The ActiveX control will send this to the Trade-Ideas server. It is also possible to read values back from the server to the host using the ActiveX control, but this should be done sparingly.

In the simplest case, the host application will always have a small, fixed number of lists. On startup the host application can create a fixed number of list control objects, one for each of these. For example, list #1 can always be named "Long Positions", list #2 can always be named "Short Positions", etc. In this case the host application does not have to read anything from the server.

The lists of lists objects can be used to clear out old lists. This might be useful if you allow the user some freedom in creating lists, and you want to start fresh when you start the host application. If the user has some freedom in the names of the lists created, there must be some way to delete old lists. Additionally,

16

this allows the client application to remember the names of the lists, not the ids. In some cases this may create a simpler design.

If the user is allowed to create lists with another application, or with the trade-ideas web site, the host application might not want to overwrite these lists. This is generally discouraged as it adds a lot of complication and very few users would take advantage of this. However, the developer can use the list of lists object to find the next unused id so nothing is overwritten. Also, the application can use list names to overwrite or update specific lists.

The host application can also read the individual stock symbols from a list. This is very strongly discouraged.

Reading values from the server is more complicated than setting these values. For one thing, you can set values in a simple function call. If you want to read values, you have to place a request, then poll or write event handlers to receive the data later. This is usually fast, but can take any amount of time. Also, if you send values to the server, then shut down, there is no good way to ensure that the update reached the server before the application shut down and the request was aborted. If you keep a copy of the symbols on the client side, this is not a problem because you will send another copy of the lists the next time you start the application.

Reading Lists in XMLThere is an alternative way to read the list of symbol lists and the individual names. This information is all available over the web in an XML document. Look at http://www.trade-ideas.com/API2/AX_AllSymbolLists.html.

To use this data, send the "username" and "password" fields. Send these as cookies, form POST data, or form GET data.

The easiest way to explore this option is to display the data in a web browser. First log in at http://www.trade-ideas.com/Login.php then look at the page with the data. This will send the username and password fields as cookies.

This provides an alternative to the methods described in the previous section. Both options allow you to read all of the users symbols and lists. The previous option worked through this ActiveX control. This option requires you to download the data yourself, over HTTP, and use an XML parser to access the data. There are numerous tools available to do this for you.

Updating Multiple UsersIf your goal is to send the same symbol lists to multiple users, there are alternatives. You can use this API to send the same list to each user, one at a time. Or we can set up the accounts to all share some symbol lists. You will make the change for one user. You can change the lists any way you please, including this API or the web interface. All of the other users in your group will instantly see the change. Ask us if you need to set up this type of group.

Customizing the MenuThe main alert control contains a popup menu, as shown below. The control automatically handles these standard items.

17

A developer can add items to the main popup menu. This allows the integration to appear more seamless. These can only be simple items. Only text is allowed, not checkmarks or pictures, or submenus.

Use the AddCustomMenuItem method of the alert window to add a new item. Each item will be added to the bottom of the main popup menu, in the order in which they were added. The developer must specify a string to display and an id number for the menu item. The user sees the string. The callback will give the string and the id to the developer. The id is only used in the callback, and can have whatever meaning the developer needs. Each window can have different custom items.

These strings are interpreted in the normal windows way. Use "-" to specify a horizontal line. Use "&&" to display a single "&".

OnCustomMenuItem is the callback when the user selects a menu item.

AddContextSensitiveMenuItem is similar to AddCustomMenuItem but more powerful. This allows you to add an item like "Buy DELL at market price", where the ActiveX control automatically fill in "DELL" with the stock symbol under the mouse. If the user selects this item, the callback will include the details of the alert. If the user right clicked on part of the window that did not contain an alert, these items are disabled. The callback for these events is OnContextSensitiveMenuItem.

Testing

Test DataBy default this control is attached to our live/production server. If required, it can also attach to a test server. The test server supplies data which is usually correct during market hours, and often spits out random data after hours.

Sample ScriptOur web site includes an HTML file which shows how to use most of the features offered by the ActiveX control.

To use this, first manually install the ActiveX control on a machine. Again, this is available on our web site in the developer’s toolkit page.

18

This HTML file shows how to access the control using JavaScript. We chose JavaScript for the demo because the result is so short and you can see what it takes to access the control with the fewest distractions. The code should be similar in other development environments.

This sample exposes each of the interesting commands directly to the GUI. Normally these items would be automated, and the user would not have to see them, or hit any buttons to start them.

Detailed Object, Property, and Event DescriptionsThis is included just for a quick reference. For a complete list of objects, properties and events, use your development tools to interrogate the OCX file. This should be automatic when you install the OCX file into your development tools. For a more detailed description of each object, property, and event, read above.

TradeIdeasWindowXClass GUID : {E940966A-5FEE-47AA-8EDF-324E45D9AFAE}

PropertiesProperty Name DescriptionVisible Standard / Compiler generated. Best to avoid these. These may become

deprecated in a future release.AutoSizeColorKeyPreviewPixelsPerInchPrintScaleScaledActiveHelpFileDoubleBufferedAlignDisabledEnabledCursorHelpTypeHelpKeywordAxBorderStyle Standard / Compiler generated. Creates a border around the control.Font Standard / Compiler generated. Sets the font used by the control. FontColor This sets the foreground color of the font.

This is an integer. The least significant byte is the red value, 0-255. The next byte is the green value. The next byte is the blue value. The most significant byte is reserved and should be 0.

The top heading row or column never uses the FontColor, and ignores some of the other font settings. The body of the table may also ignore the color and some other settings, depending on the user's selection. This will be used if the user selects "Simple Colors". The bottom row of the table will always use this color.

Connection This is one way to access the global ConnectionControl object.DataConfig This describes the data requested by the user through the config window.

This is a magic cookie. The only valid way to set this property is to read in a value from the property, and save it for later.

You can also interchange values from this property and the "Collaborate…" window. These two sources produce results that look slightly different, but they

19

are compatible.WindowConfig This describes the GUI settings made by the user. This includes, for example, the

width of the columns.

This is a magic cookie. The only valid way to set this property is to read in a value from the property, and save it for later.

NotifyOnEachAlert Set this to true if you wish to receive the OnEachAlert event. By default this is false. It is functionally correct to make this true at any time, but there is a slight performance advantage to leaving this off if you don’t need it.

CurrentAlert This is the same as the value in the OnAlertSelected and OnNewAlert callbacks. The perferred way to access this data is directly from that callback. However, in some development environments, that value is hard to access, so this is a copy.

CurrentAlertSymbol These provide yet another way to access the data from the OnAlertSelected and OnNewAlert callbacks. These expose each field of the alert separately. Again, the preferred way to access this data is to use the object delivered in the callback.

CurrentAlertTypeCurrentAlertTimestampCurrentAlertAltTimestampDescriptionQualityRelVolHelpUrlIconUrlWindowName This read only property is the recommended name for the window. The samples

come with window names. Imported settings come with a window name. The user can change this value in the configuration window. Also see the OnWindowNameChanged event.

BaseWindowName This read only property is similar to WindowName. This is based strictly on what the user requested for the window name. WindowName also includes the current state of the window, such as whether the window is loading history or watching real time data. Like WindowName, you will know when this property changes if you listen for the OnWindowNameChanged event.

NotifyOnWindowNameChanged

Set this property to true if you want to see OnWindowNameChanged events. This defaults to false to be compatible with older versions of the library.

AllowSelectionType This property allows you to control when the OnAlertSelected event is fired. Select one of the following: astNone (0) - The event is never fired. astSingle (1) - The event is fired when the user clicks on an alert once. astDouble (2) - The event is fired when the user double-clicks on an alert.

This is the default. astBoth (3) - The event is fired on a single or double click. Use the

CurrentSelectionType property to see which user event caused this event. Note: If the user double-clicks, you will first see a single click then a double-click.

CurrentSelectionType This is only valid in the OnAlertSelected event. This is astSingle (1) if a single click caused this event. This is astDouble (2) if a double-click caused this event.

NotifyOnBeforeModal

Set this property to true if you want to see OnBeforeModal events. This defaults to false to be compatible with older versions of the library.

Warning: If you set this to true, the "Save Contents…" item on the "History" sub-menu will disappear.

NotifyOnAccountStatusChanged

Set this property to true if you want to see OnAccountStatusChanged events. This defaults to false to be compatible with older versions of the library.

20

StrategyConfig This string property holds configuration of OddsMaker module. OddsMaker is a special part of ActiveX for calculation of the odds of winning trades on any alert and filter combination. More information about OddsMaker is available at http://www.trade-ideas.com/OddsMaker/Help.html.

MethodsMethod Name DescriptionShowConfigWindow(const WindowName : String) : Boolean;

This displays the config window for an alert window. This is available to the user through an item on the popup menu. However, some people hide the Trade-Ideas alert window, and use NotifyOnEachAlert to build their own window.

The input is the name to display in the title bar of the config window. Set this to the empty string to use the default title.

The return value is true if the user hit OK, and false if the user hit Cancel. AddCustomMenuItem(const Display : String; ID : Integer);

Adds a new item to the popup menu.

The display parameter is displayed to the user. "-" and "&&" have their normal meanings for a menu in MS Windows.

The ID parameter is returned, in addition to the display string, in the callback. The ID parameter has no other meaning.

When the user selects one of these items, the control will send an OnCustomMenuItem event back to the host application.

AddCustomMenuItemToTop(const Display : String; ID : Integer);

This is exactly the same as AddCustomMenuItem except this function always adds the new menu item to the top of the menu, where AddCustomMenuItem adds the new item to the bottom. These share the same callback event.

AddContextSensitiveMenuItem (const DisplayBeforeSymbol : String, const DisplayAfterSymbol : String, ID : Integer, Bottom : Boolean);

Adds a new item to the popup menu.

This is context sensitive, because the result depends on where the user right-clicks to view the menu. If the user right clicks on an alert, the caption will include the stock symbol associated with the alert. The caption will be the value of DisplayBeforeSymbol, followed by the symbol, followed by DisplayAfterSymbol.

If the user right-clicks on a blank area of the window, the menu item will be disabled.

If Bottom is true, this new item will be added to the bottom of the menu. If Bottom is false, this new item will be added to the top of the menu.

When the user selects one of these items, the control will send an OnContextSensitiveMenuItem event back to the user. This will include the ID specified in the function, and an AlertData object describing the event.

EventsEvent Name DescriptionOnActivate Standard / Compiler generated. Best to avoid these. These may become

deprecated in a future release.OnClickOnCreateOnDblClickOnDestroy

21

OnDeactivateOnKeyPress(var Key: Smallint)OnPaintOnAlertSelected(const Alert: IAlertData)

Each time the user double clicks on an alert, the host program receives this callback. See the AllowSelectionType and CurrentSelectionType properties for more details.

OnNewAlert(const Alert: IAlertData)

Each time a new alert arrives, the host program receives this alert. The host program will only receive these events if and when NotifyOnEachAlert is true.

OnCustomMenuItem(const Display: String; ID: Integer)

Each time the user selects a menu item created by the AddCustomMenuItem() method, the control will send back one of these events. The two parameters in this event are the exact same as the parameters in the call to AddCustomMenuItem.

This only applies to custom menu items. The standard menu items, which come with the control by default, do not generate these events.

OnContextSensitiveMenuItem(const Alert: IAlertData, ID: Integer);

Each time the user selects a menu created by AddContextSensitiveMenuItem() the control will send back one of these events.

AlertEvent describes the alert under the cursor when the user requested the popup. If new alerts come in while the menu is visible, the original alert might not be visible on the screen any longer. However, the text on the menu still refers to the original alert. And this callback gets the data for the original alert.

The ID is the same as was provided in the initial call to AddContextSensitiveMenuItem().

OnWindowNameChanged

This event occurs each time the window name changes. Use the WindowName or BasedWindowName property to get the real value. Set NotifyOnWindowNameChanged to true if you want to receive this event.

OnBeforeModal(Handle: Integer);

This event occurs each time a modal dialog box is displayed. The event includes the window handle, and occurs immediately before the dialog box is visible. This allows for certain application specific activities, such as making the windows always on top. Set NotifyOnBeforeModal to true if you want to receive this event.

OnAccountStatusChanged

This event occurs each time the AccountStatus or AccountStatusAction properties of the ConnectionControl object change.

This event and those properties allow the host program to monitor the status of the account information. Use this to decide, for example, when to prompt the user for a username and password.

This event only fires, and those properties are only valid, when we are requesting alert data. If the username is blank, none of these work. If there are no alert windows, none of these work. If the server complains about a bad username, password, or account, the library will update the properties and fire the event one last time. If, for example, the user changes his password on the server to match what he already entered into the client, he will have to manually restart the connection. The library and the host program will not know about this change until the connection is manually restarted.

Set NotifyOnAccountStatusChanged to true if you want to receive this event.

StatusBarXClass GUID: {49AB7098-51E7-41B3-9833-FB5FAE3EAF1F}

22

This class exposes only standard / compiler generated events and properties. The host program can display this control where and when it is appropriate, but no other interaction is required.

ConnectionControlClass GUID: {D900B873-1594-43A8-A3B9-03BCFA412D36}

PropertiesProperty Name DescriptionUserName Every connection to the server requires a unique username and an associated

password. These are generated as part of the payment process. These may be generated in bulk for people providing this ActiveX control as part of their product.

There is no specific login procedure. Just set the username and password.

Password

SymbolList[Id: Integer]

Use this property to access a symbol list control object. Each call to this property generates a new object, with it’s own scratch space.

Accessing this property does not automatically create a symbol list or send any other information to the server.

ServerUrl Obsolete. ApiDirDevelopmentUsernameDevelopmentPasswordProxyPassword Leave these blank to communicate directly with the server. Set these to

appropriate values to make use of a standard HTTP proxy. The correct values will have to come from the person responsible for the firewall and the proxy server, not from Trade-Ideas.

ProxyPortProxyServerProxyUsernameIconDirectory Use this property to access the icons which are visible in the alert window and the

config window. Those windows automatically know how to access these icons. Set this property if you want to use these icons in other places in your own code.

Set this to the empty string if you do not need to access the icons. This is the default.

Set this to the name of a directory to access the icons. One file will appear in the directory for each alert type. All files are gifs. Each file name will be the same as the icon type, with the “.gif” extension added.

The icons are loaded asynchronously. Typically this will be very fast. However, if there is a problem, the software will continue to request data even before all the icons are loaded. The software will make multiple attempts to access each icon, but under enough stress it can fail. Your code must not rely on the presence of an icon.

This software does not provide any callback when new icons are available. Windows already provides functions to watch for changes in a directory.

In case of problems, such as a bad directory name, this feature will fail silently.

Some of the icons make use of transparency. The icons look good on a white background; this is always a safe choice. Other backgrounds may work. Be sure to try all of the icons, as some use transparency in a different way than others.

23

VendorID This property is a string describing you, the person or company who wrote the code which is using this library. This allows us to track how people are connecting to our server. Typically you would set this first, before doing anything else, so we can track the entire session.

It is possible to change this in the middle of a session. This might be useful if we are helping you debug your software. We can see when you make this change. We will see the change the next time the ActiveX control asks for data.

AccountStatus This read-only property describes the current status of the username, password, and account. See OnAccountStatusChanged for general information. AccountStatusAction offers similar information.

This property can have one of the following values: asWaiting (0) - We have not received any account status information from

the server since the last time we did a reset. asGood (1) - The server is sending us data. asAnotherUser (2) - The server disconnected this session because someone

logged in with the same username on another computer. asBadUserName (3) - The server disconnected this session because the user

entered a username which does not match any account on the server. asBadPassword (4) - The server disconnected this session because the user

entered a password which does not match the username. asRequirePayment (5) - The server disconnected this session because the user

account has expired. The user can fix this by starting the free trial, or by paying.

New status codes may be added in the future. The codes for AccountStatusAction are more stable, and will not change as often.

24

AccountStatusAction This read-only property describes the current status of the username, password, and account. See OnAccountStatusChanged for general information. AccountStatus offers similar but more detailed information.

This property can have one of the following values: asaNone (0) - Everything is working as expected. No special action is

required by the user or the host program. asaManualReset (1) - The user can double-click the red status ball to restart

the data. Or the host program can call the reset function. The host program might want to explain to the user what happened and what he can do to fix it. Do not automatically call reset. If you reset the connection without user intervention, and the user accidentally leaves a copy of the program running at another location, neither copy of the program will be able to receive data.

asaPasswordDialog (2) - The username and/or password is wrong. Prompt the user to correct these values.

asaPayForAccount = (3) - The user needs to enable the account by paying or by starting the free trial. After he do that, this is just like a the asaManualReset state.

New status code may be added in the future.

Changing the username or the password will automatically call reset. This will try to restart the connection to the server. Displaying the password dialog box might help in the asaManualReset and asaPayForAccount states, although the host program should probably display some information about the poblem.

The password dialog box should still be available even in the asaNone state. Sometimes one user logs into another users computer. You need a way to change accounts, even if the account appears to be okay.

AccountExpires This read only property tells the user how much time he has before his account expires. This property is a date and time encoded in the standard C/Unix format.

This property is not always meaningful. If there is no meaningful value it will return 0. This can happen, for example, if the account is not currently active, or if the user has signed up for an automatic payment plan.

If the user has signed up for a free trial, this property tells the user how much time he has before the free trial ends. If the user has paid by check, this field will tell the user how much time he has before the next check is due.

This value is updated at the same time as AccountStatus and AccountStatusAction. Use the same callback mechanisms to listen for changes.

If this value is before the current date and time, treat it as if it were 0. This can happen for a variety of reasons, including two computer clocks which do not match perfectly.

MinTimeout The library will always wait at least this many milliseconds for a response from the server before retrying. A larger value may help some users with very bad internet connections, but this will also cause the software to take longer to recover from certain types of errors. In some cases the library may choose to wait longer than this, but it will always wait at least this long. Generally you should use the default value. If a user has a slow or unstable internet connection, we recommend that the user switch to the web based product.

ExportPrefix Reserved

25

AdditionalSamplesUrl Set this property to a page on your web site to see your own samples appear in the samples menu. Set this to the empty string, which is the default, to see only the standard samples.

All samples are stored on the Trade-Ideas server. Contact Trade-Ideas if you need to use this property.

HideNormalSamples Obsolete.HideConfigWindow By default this is false, and the user can use the popup menu to access the config

menu. Set this property to true to hide that menu item.SocksHost Set this string property to the name of a SOCKS proxy server. The default is the

empty string, meaning no SOCKS proxy is required.SocksPort This integer property says what port number to use to contact the SOCKS proxy.

The default is 1080.SocksVersion This integer property says what version of SOCKS the proxy server supports. 4

means SOCKS 4. 5 Means SOCKS 5. 0 Will disable the use of a socks proxy server.

SocksUserName These specify the username and password to pass on to the SOCKS proxy server. They both default to the empty string. Not all SOCKS proxy servers require or even support usernames and passwords.

SocksPassword

UseHttpTunnel Set this integer property to 0 to use the preferred method of communication with the server. This is the most efficient and most reliable option.Set this to 1 to use HTTP tunneling. This method is required by some firewalls. This option will only use port 80, and will only use it in the standard way, so it can pass through an HTTP proxy server.The value 2 is reserved for use as a smart auto-detect settings. The default is currently 0, but will change to 2 at some time in the near future.

HttpTunnelAddress These allow the client to attach to a different server. They are primarily used for testing and development.TcpIpServerAddress

HelpMode This integer property controls the on-line help. 0 means do not display help. 1 means that any time the user clicks on an alert or filter icon he will be taken to the relevant section of the Trade-Ideas web site. Other values are reserved for future use.

This includes all icons. This includes the config window and the alert window.

By default this is 0 for backward compatibility. Some applications do not display any relationship to Trade-Ideas. For most applications we recommend that you set this to 1.

TimeOffset Use this integer property to display the time in a different time zone. Normally we display all alerts in the local machine’s time zone. Leave this property in the default value of 0 to preserve this value. If, for example, you set this to 60, the time displayed will be one hour ahead of what it would have been.

ShowGrid This integer property allows you to configure the grid lines on the alert windows. Set this to 0 to hide the grid lines. Set this to 1, the default, to display grid lines. Other values are reserved for future use.

TimeFormatList This string property allows you to control the format of the time column. Ask Trade-Ideas for details.

HelpURL This string property allows you to change default URL for online help displayed when user clicks on an alert or filter icon. This might be useful for applications that do not want to display any relationship to Trade-Ideas.By default online help from Trade-Ideas web site is used. See also HelpMode property.

26

MethodsMethod Name DescriptionReset Restarts the connection between the server and the client.

This is only required at one time. When the user logs onto another computer with the same username and password, the connection to the first computer is explicitly broken. To reconnect, use this procedure, or restart the host software.

For all other connection issues, the software automatically retries as needed. No data is lost on an automatic retry, unless the connection is broken for a long time. Calling the reset method usually throws away some alerts.

SendFakeAlert This function sends a fake alert to all of the alert windows. This is mostly useful for testing when the market is closed.

Each window will display the alert, regardless of any settings. This does not contact the server. This does not make use of the password or user id. This ignores each windows configuration.

This alert will appear in the window just like any real alert. Both types of callbacks work for this alert.

GetListOfLists This function returns a list of symbol lists. Each call to this function creates a new one. This is a ListOfLists object, described below.

DeleteAllLists This deletes all lists from the server. This gives you a fresh start, so you can send copies of your lists to the server, and nothing else will be there.

RecordExecutionMessage

This is for internal use only.

SetCustomIcon This allows you to change the icons for various windows that Trade-Ideas display. Provide a handle for your icon. By default we display the Trade-Ideas icon. This icon often appears in the task bar and the alt-tab menu.

SymbolListControl

PropertiesProperty Name DescriptionId This read-only property is the id used on the server side to identify this list. When

the user selects a list, even though he can see the name, the id is what’s stored in his configuration.

This property is set at creation time and never changes.Name This property is used to update the name that the user sees on the configuration

screen.

Setting this property only stores the change in this object. The name on the server is set to match this name every time the control sends an add, delete, or clear request to the server. There is no explicit function to do a rename immediately.

ServerListValid This Boolean property described the result of the last attempt to retrieve symbols from the server. This is false, if we've never received a response, or if the last attempt to get data ended with a error and we could not automatically recover from the error. This is true if the last request succeeded.

WaitingForListFromServer

This Boolean property describes the current attempt to retrieve the a list of symbols from the server. True means that the last attempt to request data has finished.

This is false before the first attempt is made. This becomes true when we receive

27

data, or we have an error from which we cannot recover. This becomes false again the next time we request data.

This is provided as an alternative to the OnListFromServer event. This allows you to receive data through polling rather than a callback.

ServerListCount This is the number of items in the last list we received from the server.

MethodsMethod Name DescriptionAddSymbol(const Symbol: String);

Adds the symbol to the list with the given id. Creates and/or renames the list as required. Duplicates are ignored.

DeleteSymbol(const Symbol: String);

Deletes the symbol from the list with the given id. Creates and/or renames the list as required. If a symbol is not already in the list, that is not an error. The user will still see the list name, even when the list is empty.

DeleteAll Deletes all symbols from the list with the given id. Creates and/or renames the list as required. If a symbol is not already in the list, that is not an error. After this call, the user will still see an empty list with the specified name.

AddToWorkList(const Symbol: String)

Adds a symbol to a local, temporary list.

ClearWorkList Clears the temporary list. This is the default state after creating a new SymbolListControl object, and after calling the SendWoirkList method.

SendWorkList Replaces the current list on the server with the temporary list in this object. The update is atomic. Creates and/or renames the list as required.

DeleteList This completely deletes the symbol list from the server. This includes symbols, and the name of the list. After this, the user can no longer select this list on the configuration page.

In many cases it is better to set the symbol list to the empty list, rather than deleting the list. For example, if the user does not currently have any short positions, he should still see a list labeled "Short Position", which just happens to be empty. This will allow him to configure windows using this list before he creates any short positions.

The configuration for a window stores the id of the selected lists. If the user attaches an alert window to a list, and that list is deleted, this choice will be ignored. If the user attached an alert window to a list, and all the symbols are removed from the list, but it is not deleted, the user will not see any alerts until some symbols are added back to the list.

After calling this function, the SymbolListControl object will still exist. However, you generally will not want to do anything with this object. If a list does not currently exist, most list functions will create an empty list with the appropriate name and id. This will undo the effects of the DeleteList function.

RequestFromServer This requests a copy of the symbols in the list from the Trade-Ideas server.

If a list does not exist, it will be created. The resulting list will be empty.

Use WaitingForListFromServer, ServerListValid, GetServerListItem, GetServerListCount, and OnListFromServer to access the results.

GetServerListItem(n) This function retrieves a specific symbol from the last list we downloaded from the server. The index goes from 0 to ServerListCount - 1.

EventsEvent Name Description

28

OnListFromServer This callback is called each time data is available from a call to RequestToServer. Use ServerListValid to see if the call succeeded. If so, use ServerListCount and GetServerListItem to see the data.

WaitingForListFromServer offers an alternative to this event.

ListOfLists

PropertiesProperty Name DescriptionDataPresent This Boolean property tells the user whether or not this object has finished

loading the requested data from the server.

When the ListOfLists is first created, this is false. Each time new data is loaded, this is automatically set to true. The user can set this back to false at any time.

Typically the user will use the NewData event to see when new data arrives. This property offers an alternative way see when new data arrives. The sample code included with this file uses this property because JavaScript does not support ActiveX events.

MethodsMethod Name DescriptionRefreshData This sends another request to the server to receive a more recent copy of the

symbol lists.

When a ListOfLists object is first created, it automatically asks the server for data. The object will not request data again until the user manually calls this function.

ResetPointer Call this before you start iterating through the list of lists. Immediately after calling this function, the next call to GetNextList will return the first list of symbols.

GetNextList Returns the next symbol list. Returns null if there are no more symbol lists.

This function creates a new SymbolListControl objects each time it is called. It does not reuse these objects.

The SymbolListControl object will have the list id and the list name set. The user can use the SymbolListContol directly, or just look at these properties.

Symbol lists are always lists in numerical order, starting from the lowest value. 1 is the lowest legal value.

EventsEvent Name Description

29

OnUpdate This callback is called each time the ListOfLists receives data from the server. At this time the user can call ResetPointer and GetNextList to see the data.

In the case of a bad password or similar error, the user will receive an empty list. This will look just like a user who has no lists defined. DataPresent will be set to true, this callback will be called, etc., exactly as if we had real data.

In the case of a network error, or anything else where it makes sense to retry, this object will automatically perform the retries. It will not call this callback, or do anything else until it receives the data. It will continue to retry forever, until the data is received or the last reference count to this object is released.

Typically the data will arrive very quickly. However, there are no guarantees. The host application should not block while waiting for this data.

GenericDispatchX

PropertiesProperty Name DescriptionVisible This is a standard Boolean property. This should be set to false for production

code, and true for debugging.ListId This is the Id of the list which caused the current OnListUpdated event. This

property is only valid inside of this event.Caption This string property shows a debug message, the same message which is

displayed on the front of the control.etc. Many standard / compiler generated properties are still attached to this control.

Best to avoid these. These may become deprecated in a future release.

MethodsMethod Name Descriptionall Many standard / compiler generated methods are still attached to this control.

Best to avoid these. These may become deprecated in a future release.

EventsEvent Name DescriptionOnListUpdated This callback is called once each time we receive a list from the server, regardless

of how many objects requested it, or how many times it was requested. (Duplicate requests are merged.) This is called after the list objects have been updated to say that they are no longer waiting. So, for example, you could send requests for several lists at once, after receiving the list of lists. Each time you get OnListUpdated callback, you can check if any of the list objects are still waiting for data. When none of them are waiting for data, you can proceed to the next step.

Alternatively, you can check the ListId property to see which list caused this event.

30

OnListOfListsUpdated

This callback is called each time the ListOfLists receives data from the server. At this time the user can call ResetPointer and GetNextList to see the data.

In the case of a bad password or similar error, the user will receive an empty list. This will look just like a user who has no lists defined. DataPresent will be set to true, this callback will be called, etc., exactly as if we had real data.

In the case of a network error, or anything else where it makes sense to retry, this object will automatically perform the retries. It will not call this callback, or do anything else until it receives the data. It will continue to retry forever, until the data is received or the last reference count to this object is released.

Typically the data will arrive very quickly. However, there are no guarantees. The host application should not block while waiting for this data.

OnClick Standard / Compiler generated. Best to avoid these. These may become deprecated in a future release.OnKeypress

AlertDataAlert data is not a first-class object. Keeping a copy of an AlertData object will not keep the server connection alive.

PropertiesProperty Name DescriptionSymbol The ticker symbol for the alert.AlertType A string describing the type of the alert. This is the code used internally to

describe the alerts. The user may see this in a URL, but never in formatted English text.

TimeStamp The time of the alert in standard C/Unix notation. This is the number of seconds that have elapsed since midnight at the start of January 1, 1970, UTC.

AltTimeStamp The time of the alert in standard Borland Delphi notation. The integral part is the number of days that have passed since 12/30/1899. The fractional part is the fraction of a 24 hour day that has elapsed. This is always presented in local time, according to the settings on the local computer.

Description The text that the user sees describing the alert.Quality A floating point number describing the alert. The meaning of this varies with the

alert type. See the configuration screen for the units and a brief description of the meaning for each alert type.

This value can be NAN if the there is no reasonable quality for this alert. For some alert types, the value is always NAN. All alert types are allowed to report NAN, although some report this more often than others.

If the user specifies a value for the quality filter for an alert type, then every alert of that type is compared to the user’s setting. If the quality of the alert is non NAN, and is at least as large as the user’s setting, the alert will be displayed.

RelVol This is the stocks relative volume at the time of the alert. Like the quality, it can be NAN, and the user can filter based on this value.

HelpUrl This is a pointer to the help for this alert type on our web site.IconUrl This is a pointer to the icon for this alert type on our web site. All icons are gifs.

Most icons have transparency. The preferred background color for all gifs is white.

See the IconDirectory property of the ConnectionControl object for an alternative way to access this data.

31

Count This integer field corresponds to the count field in the product.DayRange This floating point field corresponds to the Range for the Day field in the product.

0.0 means the last trade was the low for the day. 1.0 means the last trade was the high for the day. The value can be outside of these bounds. The value can be NAN to say that there is no appropriate value to display for this field.

HistoryType This separates the real-time data from the historical data. By default most of the data displayed is real-time data. This gets a value of

0. When you first open a window, if no real-time data is available for a short

time, we often send a single historical record. This is called "short history". This gets a value of 1.

The user can request historical data. We call this "long history". This gets a value of 2.

Volatility This is the stocks volatility at the time of alert. It can be NAN, and the user can filter based on this value.

StandardDeviation This is the stocks standard deviation at the time of alert. It can be NAN.

IssuesThe following known issues need to be fixed before release:No known problems at this time.

32