BacktestingTick constructor
constructor · BacktestingTick · cAlgo.API Since 5.3
DesktopCLICloud
Represents a tick, used for backtesting data source tick data.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
public BacktestingTick(DateTime Time, double Bid, double Ask)
BacktestingTick(Time: DateTime, Bid: float, Ask: float)
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
Time | DateTime | DateTime | Timestamp |
Bid | double | float | Bid Price |
Ask | double | float | Ask Price |
Examples
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);
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}")
See also