CustomSymbolMarketHours
interface cAlgo.API Since 5.3
DesktopCLICloud
Access to custom symbol's trading sessions schedule.
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 interface CustomSymbolMarketHours
Namespace: cAlgo.API · Group: Custom
Examples
var customSymbol = CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD"));
var marketHours = customSymbol.MarketHours;
marketHours.Sessions.Clear();
marketHours.Sessions.Add(new CustomSymbolTradingSession(DayOfWeek.Sunday, DayOfWeek.Friday, new TimeSpan(22, 0, 0), new TimeSpan(21, 59, 0)));
marketHours.Holidays.Add(new CustomSymbolTradingHoliday("New Year", new DateTime(2026, 1, 1), new DateTime(2026, 1, 2), true));
from System import DayOfWeek, TimeSpan, DateTime
customSymbol = api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD"))
marketHours = customSymbol.MarketHours
marketHours.Sessions.Clear()
marketHours.Sessions.Add(CustomSymbolTradingSession(DayOfWeek.Sunday, DayOfWeek.Friday, TimeSpan(22, 0, 0), TimeSpan(21, 59, 0)))
marketHours.Holidays.Add(CustomSymbolTradingHoliday("New Year", DateTime(2026, 1, 1), DateTime(2026, 1, 2), True))
Properties
| Name | Description |
|---|---|
HolidaysDesktopCLICloudICollection<CustomSymbolTradingHoliday> | Collection of all symbol's trading holidays |
SessionsDesktopCLICloudICollection<CustomSymbolTradingSession> | Collection of all symbol's trading sessions |