Skip to content

CustomSymbolTradingSession constructor

constructor · CustomSymbolTradingSession · cAlgo.API Since 5.3

DesktopCLICloud

Creates a new custom symbol trading session.

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 CustomSymbolTradingSession(DayOfWeek startDay, DayOfWeek endDay, TimeSpan startTime, TimeSpan endTime)
CustomSymbolTradingSession(startDay: DayOfWeek, endDay: DayOfWeek, startTime: TimeSpan, endTime: TimeSpan)

Parameters

Name C# type Python type Description
startDay DayOfWeek DayOfWeek Start day
endDay DayOfWeek DayOfWeek End day
startTime TimeSpan TimeSpan Start time
endTime TimeSpan TimeSpan End time

Examples

var session = new CustomSymbolTradingSession(DayOfWeek.Sunday, DayOfWeek.Friday, new TimeSpan(22, 0, 0), new TimeSpan(21, 0, 0));
Print("Session: {0} {1} - {2} {3}", session.StartDay, session.StartTime, session.EndDay, session.EndTime);
from System import DayOfWeek, TimeSpan
session = CustomSymbolTradingSession(DayOfWeek.Sunday, DayOfWeek.Friday, TimeSpan(22, 0, 0), TimeSpan(21, 0, 0))
api.Print(f"Session: {session.StartDay} {session.StartTime} - {session.EndDay} {session.EndTime}")