Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData Class Reference

Contains returns specific to a symbol required for optimization model More...

Public Member Functions

 ReturnsSymbolData (Symbol symbol, int lookback, int period)
 Initializes a new instance of the ReturnsSymbolData class More...
 
void Add (DateTime time, decimal value)
 Adds an item to this window and shifts all other elements More...
 
bool Update (DateTime time, decimal value)
 Updates the state of the RateOfChange with the given value and returns true if this indicator is ready, false otherwise More...
 
void Reset ()
 Resets all indicators of this object to its initial state More...
 

Public Attributes

Dictionary< DateTime, double > Returns => _window.ToDictionary(x => x.EndTime, x => (double) x.Value)
 Historical returns More...
 

Properties

RateOfChange ROC [get]
 The symbol's asset rate of change indicator More...
 

Detailed Description

Contains returns specific to a symbol required for optimization model

Definition at line 26 of file ReturnsSymbolData.cs.

Constructor & Destructor Documentation

◆ ReturnsSymbolData()

QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.ReturnsSymbolData ( Symbol  symbol,
int  lookback,
int  period 
)

Initializes a new instance of the ReturnsSymbolData class

Parameters
symbolThe symbol of the data that updates the indicators
lookbackLook-back period for the RateOfChange indicator
periodSize of rolling window that contains historical RateOfChange

Definition at line 43 of file ReturnsSymbolData.cs.

Member Function Documentation

◆ Add()

void QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.Add ( DateTime  time,
decimal  value 
)

Adds an item to this window and shifts all other elements

Parameters
timeThe time associated with the value
valueThe value to use to update this window

Definition at line 61 of file ReturnsSymbolData.cs.

◆ Update()

bool QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.Update ( DateTime  time,
decimal  value 
)

Updates the state of the RateOfChange with the given value and returns true if this indicator is ready, false otherwise

Parameters
timeThe time associated with the value
valueThe value to use to update this indicator
Returns
True if this indicator is ready, false otherwise

Definition at line 74 of file ReturnsSymbolData.cs.

Here is the caller graph for this function:

◆ Reset()

void QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.Reset ( )

Resets all indicators of this object to its initial state

Definition at line 82 of file ReturnsSymbolData.cs.

Member Data Documentation

◆ Returns

Dictionary<DateTime, double> QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.Returns => _window.ToDictionary(x => x.EndTime, x => (double) x.Value)

Historical returns

Definition at line 54 of file ReturnsSymbolData.cs.

Property Documentation

◆ ROC

RateOfChange QuantConnect.Algorithm.Framework.Portfolio.ReturnsSymbolData.ROC
get

The symbol's asset rate of change indicator

Definition at line 35 of file ReturnsSymbolData.cs.


The documentation for this class was generated from the following file: