Skip to content

BacktestingDataSourceMinMaxTimeArgs.PriceDataSourceId

property · BacktestingDataSourceMinMaxTimeArgs · cAlgo.API Since 5.3

DesktopCLICloud

Gets price data source Id for the min / max time request.

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 PriceDataSourceId PriceDataSourceId {get;}
backtestingDataSourceMinMaxTimeArgs.PriceDataSourceId: PriceDataSourceId

Returns PriceDataSourceId

Examples

private BacktestingMinMaxTime OnMinMaxTimeRequested(BacktestingDataSourceMinMaxTimeArgs args)
{
    var bars = MarketData.GetBars(args.PriceDataSourceId.TimeFrame, args.PriceDataSourceId.Symbol.Name);
    return new BacktestingMinMaxTime(bars[0].OpenTime, bars.LastBar.OpenTime);
}
def on_min_max_time_requested(self, args):
    bars = api.MarketData.GetBars(args.PriceDataSourceId.TimeFrame, args.PriceDataSourceId.Symbol.Name)
    return BacktestingMinMaxTime(bars[0].OpenTime, bars.LastBar.OpenTime)