Lean
$LEAN_TAG$
|
Provides extension methods for Indicator More...
Static Public Member Functions | |
static bool | Update (this IndicatorBase< IndicatorDataPoint > indicator, DateTime time, decimal value) |
Updates the state of this indicator with the given value and returns true if this indicator is ready, false otherwise More... | |
static T | Of< T > (this T second, IIndicator first, bool waitForFirstToReady=true) |
Configures the second indicator to receive automatic updates from the first by attaching an event handler to first.DataConsolidated More... | |
static CompositeIndicator | WeightedBy< T, TWeight > (this IndicatorBase< T > value, TWeight weight, int period) |
Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one More... | |
static CompositeIndicator | Plus (this IndicatorBase left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the sum of the left and the constant More... | |
static CompositeIndicator | Plus (this IndicatorBase left, IndicatorBase right) |
Creates a new CompositeIndicator such that the result will be the sum of the left and right More... | |
static CompositeIndicator | Plus (this IndicatorBase left, IndicatorBase right, string name) |
Creates a new CompositeIndicator such that the result will be the sum of the left and right More... | |
static CompositeIndicator | Minus (this IndicatorBase left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the difference of the left and constant More... | |
static CompositeIndicator | Minus (this IndicatorBase left, IndicatorBase right) |
Creates a new CompositeIndicator such that the result will be the difference of the left and right More... | |
static CompositeIndicator | Minus (this IndicatorBase left, IndicatorBase right, string name) |
Creates a new CompositeIndicator such that the result will be the difference of the left and right More... | |
static CompositeIndicator | Over (this IndicatorBase left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the constant More... | |
static CompositeIndicator | Over (this IndicatorBase left, IndicatorBase right) |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right More... | |
static CompositeIndicator | Over (this IndicatorBase left, IndicatorBase right, string name) |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right More... | |
static CompositeIndicator | Times (this IndicatorBase left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the product of the left and the constant More... | |
static CompositeIndicator | Times (this IndicatorBase left, IndicatorBase right) |
Creates a new CompositeIndicator such that the result will be the product of the left to the right More... | |
static CompositeIndicator | Times (this IndicatorBase left, IndicatorBase right, string name) |
Creates a new CompositeIndicator such that the result will be the product of the left to the right More... | |
static ExponentialMovingAverage | EMA< T > (this IndicatorBase< T > left, int period, decimal? smoothingFactor=null, bool waitForFirstToReady=true) |
Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator More... | |
static Maximum | MAX (this IIndicator left, int period, bool waitForFirstToReady=true) |
Creates a new Maximum indicator with the specified period from the left indicator More... | |
static Minimum | MIN< T > (this IndicatorBase< T > left, int period, bool waitForFirstToReady=true) |
Creates a new Minimum indicator with the specified period from the left indicator More... | |
static SimpleMovingAverage | SMA< T > (this IndicatorBase< T > left, int period, bool waitForFirstToReady=true) |
Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator More... | |
static object | Of (PyObject second, PyObject first, bool waitForFirstToReady=true) |
The methods overloads bellow are due to python.net not being able to correctly solve generic methods overload. More... | |
static CompositeIndicator | WeightedBy (PyObject value, PyObject weight, int period) |
Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one More... | |
static ExponentialMovingAverage | EMA (PyObject left, int period, decimal? smoothingFactor=null, bool waitForFirstToReady=true) |
Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator More... | |
static Maximum | MAX (PyObject left, int period, bool waitForFirstToReady=true) |
Creates a new Maximum indicator with the specified period from the left indicator More... | |
static Minimum | MIN (PyObject left, int period, bool waitForFirstToReady=true) |
Creates a new Minimum indicator with the specified period from the left indicator More... | |
static SimpleMovingAverage | SMA (PyObject left, int period, bool waitForFirstToReady=true) |
Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator More... | |
static object | Over (PyObject left, decimal constant) |
static object | Over (PyObject left, PyObject right, string name="") |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right More... | |
static object | Minus (PyObject left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the difference of the left and constant More... | |
static object | Minus (PyObject left, PyObject right, string name="") |
Creates a new CompositeIndicator such that the result will be the difference of the left and right More... | |
static object | Times (PyObject left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the product of the left and the constant More... | |
static object | Times (PyObject left, PyObject right, string name="") |
Creates a new CompositeIndicator such that the result will be the product of the left to the right More... | |
static object | Plus (PyObject left, decimal constant) |
Creates a new CompositeIndicator such that the result will be the sum of the left and the constant More... | |
static object | Plus (PyObject left, PyObject right, string name="") |
Creates a new CompositeIndicator such that the result will be the sum of the left and right More... | |
Provides extension methods for Indicator
Definition at line 28 of file IndicatorExtensions.cs.
|
static |
Updates the state of this indicator with the given value and returns true if this indicator is ready, false otherwise
indicator | The indicator to be updated |
time | The time associated with the value |
value | The value to use to update this indicator |
Definition at line 38 of file IndicatorExtensions.cs.
|
static |
Configures the second indicator to receive automatic updates from the first by attaching an event handler to first.DataConsolidated
second | The indicator that receives data from the first |
first | The indicator that sends data via DataConsolidated even to the second |
waitForFirstToReady | True to only send updates to the second if first.IsReady returns true, false to always send updates to second |
T | : | IIndicator |
Definition at line 51 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one
value | Indicator that will be averaged |
weight | Indicator that provides the average weights |
period | Average period |
T | : | IBaseData | |
TWeight | : | IndicatorBase<IndicatorDataPoint> |
Definition at line 73 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the sum of the left and the constant
value = left + constant
left | The left indicator |
constant | The addend |
Definition at line 118 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the sum of the left and right
value = left + right
left | The left indicator |
right | The right indicator |
Definition at line 133 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the sum of the left and right
value = left + right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 148 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the difference of the left and constant
value = left - constant
left | The left indicator |
constant | The subtrahend |
Definition at line 162 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the difference of the left and right
value = left - right
left | The left indicator |
right | The right indicator |
Definition at line 177 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the difference of the left and right
value = left - right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 192 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the constant
value = left/constant
left | The left indicator |
constant | The constant value denominator |
Definition at line 206 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right
value = left/right
left | The left indicator |
right | The right indicator |
Definition at line 221 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right
value = left/right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 236 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the product of the left and the constant
value = left*constant
left | The left indicator |
constant | The constant value to multiple by |
Definition at line 250 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the product of the left to the right
value = left*right
left | The left indicator |
right | The right indicator |
Definition at line 265 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the product of the left to the right
value = left*right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 280 of file IndicatorExtensions.cs.
|
static |
Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator
left | The ExponentialMovingAverage indicator will be created using the data from left |
period | The period of the ExponentialMovingAverage indicators |
smoothingFactor | The percentage of data from the previous value to be carried into the next value |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
T | : | IBaseData |
Definition at line 292 of file IndicatorExtensions.cs.
|
static |
Creates a new Maximum indicator with the specified period from the left indicator
left | The Maximum indicator will be created using the data from left |
period | The period of the Maximum indicator |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
Definition at line 305 of file IndicatorExtensions.cs.
|
static |
Creates a new Minimum indicator with the specified period from the left indicator
left | The Minimum indicator will be created using the data from left |
period | The period of the Minimum indicator |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
T | : | IBaseData |
Definition at line 316 of file IndicatorExtensions.cs.
|
static |
Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator
left | The SimpleMovingAverage indicator will be created using the data from left |
period | The period of the SMA |
waitForFirstToReady | True to only send updates to the second if first.IsReady returns true, false to always send updates to second |
T | : | IBaseData |
Definition at line 328 of file IndicatorExtensions.cs.
|
static |
The methods overloads bellow are due to python.net not being able to correctly solve generic methods overload.
Configures the second indicator to receive automatic updates from the first by attaching an event handler to first.DataConsolidated
second | The indicator that receives data from the first |
first | The indicator that sends data via DataConsolidated even to the second |
waitForFirstToReady | True to only send updates to the second if first.IsReady returns true, false to always send updates to second |
Definition at line 346 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one
value | Indicator that will be averaged |
weight | Indicator that provides the average weights |
period | Average period |
Definition at line 361 of file IndicatorExtensions.cs.
|
static |
Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator
left | The ExponentialMovingAverage indicator will be created using the data from left |
period | The period of the ExponentialMovingAverage indicators |
smoothingFactor | The percentage of data from the previous value to be carried into the next value |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
Definition at line 376 of file IndicatorExtensions.cs.
|
static |
Creates a new Maximum indicator with the specified period from the left indicator
left | The Maximum indicator will be created using the data from left |
period | The period of the Maximum indicator |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
Definition at line 389 of file IndicatorExtensions.cs.
|
static |
Creates a new Minimum indicator with the specified period from the left indicator
left | The Minimum indicator will be created using the data from left |
period | The period of the Minimum indicator |
waitForFirstToReady | True to only send updates to the second if left.IsReady returns true, false to always send updates |
Definition at line 402 of file IndicatorExtensions.cs.
|
static |
Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator
left | The SimpleMovingAverage indicator will be created using the data from left |
period | The period of the SMA |
waitForFirstToReady | True to only send updates to the second if first.IsReady returns true, false to always send updates to second |
Definition at line 415 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the constant
value = left/constant
left | The left indicator |
constant | The constant value denominator |
Definition at line 430 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the ratio of the left to the right
value = left/right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 446 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the difference of the left and constant
value = left - constant
left | The left indicator |
constant | The subtrahend |
Definition at line 466 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the difference of the left and right
value = left - right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 482 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the product of the left and the constant
value = left*constant
left | The left indicator |
constant | The constant value to multiple by |
Definition at line 502 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the product of the left to the right
value = left*right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 518 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the sum of the left and the constant
value = left + constant
left | The left indicator |
constant | The addend |
Definition at line 538 of file IndicatorExtensions.cs.
|
static |
Creates a new CompositeIndicator such that the result will be the sum of the left and right
value = left + right
left | The left indicator |
right | The right indicator |
name | The name of this indicator |
Definition at line 554 of file IndicatorExtensions.cs.