SharpeRatioProcessor

class SharpeRatioProcessor(a, *, start=None, end=None, currency, w=None, curve_type=CurveType.PRICES, **kwargs)[source]

Methods

__init__(a, *, start=None, end=None, currency, w=None, curve_type=CurveType.PRICES, **kwargs)[source]

SharpeRatioProcessor

Parameters:
  • a (Union[DataCoordinate, BaseProcessor]) – DataCoordinate or BaseProcessor for the series of prices or excess returns

  • currency (Currency) – currency for risk-free rate, defaults to USD

  • w (Union[Window, int, None]) – Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size and 10 the ramp up value.

  • curve_type (CurveType) – whether input series is of prices or excess returns, defaults to prices

  • start (Union[date, datetime, RelativeDate, None]) – start date or time used in the underlying data query

  • end (Union[date, datetime, RelativeDate, None]) – end date or time used in the underlying data query

as_dict()

Create a dictionary representation of the processor. Used for eventually turning the processor into json for API usage. Allows for nested processors. :rtype: Dict :return: Dictionary representation of the processor

build_graph(entity, cell, queries, rdate_entity_map, overrides)

Generates the nested cell graph and keeps a map of leaf data queries to processors

async calculate(attribute, result, rdate_entity_map, pool=None, query_info=None)

Sets the result on the processor and recursively calls parent to set and calculate value

Parameters:
  • attribute (str) – Attribute alinging to data coordinate in the processor

  • result (ProcessorResult) – Processor result including success and series from data query

classmethod from_dict(obj, reference_list)
get_default_params()
get_excess_returns_query()[source]
Return type:

DataQueryInfo

get_plot_expression()[source]

Returns a plot expression used to go from grid to plottool

post_process()
process()[source]

Handle the calculation of the data with given coordinate data series

async update(attribute, result, rdate_entity_map, pool=None, query_info=None)

Handle the update of a single coordinate and recalculate the value

Parameters:
  • attribute (str) – Attribute alinging to data coordinate in the processor

  • result (ProcessorResult) – Processor result including success and series from data query