TimeSeries.Last
method · TimeSeries · cAlgo.API
DesktopCLICloud
Access a value in the data series certain number of bars ago.
Definition
DateTime Last(int index)
timeSeries.Last(index: int) -> DateTime
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
index | int | int | Number of bars ago |
Returns DateTime
Examples
var openTime = Bars.OpenTimes.Last(5);
Print("The bar five bars ago opened at {0}", openTime);
openTime = api.Bars.OpenTimes.Last(5)
api.Print(f"The bar five bars ago opened at {openTime}")