Session functions are mostly used for accessing exchange sessions and their details.


Sections


Functions

Function Details


Functions


Name

Description

int SessionBarCount()

Gets the number of bars created thus far in the current open session of the underlying symbol.

double SessionClose(int)

Gets the closing price of a specified closed session of the underlying symbol.

long SessionEndDateTime(int)

Gets the end date/time of a specified closed session of the underlying symbol.

double SessionFirstBarClose()

Gets the closing price of the first bar in the current open session of the underlying symbol.

double SessionFirstBarHigh()

Gets the highest price of the first bar in the current open session of the underlying symbol.

double SessionFirstBarLow()

Gets the lowest price of the first bar in the current open session of the underlying symbol.

double SessionFirstBarOpen()

Gets the opening price of the first bar in the current open session of the underlying symbol.

double SessionFirstBarOpenInterest()

Gets the open interest of the first bar in the current open session of the underlying symbol.

double SessionFirstBarVolume()

Gets the volume of the first bar in the current open session of the underlying symbol.

double SessionHigh(int)

Gets the highest price of a specified closed session of the underlying symbol.

bool SessionIsFirstBar()

Determines whether the latest bar is the first bar of the current open session of the underlying symbol.

double SessionLow(int)

Gets the lowest price of a specified closed session of the underlying symbol.

double SessionOpen(int)

Gets the opening price of a specified closed session of the underlying symbol.

double SessionOpenInterest(int)

Gets the open interest of a specified closed session of the underlying symbol.

long SessionStartDateTime(int)

Gets the start date/time of a specified closed session of the underlying symbol.

int SessionTotalBarCount()

Gets the total number of bars processed by the script thus far during the current Desktop run.

double SessionVolume(int)

Gets the volume of a specified closed session of the underlying symbol.


Function Details


int SessionBarCount()

Gets the number of bars created thus far in the current open session of the underlying symbol.


Returns


The number of bars created thus far in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionClose(int sessionShift)

Gets the closing price of a specified closed session of the underlying symbol.


Returns


The closing price of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


long SessionEndDateTime(int sessionShift)

Gets the end date/time of a specified closed session of the underlying symbol.


Returns


The end date/time of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarClose()

Gets the closing price of the first bar in the current open session of the underlying symbol.


Returns


The closing price of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarHigh()

Gets the highest price of the first bar in the current open session of the underlying symbol.


Returns


The highest price of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarLow()

Gets the lowest price of the first bar in the current open session of the underlying symbol.


Returns


The lowest price of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarOpen()

Gets the opening price of the first bar in the current open session of the underlying symbol.


Returns


The opening price of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarOpenInterest()

Gets the open interest of the first bar in the current open session of the underlying symbol.


Returns


The open interest of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionFirstBarVolume()

Gets the volume of the first bar in the current open session of the underlying symbol.


Returns


The volume of the first bar in the current open session of the underlying symbol.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionHigh(int sessionShift)

Gets the highest price of a specified closed session of the underlying symbol.


Returns


The highest price of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


bool SessionIsFirstBar()

Determines whether the latest bar is the first bar of the current open session of the underlying symbol.


Returns


True if the latest bar is the first bar of the current open session, false otherwise.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionLow(int sessionShift)

Gets the lowest price of a specified closed session of the underlying symbol.


Returns


The lowest price of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionOpen(int sessionShift)

Gets the opening price of a specified closed session of the underlying symbol.


Returns


The opening price of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionOpenInterest(int sessionShift)

Gets the open interest of a specified closed session of the underlying symbol.


Returns


The open interest of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


long SessionStartDateTime(int sessionShift)

Gets the start date/time of a specified closed session of the underlying symbol.


Returns


The start date/time of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


int SessionTotalBarCount()

Gets the total number of bars processed by the script thus far during the current Desktop run.


Returns


The total number of bars processed by the script thus far during the current Desktop run.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy


double SessionVolume(int sessionShift)

Gets the volume of a specified closed session of the underlying symbol.


Returns


The volume of the specified closed session of the underlying symbol.


Parameters


Type

Identifier

Description

int

sessionShift

The shift relative to the latest closed session, such that 0 is the latest closed session, 1 is the session preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Screener, Pattern, PositionSizing, Signal, TradingStrategy