Chapter 14:
Stock Chart (ASM) Attributes


ATTRIBUTE

Description

ASM_HLWIDTH

High/Low bar Width of riser in a stock chart

ASM_ITEM_DTXT

Item Data Text for data text items in a stock market chart

ASM_METRIC1/2/3

Define metric lines in a stock chart

ASM_OCHEIGHT

Open/Close Height of ticks in a stock chart

ASM_OCWIDTH

Open/Close Width of ticks in a stock chart

ASM_SHOW_CLOSE

Show/Hide close ticks in a stock chart

ASM_SHOW_OPEN

Show/Hide Open ticks in a stock

ASM_SYMBOL_STYLE

Defines the style of Markers on Stock Chart

ASM_HLWIDTH

 

This attribute sets the width of the HighLow bars (i.e., risers) in a stock market graph. It is similar to A2D_BAR_SPACING, but it allows the stock market bars to be any width desired.

Type:

INT16

Valid Range:

Any positive INT16 value

Default:

80

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
INT16 nGraphType = 3; /* SELECT STOCK MARKET CHART */
INT16 two = 2;/* DATA FORMAT FOR HI/LO/OPEN VALUES */
INT16 HiLoWide = 2000;/* WIDTH OF HIGH/LOW RISER */
SetGraphAttrSL(gpGraph, NULL,
     A2D_DATAFORMAT, (void FAR *)&two);
SetGraphAttrSL(gpGraph, NULL,
     ASM_HLWIDTH, (void FAR *)&HiLoWide);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

Although there is no limit to the width of risers/bars in a stock market graph, reasonable/readable values are limited to the output device and the number of groups/items being charted. Larger values may cause risers to overlap.

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

ASM_ITEM_DTXT

 

When data text values are enabled via A2D_SHOW_DATATEXT, this attribute controls the type of data text items displayed in a stock market graph.

Type:

INT16

Valid Range:

0...3

 

0=

Show High Values

 

1=

Show Low Values

 

2=

Show Open Values

 

3=

Show Close Values

Default:

1 (Show Low Values)

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
/* SELECT STOCK MARKET CHART */
INT16 nGraphType = 3;
/* DATA FORMAT FOR HI/LO/OPEN VALUES */
INT16 two = 2;
/* SHOW CLOSE VALUES */
INT16 StkValue = 3;
/* DOLLARS/CENTS ($0.00) FORMAT */
INT16 nDollarFmt = 8;
SetGraphAttrSL(gpGraph, NULL,
     A2D_DATAFORMAT, (void FAR *)&two);
SetGraphAttrSL(gpGraph, NULL,
     ASM_ITEM_DTXT, &StkValue);
SetGraphAttrSL(gpGraph, NULL,
     A2D_SHOW_DATATEXT, &bTRUE);
SetGraphAttrSL(gpGraph, NULL,
     A2D_FORMATDTXT_Y1,&nDollarFmt);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

The A2D_SHOW_DATATEXT attribute must be enabled (TRUE) in order for this attribute to have any affect on the graph. You may also use the A2D_FORMAT_DTXT_Y1 attribute to specify the format (i.e., typically dollars and cents ($9.99)) in which data text values are drawn.

Also See:

A2D_SHOW_DATATEXT, A2D_FORMATDTXT_Y1

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

ASM_METRIC1/2/3

 

These attributes enable/disable and define the style of metric lines in a stock chart. ASM_METRIC1 is used on the Y2 axis. ASM_METRIC2 is used on the Y3 axis. ASM_METRIC3 is used on the Y4 axis.

Type:

typedef struct _TDG_StockMetricInfo{
     BOOLEAN16 bShow;
     INT16 nDisplayStyle;
     char szMetricLabel[64];
} TDG_StockMetricInfo, FAR *TDG_StockMetricInfoPtr;

Valid Range:

bShow: TRUE/FALSE

 

TRUE=

Show metric lines/labels

 

FALSE=

Do not show metric lines/labels

 

nDisplayStyle: a value from StockMetricStyles enum

 

StockMetricStyles

Value

Description

 

METRIC_VERTICAL_LINE

0

Draws a single vertical line for each riser on this (Y1, Y2, or Y3) axis

 

METRIC_LINE_CHART

1

Risers are represented by lines

 

METRIC_AREA_CHART

2

Risers are represented by areas

 

METRIC_BAR_CHART

3

Risers are represented by bars

 

METRIC_DOT

4

Risers are represented by dotted lines

 

METRIC_AREA_CHART2

5

Risers are represented by vertical lines connected by horizontal lines forming areas.

 

szMetricLabel; Label for Metric (up to 64 characters)

Default:

bShow = FALSE

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

         

ASM_OCHEIGHT

 

This attribute is used to specify the height of the open and close tick marks that are displayed next to risers in a stock market graph.

Type:

INT16

Valid Range:

Any INT16 value.

Default:

50

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
/* SELECT STOCK MARKET CHART */
INT16 nGraphType = 3;
INT16 OpClHigh = 1500;
SetGraphAttrSL(gpGraph, NULL,
     ASM_OCHEIGHT, (void FAR *)&OpClHigh);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

The ASM_OCWIDTH attribute can be used to specify the width of open and close tick marks.

Also See:

ASM_OCWIDTH

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

ASM_OCWIDTH

 

This attribute is used to specify the width of the open and close tick marks that are displayed next to risers in a stock market graph.

Type:

INT16

Valid Range:

Any INT16 value

Default:

80

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
/* SELECT STOCK MARKET CHART */
INT16 nGraphType = 3;
INT16 OpClWide = 1000;
SetGraphAttrSL(gpGraph, NULL,
     ASM_OCWIDTH, (void FAR *)&OpClWide);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

The ASM_OCHEIGHT attribute can be used to specify the height of open and close tick marks.

Also See:

ASM_OCHEIGHT

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

ASM_SHOW_CLOSE

 

This attribute enables/disables drawing of the close tick mark in a stock market graph.

Type:

BOOLEAN16

Valid Range:

TRUE/FALSE

 

TRUE=

Show close tick mark

 

FALSE=

Do not show close tick mark.

Default:

TRUE

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
/* SELECT STOCK MARKET CHART */
INT16 nGraphType = 3;
/* DIABLE CLOSE TICK MARK */
BOOLEAN bFALSE = FALSE;
SetGraphAttrSL(gpGraph, NULL,
     ASM_SHOW_CLOSE,(void FAR *)&bFALSE);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

When this attribute is enabled (TRUE), the ASM_OCHEIGHT and ASM_OCWIDTH attribute can be used to change the size of the close tick marks.

Also See:

ASM_OCHEIGHT, ASM_OCWIDTH

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

ASM_SHOW_OPEN

 

This attribute enables/disables drawing of the open tick mark in a stock market graph.

Type:

BOOLEAN16

Valid Range:

TRUE/FALSE

 

TRUE=

Show open tick mark

 

FALSE=

Do not show open tick mark.

Default:

TRUE

Example:

TDG_GraphPresetInfo GraphTable [4] = {
     {TDG_GRAPH_BARS ,8},
     {TDG_GRAPH_LINES,0},
     {TDG_GRAPH_AREA ,4},
     {TDG_GRAPH_SPECIAL, 5}};
/* SELECT STOCK MARKET CHART */
INT16 nGraphType = 3;
/* DISABLE OPEN TICK MARK */
BOOLEAN bFALSE = FALSE;
SetGraphAttrSL(gpGraph, NULL,
     ASM_SHOW_OPEN,(void FAR *)&bFALSE);
SetGraphAttr(gpGraph, GRAPH_LAYER,
     NULL_OBJECTID, NULL_SERIESID,
     NULL_GROUPID, A_GRAPH_PRESET,
      (void FAR *) &GraphTable[nGraphType]);

Notes:

When this attribute is enabled (TRUE), the ASM_OCHEIGHT and ASM_OCWIDTH attributes can be used to change the size of the open tick marks.

Also See:

ASM_OCHEIGHT, ASM_OCWIDTH

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock

         

ASM_SYMBOL_STYLE

 

This attribute defines the style of symbols used in a stock chart. These styles only apply to high/low/open/close stock charts.

Type:

INT16

Valid Range:

A value from the StockSymbolStyles enum:

 

StockSymbolStyles

Value

Description

 

DEFAULT_STYLE

0

Normal risers

 

VERTICAL_LINE

1

Vertical lines with extruded horizontal lines identifying open and close values.

 

CANDLESTICK

2

Candle stick type marker

 

LINE_CHART

3

Normal line chart risers

 

AREA_CHART

4

Normal area chart

 

LINE_CIRCLE

5

Vertical lines with filled circles

 

DOT

6

Dotted line

 

AREA_CHART2

7

Risers are represented by vertical lines connected by horizontal lines forming areas.

Default:

DEFAULT_STYLE (0)

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

Stock