RightEdge is designed to be extensible and customizable. Many parts of RightEdge's functionality are provided by plugins, which allows you to modify or replace them according to your needs. There are different types of plugins for accessing market data, connecting to a broker, calculating indicators, displaying system results, and more. Plugins are .NET classes which implement an interface defined by RightEdge corresponding to the type of the plugin.
RightEdge supports the following plugin types:
A data storage plugin allows a developer to control the way data is stored by RightEdge. RightEdge ships with a proprietary binary data store and a SQL Server data store. If a developer wanted to support their own proprietary data store or a database not supported out of the box, implementing a data store would allow for seamless integration into RightEdge.
Indicator plugins are for developers who wish to implement their own indicators. Every indicator in RightEdge is a plugin. Everything that is shown in the RightEdge user interface as it relates to indicators is available to third party developers as well. All available indicators are displayed in the Indicator panel.
Frequency plugins aggregate price data (in the form of ticks and/or bars) to create bar series. RightEdge includes frequency plugins to generate time-based bars, tick bars, and constant volume bars. There is also a frequency plugin that generates daily bars but filters out any data outside of the specified market hours.
Risk assessment plugins are implemented by those developers who want to perform portfolio level risk analysis after a simulation is complete. RightEdge ships with a number of risk assessment plugins such as Profit Factor and Sharpe Ratio, but developers who want to apply their own proprietary calculations can do so by implementing this plugin type. All available risk assessment plugins are displayed in the Options dialog.
Actions, as used in the drag and drop interface of RightEdge, are implemented as plugins. Custom action code can be developed by implementing an action plugin. Action plugins are shown in the Components panel.
Triggers, as used in the drag and drop interface of RightEdge, are implemented as plugins. Custom trigger code can be developed by implementing a trigger plugin. Trigger plugins are shown in the Components panel.
Optimization plugins can run multiple simulations of a system with different parameter values to search for an optimal set of parameter values according to some measurement (for example, the best combination of high profit and low risk). RightEdge's default optimization plugin allows you to specify the high and low values and the step size or number of steps for each parameter.
A service is a special type of plugin that typically interface with third party APIs such as data providers and brokers. Services are associated with symbols in the Watchlist pane. You can set up a hierarchical folder structure and have child folders inherit settings from their parents (or override those settings).
Service plugins implement the IService interface, and can provide one or more of the following services:
|o||Bar Data Retrieval|
To retrieve bar data from a proprietary source that is not currently supported by RightEdge, implement a bar data retrieval plugin. When this interface is implemented, the service must let RightEdge know that it is capable of retrieving bar data by returning true from the BarDataAvailable property.
|o||Tick Data Retrieval|
To retrieve tick level data from a proprietary source that is not currently supported by RightEdge, implement a tick data retrieval plugin. When this interface is implemented, the service must let RightEdge know that it is capable of retrieving tick data by returning true from the TickDataAvailable property.
RightEdge interfaces with live brokers. A service plugin can implement broker level services to communicate with any broker that will allow communication with a third party application. When implementing broker services, the service must let RightEdge know that it is capable of performing broker services by returning true from the BrokerFunctionsAvailable property.
A symbol source service can provide symbols to add to the watchlist. It will be called when the context (right click) menu is displayed for a watch list folder, and can add items to the "Add Symbols From" submenu. The Yahoo data plugin included with RightEdge provides a symbol source to add symbols from the Dow 30, NASDAQ 100, and S&P 500 indices. The Interactive Brokers plugin provides a symbol source which displays a dialog to search available symbols and add them to the watchlist.
Implementing a RightEdge program requires some .NET programming skills, and an environment capable of compiling code into .NET assemblies. A great option is Visual Studio Community, a free edition of Visual Studio.
The easiest way to get started writing a plugin is by modifying code for an existing plugin. You can find sample code for RightEdge plugins by selecting "RightEdge samples" from the RightEdge help menu. The RightEdgePlugins folder contains source code for many of the plugins that are part of RightEdge itself. The C# and VB.NET folders contain various other plugin samples.
To modify a plugin, build it, and use it in RightEdge, follow these steps:
|1.||Create a copy of the folder with the solution (.sln) file in it. This is so that when you install a new build of RightEdge it won't overwrite the changes you made, and so you will still have the original source code available to refer to.|
|2.||From the copied folder you created, open the solution file in Visual Studio.|
|3.||Make changes to the plugin code.|
|4.||Build the plugin, and copy the output DLL to the Plugins folder under the RightEdge installation directory.|
If the plugin you copied was one of the ones included in RightEdge by default, this will copy over the default version. If you want to create a new plugin instead of modifying an existing one, do the following:
|1.||Change the assembly name of the project. This will change the filename of the DLL that is produced so you can have both the original version and your customized version in the RightEdge plugins directory. To change the assembly name, right click on the project node in the solution explorer and go to the project properties.|
|2.||Change the identity of the plugin. This is what RightEdge uses to uniquely identify each plugin, and if you have multiple plugins with the same identity, at least one of them won't be loaded. For service plugins, change the value returned from the id() method. For indicators, triggers, and actions, change the value of the Id property of the RightEdgeObjectAttribute on the plugin class. For other plugin types simply change the name of the plugin class.|
|3.||Change the display name or service name, and other applicable metadata. This will let you distinguish your plugin from the default version of the plugin when selecting which plugin to use in RightEdge. For IService plugins, change the return value for the ServiceName() method. For indicators, triggers, and actions, change the value of the Name property of the RightEdgeObjectAttribute on the plugin class. For other plugins, change the value in the DisplayNameAttribute before the plugin class.|
|4.||If there are other plugins in the same project that you don't want to modify, remove those source files from the project. For example, the DataStorage project has the binary data store plugin, SQL Server plugin, and a Jet data storage plugin. If you just want to customize the binary data store, you should remove the other two plugins from the project so you don't have duplicate versions of them showing up in RightEdge.|
|5.||Build the project and copy the plugin DLL to the RightEdge plugins directory.|
|6.||Configure RightEdge to use the new plugin. How to do this will depend on the plugin type you have implemented. Services can be configured in the Service Setup dialog. Data storage, watchlist, and optimization plugins are configured in the RightEdge options.|
Details on the APIs used to implement plugins can be found in the RightEdge developer documentation. The interface for each plugin type to implement is listed below. Service plugins must also implement the IService interface.
Creating an Indicator Plugin