Click or drag to resize

How to develop a Strategy Performance

In a first of its kind, ArthaChitra lets the user to create his/her own Strategy Performance summery and performance reports including how the same will be displayed by defining custom xaml templates.

In Strategy Performance View, the contents as visible in the Summery tab can be user defined by building custom PerformanceBase codes. In the Performance tab both the content and the UI/View can be configured by building custom PerformanceBase scripts and by designing custom Xaml templates.

Basic concepts

The Performance userCode is inherited from the PerformanceBase class. If the user wishes to display any value in the Summeries tab then he must implement the ISummeryT interface. If the user wants to display the values in the Performance tab then he must implement the IPerformance interface. Additionally the user can write custom Xaml templates and change the whole look and feel of the Performance tab.

Example
C#
public class ClassName : PerformanceBase, ISummery<double>, IPerformance
 {
     //you code including implementation of the ISummery<> and IPerformance<> interfaces
 }
Abstract methods

OnStateChange

The OnStateChanged method is called whenever the State of the script is changed. The various states which a Performance class have are:

  • Initialize - when the PerformanceBase class is created.
  • StartUp - when the user selects a performance object from the drop down items in Performance tab. This state is available only when the Strategy Performance Script implements the IPerformance<> interface
  • Finalize - When the script encounters an error or is being finalized (disposed off). All clear up codes should be placed here.
Example
C#
protected override void OnStateChange()
 {
     //your code here
 }

OnTransaction(ITransaction)

The OnTransaction is called whenever the strategy triggers a transaction (when both the legs, i.e. entry and its corresponding exit, are filled). User has to calculate the metrics based on the values as provided by the ITransaction interface.

Example
C#
protected override void OnTransaction(ITransaction transaction)
 {
     //your code here
 }
Configuring properties via GUI using Xaml templates
See Also

Reference

PerformanceBase
ISummeryT
IPerformance

Other Resources

Default strategy performance template