CustomView

CustomView#

class sigtech.framework.analytics.performance.performance_report.CustomView

Class providing basic features to build a customised view.

Basic usage:

from sigtech.framework.analytics.performance.performance_report import CustomView

def my_fun0(args):
    # Can access args passed externally.
    pass

def my_fun1(self):
    # Can access PerformanceReport properties.
    # `self.strategy` contains a strategy object, a list of strategy objects or a pandas DataFrame, depending on
    # how the performance report object was instantiated. `self.benchmark` contains the benchmark timeseries.
    pass

def my_fun2(self, args):
    # Can access PerformanceReport properties and args passed externally.
    pass

var0 = 0
var1 = 1
custom_view0 = CustomView(function=my_fun0, params=[var0], name='Custom Metrics 0')
custom_view1 = CustomView(function=my_fun1, name='Custom Metrics 1')
custom_view2 = CustomView(function=my_fun2, params=[var0, var1], name='Custom Metrics 2')
custom_view3 = CustomView(function=my_fun2, params={'var0': var0, 'var1': var1}, name='Custom Metrics 3')