---
id: "M:cAlgo.API.CustomSymbolTradingSession.#ctor(System.DayOfWeek,System.DayOfWeek,System.TimeSpan,System.TimeSpan)"
kind: "constructor"
type: "T:cAlgo.API.CustomSymbolTradingSession"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbolTradingSession/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CustomSymbolTradingSession constructor

Member of [CustomSymbolTradingSession](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbolTradingSession/index.md).

## CustomSymbolTradingSession(DayOfWeek startDay, DayOfWeek endDay, TimeSpan startTime, TimeSpan endTime)

Creates a new custom symbol trading session.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public CustomSymbolTradingSession(DayOfWeek startDay, DayOfWeek endDay, TimeSpan startTime, TimeSpan endTime)
```

Python:

```python
CustomSymbolTradingSession(startDay: DayOfWeek, endDay: DayOfWeek, startTime: TimeSpan, endTime: TimeSpan)
```

### Parameters

- `startDay` (`DayOfWeek`, Python `DayOfWeek`): Start day
- `endDay` (`DayOfWeek`, Python `DayOfWeek`): End day
- `startTime` (`TimeSpan`, Python `TimeSpan`): Start time
- `endTime` (`TimeSpan`, Python `TimeSpan`): End time

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
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);
```

Python:

```python
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}")
```

