- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX
A Series is a special generic type of data structure that can be constructed with any chosen data type and holds a series of values equal to the same number of elements as bars in a chart.
Series had direct indexing, i.e. Series[0] contains the oldest data. But it is possible to use backward indexing with help of Indexer function of CalculationContext parameter inside OnCalculate function.
For series there are 3 important points: start of series, end of series and current calculating bar. Current calculating bar is changing on every call of OnCalculate function and Indexer[0] returns element at current calculating bar, not the end of the series.
The following snippet of the code shows how to set value to the current calculating element of Series _main
protected override void OnCalculate(CalculateContext ctx)
{
// Write your specific code to calculate indicator values
ctx.Indexer(_main)[0] = 0;
// or ctx.SetValue(_main, 0, 0);
// or _main.SetValueAt(ctx.CurrentBarIndex, 0);
}
Series elements are calculeted only by request. For example if to ask value at 300th bar it will check if this value was calculated. If it was not, then it will be calculated up to 300th bar, not further.Â
Each element of a Series has a property IsValid, that checks whether value was set to an element or not.
As Indicator is inherited from ISeries interface, it can be passed to another indicator or strategy as abstract data source.
- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX