`leadts` is not recommended. Use `timetable` instead. For more information, see Convert Financial Time Series Objects fints to Timetables.

## Syntax

``newfts = leadts(oldfts)``
``newfts = leadts(oldfts,leadperiod)``
``newfts = leadts(oldfts,leadperiod,padmode)``

## Description

example

````newfts = leadts(oldfts)` advances the data series in `oldfts` by one time series date entry and returns the result in the object `newfts`. The end will be padded with zeros, by default. ```

example

````newfts = leadts(oldfts,leadperiod)` shifts time series values to the left on an increasing time scale. `leadts` advances the data series to happen at an earlier time. `leadperiod` is the number of lead periods expressed in the frequency of the time series object `oldfts`. For example, if `oldfts` is a daily time series, `leadperiod` is specified in days. `leadts` pads the data with zeros (default).```

example

````newfts = leadts(oldfts,leadperiod,padmode)` lets you pad the data with an arbitrary value, `NaN`, or `Inf` rather than zeros by setting `padmode` to the desired value.```

## Examples

collapse all

1. Create a `fints` object.

`dates_and_times = (now:now+5)'`
```dates_and_times = 1.0e+05 * 7.3840 7.3840 7.3840 7.3841 7.3841 7.3841 ```
` tsobj = fints(dates_and_times, randn(6,1))`
```Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see Convert Financial Time Series Objects (fints) to Timetables. > In fints (line 169) ```
```tsobj = desc: (none) freq: Unknown (0) {'dates: (6)'} {'times: (6)'} {'series1: (6)'} {'07-Sep-2021'} {'12:30' } {[ 0.5377]} {'08-Sep-2021'} {'12:30' } {[ 1.8339]} {'09-Sep-2021'} {'12:30' } {[ -2.2588]} {'10-Sep-2021'} {'12:30' } {[ 0.8622]} {'11-Sep-2021'} {'12:30' } {[ 0.3188]} {'12-Sep-2021'} {'12:30' } {[ -1.3077]}```
2. Advance a financial time series object by a specified time step using `leadts`.

`newfts = leadts(tsobj,2)`
```Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see Convert Financial Time Series Objects (fints) to Timetables. > In fints/leadts (line 33) newfts = desc: LEADTS on freq: Unknown (0) {'dates: (6)'} {'times: (6)'} {'series1: (6)'} {'07-Sep-2021'} {'12:30' } {[ -2.2588]} {'08-Sep-2021'} {'12:30' } {[ 0.8622]} {'09-Sep-2021'} {'12:30' } {[ 0.3188]} {'10-Sep-2021'} {'12:30' } {[ -1.3077]} {'11-Sep-2021'} {'12:30' } {[ 0]} {'12-Sep-2021'} {'12:30' } {[ 0]}```

## Input Arguments

collapse all

Financial time series object, specified as a `fints` object.

Data Types: `object`

Number of lead periods expressed in the frequency of the time series object, specified as an integer.

Data Types: `double`

Data padding value, specified as a character vector with a value of `'NaN'` or `'Inf'`.

Data Types: `char`

## Output Arguments

collapse all

Financial time series object, returned as a `fints` object.

## Version History

Introduced before R2006a