ChartStyleType

View as Markdown

Definition

Defines a unique identifier value used to register a custom ChartStyle. There are 11 default ChartStyles which come with NinjaTrader which are reserved per the table on this page under the Parameters section of this page.

The ChartStyle property can allow a large number of ChartStyles to be registered on a single user’s installation (up to 2,147,483,647). However, it’s important to note that it is still possible for two installed ChartStyles on a user’s computer to conflict should they be registered to the same enumerator value. In this case, NinjaTrader will ignore the conflicting ChartStyle type and information pertaining to this conflict will be displayed on the Log tab.

Added 1/31/2018: We advise users to use values larger than 1023 when selecting an enum. As NinjaTrader from time to time may add a new enum value in that range which may cause conflicts.

Property Value

A enum value representing the ChartStyle to be registered.

It is recommended to pick high, unique enumeration value to avoid conflict from other ChartStyles that may be used by a single installation.

Syntax

You must cast ChartStyleType from an int using the following syntax:

ChartStyleType = (ChartStyleType) 80;

Parameters

Reserved enumeration values are listed below:

ValueChartStyle
0Box
1CandleStick
2LineOnClose
3OHLC
4PointAndFigure
5KagiLine
6OpenClose
7Mountain
8Volumetric
9HollowCandleStick
10Equivolume

Examples

1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 Name = "Example ChartStyle";
6 ChartStyleType = (ChartStyleType) 80;
7 BarWidth = 1;
8 }
9}