Data functions are used for reading bar values from the underlying data series. 


Use the DataSeriesSwitch function to switch between multiple data series 

Use the SymbolSwitch function to switch between multiple underlying symbols (Only available for Multi-Symbol Trading Strategies).


Sections


Functions

Function Details


Functions


Name

Description

double DataAsk(int)

Gets the ask price of a specified tick of the underlying symbol.

long DataAskDateTime(int)

Gets the ask date/time of a specified tick of the underlying symbol.

double DataAskSize(int)

Gets the ask size of a specified tick of the underlying symbol.

double DataAveragePrice(int)

Gets the average price of a specified bar of the underlying symbol (Open + High + Low + Close) / 4.

double DataBid(int)

Gets the bid price of a specified tick of the underlying symbol.

long DataBidDateTime(int)

Gets the bid date/time of a specified tick of the underlying symbol.

double DataBidSize(int)

Gets the bid size of a specified tick of the underlying symbol.

double DataClose(int)

Gets the closing price of a specified bar of the underlying symbol.

long DataEndDateTime(int)

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

double DataFundamental(C_FundamentalsReportType, int, C_FundamentalType)

Gets a specified fundamental value for the underlying symbol from a specified financial report.

int DataFundamentalReportCount(C_FundamentalsReportType)

Gets the number of financial reports of a specified type that are available for the underlying symbol.

double DataHigh(int)

Gets the highest price of a specified bar of the underlying symbol.

bool DataIsComplete(int)

Determines whether a specified bar of the underlying symbol is completely built.

bool DataIsMissing(int)

Determines whether a specified bar of the underlying symbol is missing.

double DataLow(int)

Gets the lowest price of a specified bar of the underlying symbol.

double DataNextOpen()

Gets the open price of the next bar of the underlying symbol. This function should not be used during live trading, as the value does not exist.

double DataOpen(int)

Gets the opening price of a specified bar of the underlying symbol.

double DataOpenInterest(int)

Gets the open interest of a specified bar of the underlying symbol.

double DataRange(int)

Gets the price range of a specified bar of the underlying symbol (High - Low).

void DataSplitsDividendsAdjusted(bool shouldAdjust)

Sets whether the data functions should be adjusted for splits and dividends. The default is true unless explicitly modified in the Options window or this function is called with false.

long DataStartDateTime(int)

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

int DataTotalCount()

Gets the total number of bars processed so far for the underlying symbol.

double DataTrade(int)

Gets the trade price of a specified tick of the underlying symbol.

long DataTradeDateTime(int)

Gets the trade date/time of a specified tick of the underlying symbol

double DataTradeSize(int)

Gets the last size of a specified tick of the underlying symbol.

double DataTypicalPrice(int)

Gets the typical price of a specified bar of the underlying symbol (High + Low + Close) / 3.

double DataVolume(int)

Gets the volume of a specified bar of the underlying symbol.


Function Details


double DataAsk(int barShift)

Gets the ask price of a specified tick of the underlying symbol.


Returns


The ask price of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


long DataAskDateTime(int barShift)

Gets the ask date/time of a specified tick of the underlying symbol.


Returns


The ask date/time of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataAskSize(int barShift)

Gets the ask size of a specified tick of the underlying symbol.


Returns


The ask size of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataAveragePrice(int barShift)

Gets the average price of a specified bar of the underlying symbol (Open + High + Low + Close) / 4.


Returns


The average price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataBid(int barShift)

Gets the bid price of a specified tick of the underlying symbol.


Returns


The bid price of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


long DataBidDateTime(int barShift)

Gets the bid date/time of a specified tick of the underlying symbol.


Returns


The bid date/time of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataBidSize(int barShift)

Gets the bid size of a specified tick of the underlying symbol.


Returns


The bid size of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataClose(int barShift)

Gets the closing price of a specified bar of the underlying symbol.


Returns


The closing price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


long DataEndDateTime(int barShift)

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


Returns


The end date/time of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataFundamental(C_FundamentalsReportType fundamentalsReportType, int reportIndex, C_FundamentalType fundamentalType)

Gets a specified fundamental value for the underlying symbol from a specified financial report.


Returns


The specified fundamental value for the underlying symbol from the specified financial report.


Parameters


Type

Identifier

Description

C_FundamentalsReportType

fundamentalsReportType

The report type

int

reportIndex

The index of the report in the specified report type list

C_FundamentalType

fundamentaType

The fundamental type (View Options)


Scripts


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


int DataFundamentalReportCount(C_FundamentalsReportType fundamentalsReportType)

Gets the number of financial reports of a specified type that are available for the underlying symbol.


Returns


The number of financial reports of the specified type that are available for the underlying symbol.


Parameters


Type

Identifier

Description

C_FundamentalsReportType

fundamentalsReportType

The report type


Scripts


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


double DataHigh(int barShift)

Gets the highest price of a specified bar of the underlying symbol.


Returns


The highest price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


bool DataIsComplete(int barShift)

Determines whether a specified bar of the underlying symbol is completely built.


Returns


True if the specified bar of the underlying symbol is completely built, false otherwise.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


bool DataIsMissing(int barShift)

Determines whether a specified bar of the underlying symbol is missing.


Returns


True if the specified bar of the underlying symbol is missing, false otherwise.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataLow(int barShift)

Gets the lowest price of a specified bar of the underlying symbol.


Returns


The lowest price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataNextOpen()

Gets the open price of the next bar of the underlying symbol. This function should not be used during live trading, as the value does not exist.


Returns


The open price of the next bar of the underlying symbol.


Scripts


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


double DataOpen(int barShift)

Gets the opening price of a specified bar of the underlying symbol.


Returns


The opening price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataOpenInterest(int barShift)

Gets the open interest of a specified bar of the underlying symbol.


Returns


The open interest of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataRange(int barShift)

Gets the price range of a specified bar of the underlying symbol (High - Low).


Returns


The price range of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


void DataSplitsDividendsAdjusted(bool shouldAdjust)

Sets whether the data functions should be adjusted for splits and dividends. The default is true unless explicitly modified in the Options window or this function is called with false.


Parameters


Type

Identifier

Description

bool

shouldAdjust

Indicates whether the data functions should be adjusted for splits and dividends.


Scripts


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


long DataStartDateTime(int barShift)

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


Returns


The start date/time of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


int DataTotalCount()

Gets the total number of bars processed so far for the underlying symbol.


Returns


The total number of bars processed so far for the underlying symbol.


Scripts


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


double DataTrade(int barShift)

Gets the trade price of a specified tick of the underlying symbol.


Returns


The trade price of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


long DataTradeDateTime(int barShift)

Gets the trade date/time of a specified tick of the underlying symbol.


Returns


The trade date/time of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataTradeSize(int barShift)

Gets the trade size of a specified tick of the underlying symbol.


Returns


The trade size of the specified tick of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataTypicalPrice(int barShift)

Gets the typical price of a specified bar of the underlying symbol (High + Low + Close) / 3.


Returns


The typical price of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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


double DataVolume(int barShift)

Gets the volume of a specified bar of the underlying symbol.


Returns


The volume of the specified bar of the underlying symbol.


Parameters


Type

Identifier

Description

int

barShift

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


Scripts


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