Profile Picture

Articles on writing Plugins

Posted By sarah 10 Years Ago
Message
Posted Wednesday October 10 2007
I want to write plugins or at least want to take a look what it takes to write plugins. Now how do I go about this? I could not find any article on this topic on this website or this forum.

To start, I want to take a look at following:
1. How to write a static datasource which maintain their own list of securities and data for each security?
2. How to write realtime datasource which provides backfill and streaming data?
3. How to write an interface to link to a broker?


Posted Wednesday October 10 2007
There are full blown samples (and all but the broker actually connect with live services) installed with the application for each plugin type.  Look in the Samples directory under the installation folder.  The developer documentation contains the interfaces of course.  We can consolidate the interfaces into something more discoverable on the web site, but for now I'll just quickly lay them out.

IAction - Base action interface. This is for Actions within the drag and drop designer

IBroker - The base interface for all broker plugins.  Since this is a service provider (like real time and historical data) this must also implement the IService interface.

IBarDataStorage - Implement this interface to create a data storage plugin.

IBarDataRetrieval - Implement this to create a historical data provider plugin service (implement IService as well).

ITickDataRetrieval - Implement this to create a real-time data provider plugin service (implement IService as well).

IRiskAssessment - Implement this to create a portfolio analysis plugin.

ITrigger - Implement this to create a trigger for use within the drag and drop designer.

I left the indicator plugins for last because they warrant some additional explanation.  There are three types of indicator plugins based on the needs of the indicator.

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

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.

SeriesCalculatorBaseSimple

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.

SeriesCalculatorBaseWithValues

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.

The bulk of the work in this sample is performed by the overloaded indexer.  This is called each time a new bar comes in, so we perform the calculation and return the value.  This version also has access to other series inputs so that operations can be performed with this data.

CalcSeriesValues() is used for optimizing an entire series of calculations.  In other words, many indicators can be calculated independently, while some rely on previously calculated values.  If you can store those previously calculated values instead of having to recalculate them everytime, you save a lot of cycles.  That's really what this function is for.

The attributes at the top of the class are used for the user interface and persistence. The ID is important because this is what RightEdge uses to identify this indicator so that it can save and load it from a saved chart for example.  We typically generate a GUID as the ID.  You can generate this ID in Visual Studio if you're familiar with that tool, or use the one at http://www.guidgen.com.  DefaultDrawingPane proposes a default pane name to the user when they drag and drop this indicator.  HelpText is the text that is displayed when a user selects Indicator Information from the indicator pane.

Let me know if I can answer any more questions or make it easier for to locate any information you need.

sarah (10/10/2007)
I want to write plugins or at least want to take a look what it takes to write plugins. Now how do I go about this? I could not find any article on this topic on this website or this forum.

To start, I want to take a look at following:
1. How to write a static datasource which maintain their own list of securities and data for each security?
2. How to write realtime datasource which provides backfill and streaming data?
3. How to write an interface to link to a broker?


Posted Wednesday October 10 2007
Was the work on making the system results all plugable so traumatic that you just can't ever remember to mention that?  Tongue
Posted Wednesday October 10 2007
w00t ... well, that's for 1.1, so I was trying not to get too far ahead of myself Smile
Posted Wednesday October 10 2007
Thanks. That was a nice introduction and now I have better understanding.

I think you should put all of these in different articles on the website with more details and specifics something like
- How to write broker adapter using Visual Studio 2005 Express.
and then list step-by-step so that any intermediate level user can write a plugin.

How does RE know about new plugins and what type of plugins they are?
Posted Wednesday October 10 2007
It scans the DLLs in the plugin directory to find your plugins.  The interface they implement determines what type they are.

Daniel

Posted Friday October 26 2007
Just noticed that in the RE Documentation under Service and Plugin Overview if you click on the links at the bottom of the page "Creating a Risk Assessment Plugin" etc that they do not exist - it instead takes you to "Data Store Development".
Posted Wednesday July 30 2008
I've installed RightEdge 2008 Edition 1, but for some strange reason I cannot locate the Samples folder?

Where is it?

Yye Software -> RightEdge 2008 Edition 1 -> I can see 2 folders: Plugins and resources and no subfolder in either of them Cool

Posted Wednesday July 30 2008
Did you install with the "Full" option (which is default)?  There should also be a shortcut on the Start menu in the RightEdge program group for the samples folder as well as on our start page.

Januson (7/30/2008)
I've installed RightEdge 2008 Edition 1, but for some strange reason I cannot locate the Samples folder?

Where is it?

Yye Software -> RightEdge 2008 Edition 1 -> I can see 2 folders: Plugins and resources and no subfolder in either of them Cool

Posted Wednesday July 30 2008
ahh yes, there it was, I tried to locate it under Program Files

Sorry to interfere with such small items Blush



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems