3.8.4.1Changing the initial chart styles and options

A call to CreateDialog() or CreateSubWidget() to display a trading chart can use the settings:{} block to change the chart's initial visual options and styles. For example:

Framework.CreateDialog({

type: "chart",

disposition: "floating",

context: {instrumentId: "GBP/USD", timeframe: 3600},

settings: {

// Lock the instrument selector, and also hide the timeframe selector,

// making that unchangeable too

lockInstrument: true,

hideTimeframe: true

}

});

The settings:{} block can contain the following. All properties are optional.

Property

Type

Description

hideInstrument

Boolean

Hides the toolbar field for changing the chart instrument

lockInstrument

Boolean

Locks the toolbar field for changing the chart instrument (irrelevant if hideInstrument is also used)

hideTimeframe

Boolean

Hides the toolbar field for changing the timeframe

initialPriceStyle

String

Visual price-style style for the chart. See below.

scrollToEndDate

UTC time

Scrolls the chart backwards so that the specified time is the last visible bar. For example: useful when displaying a historic trade, and setting scrollToEndDate to the trade's closeTime.

closeOnOrderPlacement

Boolean

Only applicable when using CreateDialog() rather than CreateSubWidget(). Automatically closes the dialog if the user places a trade using the chart's deal ticket.

An initialPriceStyle value can be one of the following. Note: the default style is user-dependent; can be changed by the user.

Price-style

Description

candle

Candle chart (filled)

hollowCandle

Hollow candles

coloredBar

OHLC bars

coloredHLCBar

HLC bars

line

Line chart

mountain

Mountain (area) chart

heikinAshi

Heikin Ashi candles

lineBreak

Line-break chart

kagi

Kagi chart

pointAndFigure

Point & Figure chart

renko2

Renko chart

range

Range chart

Note: the parameter/periodicity for styles such as Renko and Kagi cannot currently be provided by the caller. A default is always used.