Skip to content

TradingHoliday.StartTime

property · TradingHoliday · cAlgo.API Since 5.2

DesktopCLICloud

Gets the start date and time of the trading holiday.

Definition

DateTime StartTime {get;}
tradingHoliday.StartTime: DateTime

Returns DateTime

Examples

var nextHoliday = Symbol.MarketHours.Holidays.Where(holiday => holiday.StartTime > Server.Time).OrderBy(holiday => holiday.StartTime).FirstOrDefault();
if (nextHoliday != null)
    Print("Next holiday {0} starts at {1}", nextHoliday.Name, nextHoliday.StartTime);
upcoming = [holiday for holiday in api.Symbol.MarketHours.Holidays if holiday.StartTime > api.Server.Time]
if len(upcoming) > 0:
    nextHoliday = min(upcoming, key=lambda holiday: holiday.StartTime)
    api.Print(f"Next holiday {nextHoliday.Name} starts at {nextHoliday.StartTime}")