Table of Contents

Class VaRBase

Namespace
Balsam.Portfolio
Assembly
Balsam.Backtester.dll

An abstract base class for providing portfolio Value-at-Risk calculations.

public abstract class VaRBase
Inheritance
VaRBase
Derived
Inherited Members
Extension Methods

Properties

BaseCurrency

Gets/sets the base currency.

public string BaseCurrency { get; set; }

Property Value

string

CurrentDate

The last date used in the VaR calculations.

public DateTime CurrentDate { get; set; }

Property Value

DateTime

FXSeries

Gets/sets a BarSeriesCollection that will be used as the primary source of historical fx pricing information. If a series isn't found here, the FxServer will be queried.

public BarSeriesCollection FXSeries { get; set; }

Property Value

BarSeriesCollection

FXServer

Gets/sets the BarServer be used to retrieve historical FX pricing. Not required if all symbols are in the base currency.

public IBarServer FXServer { get; set; }

Property Value

IBarServer

Instruments

Gets/sets an InstrumentCollection that can be used to provide point value and currency information to the calculation engine.

public InstrumentCollection Instruments { get; set; }

Property Value

InstrumentCollection

LookBack

Gets/sets the number of bars used in the VaR calculations.

public int LookBack { get; set; }

Property Value

int

PriceSeries

Gets/sets a BarSeriesCollection that will be used as the primary source of historical pricing information. If a series isn't found here, the PriceServer will be queried.

public BarSeriesCollection PriceSeries { get; set; }

Property Value

BarSeriesCollection

PriceServer

Gets/sets the price server used to provide historical pricing.

public IBarServer PriceServer { get; set; }

Property Value

IBarServer

Significance

Gets/sets the significance level (e.g. 99% = 0.99).

public double Significance { get; set; }

Property Value

double

Methods

Calculate(IEnumerable<IPortfolioHolding>)

Returns the Value-at-Risk for the specified positions.

public double Calculate(IEnumerable<IPortfolioHolding> positions)

Parameters

positions IEnumerable<IPortfolioHolding>

Returns

double

Calculate(IEnumerable<Position>)

Returns the Value-at-Risk for the specified positions.

public double Calculate(IEnumerable<Position> positions)

Parameters

positions IEnumerable<Position>

Returns

double

OnCalculate(IEnumerable<IPortfolioHolding>, List<DateTime>)

The method where the VaR calculation should be implemented.

protected abstract double OnCalculate(IEnumerable<IPortfolioHolding> positions, List<DateTime> dates)

Parameters

positions IEnumerable<IPortfolioHolding>
dates List<DateTime>

Returns

double

OnMessage(MessageEventArgs)

Raises a message event.

protected virtual void OnMessage(MessageEventArgs e)

Parameters

e MessageEventArgs

Events

Message

Sends a message

public event EventHandler<MessageEventArgs> Message

Event Type

EventHandler<MessageEventArgs>