RightEdge - The Ultimate Backtesting and Trading System Development Platform
Creating an Indicator
This topic is intended by software developers that would like to include their own indicators in the RightEdge Indicator Pane.
Implementing plugins requires some programming knowledge. It also requires a programming environment capable of compiling code into .NET library assemblies.
Name the class library MyIndicator. Change the location to the desired folder.
There are three base classes that implement IIndicator which aid in implementing an indicator. We'll briefly discuss the benefits of each of these base classes.
IndicatorBase is the simplest of all interfaces. This is implemented by an indicator that does not need to look back at previous or support indicator chaining.
If an indicator is doing a simple calculation on its inputs, you may simply want to calculate the value from the inputs every time the value is requested, instead of storing the entire series of values. If this is the case, you can derive from this class and implement your calculation in the Item indexer. This is the recommended base class when backward lookups on previously calculated indicator values are not required.
Implements base functionality for an ISeriesCalculator indicator that calculates and stores it's value each time a new bar comes in. When deriving from this class, call the base constructor with the number of inputs required, and implement the CalcNewValue and Reset functions. Use this base class when access to previously calculated data is required and may need to be changed or reset.
Let's implement this indicator using IndicatorBase. To keep the emphasis on implementation as opposed to the details of the indicator itself, we'll implement the average price indicator. Average price is a simple indicator that takes bar data and returns the average of the High, Low and Close values. The math is simple:
Below is the indicator implemented. You can paste the contents right into your environment.
A few items to note. First, the attributes at the top of the class declaration tell the RightEdge user interface some specific details about this indicator. The first item is the default color proposed to the user whenever they drag and drop this indicator to a chart or System Designer. The next attribute is the group that the indicator will fall under in the user interface. The description is a brief, one sentence bit of information about this indicator. The Id is a unique identifier which allows this indicator to be identified even if the name, version or other attributes are changed. The HelpText attribute is long text describing this indicator in detail. It is recommended that you give an overview of the indicator, its recommended uses and how to interpret the values produced.
Finally, the indicator plugin has been created successfully. Now it must be copied to the RightEdge plugin directory. The plugin directory is located off of the main application directory (specified during the installation). The directory is named "Plugins". After the plugin has been copied to this directory, start RightEdge and the plugin, if implemented properly, will be found and displayed in the proper place in the user interface. No further installation is required.