Namespace: Symbology

STX.Market. Symbology

Set of rules for identifying instrument's exchange and deriving a market definition from a symbol. This is only required if your chart will need to know the operating hours for the different exchanges. If using a 24x7 chart, this class is not needed.

By default these rules are assigned to functions using ChartIQ symbology to identify the exchange.

Before using, they must be reviewed and if necessary assigned to functions containing logic to match symbology rules for your quote data.

Since:
  • 04-2016-08

Methods


<static> factory(symbolObject)

This is a function that takes a symbolObject of form accepted by STXChart#newChart, and returns a market definition. When loading it with STXChart#setMarketFactory, it will be used by the chart to dynamically change market definitions when a new instrument is activated. See STX.Market for instruction on how to create a market definition.

Parameters:
Name Type Description
symbolObject Object

Symbol object of form accepted by STXChart#newChart

Since:
  • 04-2016-08
Returns:

A market definition. See STX.Market for instructions.

Type
Object

<static> isForeignSymbol(symbol)

Returns true if the instrument is foreign. This is dependent on the market data feed and should be overridden accordingly. Currently if the instrument contains a period (.) it will be considered foreign (non US). (e.g. .XXXX)

Parameters:
Name Type Description
symbol string

The symbol

Since:
  • 04-2016-08
Returns:

True if it's a foreign symbol

Type
Boolean

<static> isForexFuturesSymbol(symbol)

Returns true if the symbol is a forex or a future This is dependent on the market data feed and should be overridden accordingly.

Parameters:
Name Type Description
symbol string

The symbol

Since:
  • 04-2016-08
Returns:

True if the symbol is a forex or a future

Type
Boolean

<static> isForexMetal(symbol, inverse)

Returns true if the symbol is a metal/currency or currency/metal pair This is dependent on the market data feed and should be overridden accordingly. Currently it must be a forex for a precious metal. (e.g. ^XAUUSD - looks for XAU,XPD,XPT,XAG only)

Parameters:
Name Type Description
symbol string

The symbol

inverse boolean

Set to true to test specifically for a currency/metal pair.

Since:
  • 04-2016-08
Returns:

True if it's a metal symbol

Type
Boolean

<static> isForexSymbol(symbol)

Returns true if the instrument is a forex symbol. This is dependent on the market data feed and should be overridden accordingly. Currently if the symbol begins with ^ and is followed by 6 alpha caracters, or just 6 alpha characters long without a '^', it will be considered forex.(e.g. ^EURUSD)

Parameters:
Name Type Description
symbol string

The symbol

Since:
  • 04-2016-08
Returns:

True if it's a forex symbol

Type
Boolean

<static> isFuturesSymbol(symbol)

Returns true if the instrument is a futures. This is dependent on the market data feed and should be overridden accordingly. Currently if the symbol begins with / it will be considered a future. (e.g. /C)

Parameters:
Name Type Description
symbol string

The symbol

Since:
  • 04-2016-08
Returns:

True if it's a futures symbol

Type
Boolean