Functions
Summary
This class contains valuable functions that apply to DataSeries.
Signature
1 | |
Namespace
cAlgo.API
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Methods
IsRising
Summary
Checks if the last value in a data series is greater than the previous.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | Input data series |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
1 2 3 4 5 6 | |
IsFalling
Summary
Checks if the last value in a data series is less than the previous
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | Input data series |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
1 2 3 4 5 6 | |
Maximum
Summary
Finds the maximum value in a data series for a given period.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | Input data series |
| period | int | Input period |
Return Value
double
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 | |
1 2 3 4 5 6 | |
1 | |
Minimum
Summary
Finds the minimum of a data series for a given period.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | Input data series |
| period | int | Input period |
Return Value
double
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 | |
1 2 3 4 5 6 | |
1 | |
GetExtremum
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | |
| period | int | |
| extremumCondition | Func |
Return Value
double
HasCrossedAbove (2)
HasCrossedAbove (1 of 2)
Summary
Returns true, if crossingSeries has crossed above crossedSeries, over the specified Period.
Remarks
HasCrossedAbove will compare the crossing data series to the crossed data series starting from thecurrent value of the series going back the specified period.If period is zero only the current bar values will be compared.If period is one the current bar values will be compared as well as the previous.e.g. Functions.HasCrossedAbove(sma.Result, Bars.ClosePrices, 0)will only compare the current values which are not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the twoseries will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| crossedSeries | DataSeries | Crossed data series |
| period | int | Period for which to check for crossing |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 2 3 4 5 6 | |
HasCrossedAbove (2 of 2)
Summary
Checks if crossingSeries has crossed above value, sometime within the specified period.
Remarks
HasCrossedAbove will compare the crossing data series to the crossed data series starting from thecurrent value of the series going back the specified period.If period is zero only the current bar values will be compared.If period is one the current bar values will be compared as well as the previous.e.g. Functions.HasCrossedAbove(sma.Result, value, 0)will only compare the current simple moving average series valuewhich is not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the series will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| value | double | Price value to check if crossed |
| period | int | Period for which to check for crossing |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
1 2 3 4 5 6 7 | |
HasCrossedBelow (2)
HasCrossedBelow (1 of 2)
Summary
Returns true, if crossingSeries has crossed below crossedSeries, over the specified Period.
Remarks
HasCrossedBelow will compare the crossing data series to the crossed data series starting from thecurrent value of the series going back the specified period.If period is zero only the current bar values will be compared.If period is one the current bar values will be compared as well as the previous.e.g. Functions.HasCrossedBelow(sma.Result, Bars.ClosePrices, 0)will only compare the current values which are not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the twoseries will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| crossedSeries | DataSeries | Crossed data series |
| period | int | Period for which to check for crossing |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 2 3 4 5 6 | |
HasCrossedBelow (2 of 2)
Summary
Checks if crossingSeries has crossed below the value, sometime within the specified period.
Remarks
HasCrossedBelow compares the crossing data series to the value starting from thecurrent value of the series going back the specified period.If period is zero, only the current bar value will be examined.If period is one, the current and previous bar value will be examined.e.g. Functions.HasCrossedAbove(sma.Result, value, 0)will only compare the current simple moving average series valuewhich is not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the series will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| value | double | Price value to check if crossed |
| period | int | Period for which to check for crossing |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 2 3 4 5 6 | |
HasCrossed (2)
HasCrossed (1 of 2)
Summary
Returns true, if crossingSeries has crossed above crossedSeries, over the specified Period.
Remarks
HasCrossedAbove will compare the crossing data series to the crossed data series starting from thecurrent value of the series going back the specified period.If period is zero only the current bar values will be compared.If period is one the current bar values will be compared as well as the previous.e.g. Functions.HasCrossedAbove(sma.Result, Bars.ClosePrices, 0)will only compare the current values which are not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the twoseries will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| crossedSeries | DataSeries | Crossed data series |
| period | int | Period for which to check for crossing |
| preCrossCondition | Func | |
| postCrossCondition | Func |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 2 3 4 5 6 | |
HasCrossed (2 of 2)
Summary
Returns true, if crossingSeries has crossed below crossedSeries, over the specified Period.
Remarks
HasCrossedBelow will compare the crossing data series to the crossed data series starting from thecurrent value of the series going back the specified period.If period is zero only the current bar values will be compared.If period is one the current bar values will be compared as well as the previous.e.g. Functions.HasCrossedBelow(sma.Result, Bars.ClosePrices, 0)will only compare the current values which are not completed until the close of the bar.It is not uncommon that the function will return true and by the end of the bar the twoseries will uncross.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| crossingSeries | DataSeries | Crossing data series |
| value | double | |
| period | int | Period for which to check for crossing |
| preCrossCondition | Func | |
| postCrossCondition | Func |
Return Value
bool
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | |
1 2 3 4 5 6 | |
Sum
Summary
Calculates the sum of a data series, over the specified period.
Signature
1 | |
Parameters
| Name | Type | Description |
|---|---|---|
| series | DataSeries | DataSeries of which values are summed |
| period | int | Period of values that are summed prior to current index |
Return Value
double
Examples
1 2 3 4 5 6 | |
1 2 3 4 5 | |