---
id: "M:cAlgo.API.BacktestingTick.#ctor(System.DateTime,System.Double,System.Double)"
kind: "constructor"
type: "T:cAlgo.API.BacktestingTick"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingTick/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# BacktestingTick constructor

Member of [BacktestingTick](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingTick/index.md).

## BacktestingTick(DateTime Time, double Bid, double Ask)

Represents a tick, used for backtesting data source tick data.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public BacktestingTick(DateTime Time, double Bid, double Ask)
```

Python:

```python
BacktestingTick(Time: DateTime, Bid: float, Ask: float)
```

### Parameters

- `Time` (`DateTime`, Python `DateTime`): Timestamp
- `Bid` (`double`, Python `float`): Bid Price
- `Ask` (`double`, Python `float`): Ask Price

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var lastTick = MarketData.GetTicks("EURUSD").LastTick;
var tick = new BacktestingTick(lastTick.Time, lastTick.Bid, lastTick.Ask);
Print("Backtesting tick {0}: bid {1}, ask {2}", tick.Time, tick.Bid, tick.Ask);
```

Python:

```python
lastTick = api.MarketData.GetTicks("EURUSD").LastTick
tick = BacktestingTick(lastTick.Time, lastTick.Bid, lastTick.Ask)
api.Print(f"Backtesting tick {tick.Time}: bid {tick.Bid}, ask {tick.Ask}")
```

