Skip to content

LastValue Property

Summary

Gets the last value of this DataSeries.

Remarks

The last value may represent one of the values of the last bar of the market series, e.g. Open, High, Low and Close. Therefore, take into consideration that on each tick, except the Open price, the rest of the values will most probably change.

Signature

1
public abstract double LastValue {get;}

Return Value

double

Declaring Type

cAlgo.API.DataSeries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 //...
 protected override void OnTick()
 {
     double lastValue = MarketSeries.Close.LastValue;
        Print("The last value of MarketSeries.Close Series is: {0}", MarketSeries.Close.LastValue);
     // Property LastValue has an accessor but no setter, i.e. LastValue can be retrieved but not set.
     // The following code will produce an error
     MarketSeries.Close.LastValue = 100;
 }
 //...

Last update: March 17, 2023