Skip to content

CustomSymbolMarketHours.Sessions

property · CustomSymbolMarketHours · cAlgo.API Since 5.3

DesktopCLICloud

Collection of all symbol's trading sessions

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

ICollection<CustomSymbolTradingSession> Sessions {get;}
customSymbolMarketHours.Sessions: Sequence[CustomSymbolTradingSession]

Returns ICollection<CustomSymbolTradingSession>

Examples

var customSymbol = CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD"));
foreach (var session in customSymbol.MarketHours.Sessions)
    Print("Session: {0} {1} - {2} {3}", session.StartDay, session.StartTime, session.EndDay, session.EndTime);
customSymbol = api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD"))
for session in customSymbol.MarketHours.Sessions:
    api.Print(f"Session: {session.StartDay} {session.StartTime} - {session.EndDay} {session.EndTime}")