AB_Mode (Function)

image\trumpet2.gif Disclaimer

The AB_Mode function returns the number of cells and price in the Mode row of the current bar.

Syntax

AB_Mode(Side, Type, oModeCount, oModePrice)

Returns (Integer)

The oModeCount and oModePrice output parameters return the number of cells and price in the mode row.  The AB_Mode function itself returns a value of 1 if successful and -1 otherwise.

Parameters

Name Type Description
Side Numeric Sets the side of the ActivityBar on which the Mode will be calculated; options are LeftSide, RightSide and 2 for both sides.
Type Numeric Sets either the largest or smallest mode to indicate (>= 0 for largest, < 0 for smallest).
oModeCount Numeric Outputs the mode count in the mode row.
oModePrice Numeric Outputs the mode price in the mode row.

Remarks

The Mode refers to the ActivityBar row that contains the greatest number of cells over the entire bar or on a particular side. AB_Mode refers to the number of cells in the Mode row and the price value of the row in which the Mode occurred. The Side Input determines if the calculation will take place over the whole bar or just on a specific side.

Examples

Assigns to Value2 the number of cells in the largest modal row and to Value3 the cell price on both sides of the current bar:

vars: oModeCount(0), oModePrice(0);

Value1 = AB_Mode(2, 1, oModeCount, oModePrice);

Value2 = oModeCount;

Value3 = oModePrice;

See Also

AB_Median, AB_StdDev