[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] AmiBroker 2.9 Analysis Language Reference (Part 1)


  • To: "AmiBroker Mailing List" <amibroker@xxxx>
  • Subject: [amibroker] AmiBroker 2.9 Analysis Language Reference (Part 1)
  • From: "Tomasz Janeczko" <tjaneczk@xxxx>
  • Date: 16 Jan 1999 19:35:48 -0000

PureBytes Links

Trading Reference Links

Hello Everyone!

To give you an idea how the new analysis language will look like I
decided to give you the preliminary description
of this language. First part contains function list which will be supported.
In addition to those functions normal
mathematical notation will be supported so you can write expression like
this: 5 * (7 + close ) * macd()

Remember that attached list (in HTML format) is preliminary and chances are
that more functions will be added
(however already listed function will not disapear !)

Best regards,
Tomasz Janeczko

PS. Short "AmiBroker and ARexx for beginners" course will begin in next
week.



------------------------------------------------------------------------ZZZXXXZZZ
eGroup home: http://www.eGroups.com/list/amibroker
Free Web-based e-mail groups by eGroups.com


------=_NextPart_001_00DA_01BE418F.A355F1C0
Content-Type: text/html;
charset="iso-8859-1"
content-transfer-encoding: quoted-printable
content-type: text/html;
charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY bgColor=#e8e8e8>Hello Everyone!<BR><BR>&nbsp;&nbsp;&nbsp; To give you an 
idea how the new analysis language will look like I<BR>decided to give you the 
preliminary description<BR>of this language. First part contains function list 
which will be supported.<BR>In addition to those functions 
normal<BR>mathematical notation will be supported so you can write expression 
like<BR>this: 5 * (7 + close ) * macd()<BR><BR>Remember that attached list (in 
HTML format) is preliminary and chances are<BR>that more functions will be 
added<BR>(however already listed function will not disapear !)<BR><BR>Best 
regards,<BR>Tomasz Janeczko<BR><BR>PS. Short &quot;AmiBroker and ARexx for 
beginners&quot; course will begin in next<BR>week.<BR>


<hr><center></center>

eGroup home: <a href="http://www.eGroups.com/list/amibroker";>http://www.eGroups.com/list/amibroker</a><br>
Free Web-based e-mail groups by <a href="http://www.eGroups.com";>www.eGroups.com</a><br>
</body></html>

------=_NextPart_001_00DA_01BE418F.A355F1C0--

Title: AmiBroker 2.9 Analysis Language Reference




AmiBroker 2.9 Analysis Language Reference.
Function List
 


ABS
SYNTAX	abs( DATA ARRAY )
FUNCTION	Calculates the absolute value of the DATA ARRAY.
EXAMPLE	The formula "abs( -10 )" will return +10; the formula "abs( 10 )" also returns +10.
ACCDIST
SYNTAX	accdist()
FUNCTION	Calculates the predefined Accumulation/ Distribution indicator.
HOLD
SYNTAX	hold( EXPRESSION, PERIODS )
FUNCTION	Extends a "true" result of EXPRESSION for the specified number of periods. This true result is held true over the number of periods specified even if a "false" result is generated.
EXAMPLE	hold( cross(rsi(14),70),5 )
ATAN
SYNTAX	atan( DATA ARRAY )
FUNCTION	Returns the arc tangent of DATA ARRAY. The value is returned inradians
EXAMPLE	The formula "atan( 10 0 )" returns PI/2.
SEE ALSO	The cos() function (see Cosine) ; the sin() function (see Sine).
BARSSINCE
SYNTAX	barssince( DATA ARRAY )
FUNCTION	Calculates the number of bars (time periods) that have passed since DATA ARRAY was true.
EXAMPLE	barssince( macd() < 0 )
BBANDBOT
SYNTAX	bbandbot( DATA ARRAY, PERIODS, DEVIATIONS )
FUNCTION	Calculates the bottom Bollinger Band of DATA ARRAY shifted downward DEVIATION standard deviations.
EXAMPLE	bbandbot( close, 10, 2 )
BBANDTOP
SYNTAX	bbandtop( DATA ARRAY, PERIODS, DEVIATIONS )
FUNCTION	Calculates the bottom Bollinger Band of DATA ARRAY shifted upward DEVIATION standard deviations.
EXAMPLE	bbandtop( close, 10, 2 )
CEIL
SYNTAX	ceil( DATA ARRAY )
FUNCTION	Calculates the lowest integer that is greater than DATA ARRAY.
EXAMPLE	The formula "ceiling( 7.2 )" returns 8; the formula "ceiling(-7.2)" returns -7.
SEE ALSO	The floor() function (see Floor); the int() function (see Integer).
CHAIKIN
SYNTAX	chaikin( PERIODS )
FUNCTION	Calculates the predefined Chaikin Oscillator.
CCI
SYNTAX	cci( PERIODS )
FUNCTION	Calculates the predefined Commodity Channel Index (Standard).
EXAMPLE	cci( 14 )
COS
SYNTAX	cos( DATA ARRAY )
FUNCTION	Returns the cosine of DATA ARRAY. Assumes that the DATA ARRAY values are in degrees.
EXAMPLE	cos( C )
SEE ALSO	The atan() function (see Arc Tangent); the sin() function (see Sine).
CROSS
SYNTAX	cross( DATA ARRAY 1, DATA ARRAY 2 )
FUNCTION	Plots a "+1" on the day that DATA ARRAY 1 crosses above DATA ARRAY 2. Otherwise, "0" is plotted.
If you want to know when DATA ARRAY 1 crosses below DATA ARRAY 2, use the formula "cross( DATA ARRAY 2, DATA ARRAY 1)"
EXAMPLE	cross( close, mov(close,9,e) )
CUM
SYNTAX	cum( DATA ARRAY )
FUNCTION	Calculates a cumulative sum of the DATA ARRAY from the first period in the chart.
EXAMPLE	The formula "cum( 1 )" calculates an indicator that rises one point for each day since the beginning of the chart; the formula "cum( C )" calculates the cumulative total of all closing prices from the beginning of the chart.
SEE ALSO	The sum() function (see Summation).
EXP
SYNTAX	exp( DATA ARRAY )
FUNCTION	Calculates e raised to the DATA ARRAY power.
SEE ALSO	The log() function (see Logarithm (natural)).
FLOOR
SYNTAX	floor( DATA ARRAY )
FUNCTION	Calculates the highest integer that is less than DATA ARRAY.
EXAMPLE	The function "floor( 13.9 )" returns 13. The formula "floor( -13.9 )" returns -14.
SEE ALSO	The ceiling() function (see Ceiling); the int() function (see Integer).
FRAC
SYNTAX	frac( DATA ARRAY )
FUNCTION	Eliminates the integer portion of DATA ARRAY and returns the fractional part.
EXAMPLE	The formula "frac( 10.7 )" returns 0.7; the formula "frac(-19.8 )" returns -0.8.
SEE ALSO	The int() function (see Integer).
GAPDOWN
SYNTAX	gapdown()
FUNCTION	Plots a "+1" on the day a security's prices gap down. Otherwisea "0" is plotted. A gap down occurs if yesterday's low is greater than today's high.

GAPUP
SYNTAX	gapup()
FUNCTION	Plots a "+1" on the day a security's prices gap up. Otherwise a"0" is plotted. A gap up occurs if yesterday's high is less than today's low.
HIGHEST
SYNTAX	highest( DATA ARRAY )
FUNCTION	Calculates the highest value in the DATA ARRAY since the first day loaded in the chart (PERIODS includes the current day).
EXAMPLE	The formula "highest( rsi(14) )" returns the highest Relative Strength Index value since the first day loaded in the chart ; "highest ( close )" returns the highest closing price since the first day loaded in the chart.
SEE ALSO	The hhv() functiHighest High Value ; the llv() function (see Lowest Low Value); the lowest() function (see Lowest).
HIGHESTBARS
SYNTAX	highestbars( DATA ARRAY )
FUNCTION	Calculates the number of periods that have passed since the DATA ARRAY’s highest value. This includes all data loaded in the chart.
EXAMPLE	The formula "highestbars( close )" returns the number of periodsthat have passed since the closing price reached its highest peak.
HHV
SYNTAX	hhv( DATA ARRAY, PERIODS )
FUNCTION	Calculates the highest value in the DATA ARRAY over the preceding PERIODS (PERIODS includes the current day).
EXAMPLE	The formula "hhv( CLOSE, 5 )" returns the highest closing price over the preceding five periods; "hhv(H,7)" returns the highest high price over the preceding seven periods.
SEE ALSO	The Stochastic Oscillator example (see Stochastic Oscillator); the llv() function (see Lowest Low Value).
HHVBARS
SYNTAX	hhvbars( DATA ARRAY, PERIODS )
FUNCTION	Calculates the number of periods that have passed since the DATA ARRAY reached its PERIODS period peak.
EXAMPLE	The formula "hhvbars( close,50 )" returns the number of periods that have passed since the closing price reached its 50-period peak.
IIF
SYNTAX	iif( CONDITION DATA ARRAY, THEN DATA ARRAY, ELSE DATA ARRAY )
FUNCTION	A conditional function that returns the second parameter (THEN)if the conditional expression defined by the first parameter is true; otherwise, the third parameter is returned (ELSE).
EXAMPLE	The formula "if(1<2,3,4)" will always return the value three.
SEE ALSO	The On Balance Volume example (see On Balance Volume); The Indicator Builder Tutorial (see Indicator Builder Tutorial). For more details on using the iif() function, see The iif() function.
INSIDE
SYNTAX	inside()
FUNCTION	Plots a "+1" when an inside day occurs. An inside day occurs when today's high is less than yesterday's high and today's low is greater than yesterday's low. A range is determined by the first Inside Day and is only broken by a Rally, Reaction, or Outside day.
INT
SYNTAX	int( DATA ARRAY )
FUNCTION	Removes the fractional portion of DATA ARRAY and returns the integer part.
EXAMPLE	The formula "int( 10.7 )" returns 10; the formula "int(-19.8 )" returns -19.
SEE ALSO	The ceiling() function (see Ceiling); the floor() function (seeFloor); the frac() function (see Fraction).
LASTVALUE
SYNTAX	lastvalue(DATA ARRAY)
FUNCTION	This function loads an entire data array with the last calculated value of the specified DATA ARRAY. The result of this function can be used in place of a constant in any function argument.
If DATA ARRAY is undefined (e.g., only 100-days loaded and you request the last value of a 200-day moving average) then the lastvalue function returnszero.
Since this function loads an entire data array with the last value of another array, it allows a formula to look into the future. This is unacceptablefor most indicators, but is very beneficial for things like pattern recognition.
EXAMPLE 	The formula mov(close,lastvalue(fml("Determine Periods")),s) calculates a moving average using the number of periods returned by the indicator named "Determine Periods".
LOG
SYNTAX	log( DATA ARRAY )
FUNCTION	Calculates the natural logarithm of DATA ARRAY.
SEE ALSO	The exp() function (see Exponent).
LOWEST
SYNTAX	lowest( DATA ARRAY )
FUNCTION	Calculates the lowest value in the DATA ARRAY since the first day loaded in the chart (PERIODS includes the current day).
EXAMPLE	The formula "lowest( rsi(14) )" returns the lowest Relative Strength Index value since the first day loaded in the chart; "lowest ( close )" returns the lowest closing price since the first day loaded in the chart.
SEE ALSO	The hhv() function (see Highest High Value ); the llv() function (see Lowest Low Value); the highest() function (see Highest).
LOWESTBARS
SYNTAX	lowestbars( DATA ARRAY )
FUNCTION	Calculates the number of periods that have passed since the DATA ARRAY’s lowest value. This includes all data loaded in the chart.
EXAMPLE	The formula "lowestbars( close )" returns the number of periods that have passed since the closing price reached its lowest point.
LLV
SYNTAX	llv( DATA ARRAY, PERIODS )
FUNCTION	Calculates the lowest value in the DATA ARRAY over the preceding PERIODS (PERIODS includes the current day).
EXAMPLE	The formula "llv( CLOSE, 14 )" returns the lowest closing price over the preceding 14 periods.
SEE ALSO	The Stochastic Oscillator example (see Stochastic Oscillator); the hhv() function (see Highest High Value ).

LLVBARS
SYNTAX	llvbars( DATA ARRAY, PERIODS )
FUNCTION	Calculates the number of periods that have passed since the DATA ARRAY reached its PERIODS period trough.
EXAMPLE	The formula "llvbars( close,50 )" returns the number of periods that have passed since the closing price reached its 50 period trough.
MACD
SYNTAX	macd(PERIOD1,PERIOD2)
FUNCTION	Calculates the predefined MACD indicator.
EXAMPLE	The formula "macd()" returns the value of the MACD indicator (i.e., the solid line). The formula "ema(macd(),9)" returns the value of the MACD's signal line (i.e., the dotted line).
SIGNAL
SYNTAX	signal(PERIOD1,PERIOD2,SIGNAL PERIOD)
FUNCTION	Calculates the predefined Signal line of MACD indicator.
EXAMPLE
MAX
SYNTAX	max( DATA ARRAY, DATA ARRAY )
FUNCTION	Returns the largest of the two parameters.
EXAMPLE	The formula "max( CLOSE, 10 )" returns either the closing price or 10, whichever is greater. The formula "max(-14, 13)" always returns 13.
MIN
SYNTAX	min( DATA ARRAY, DATA ARRAY )
FUNCTION	Returns the smallest of the two parameters.
EXAMPLE	The formula "min( CLOSE, 10 )" returns the closing price or 10, whichever is less. The formula "min(-14, 13)" always returns -14.
SEE ALSO	The max() function (see Maximum).
MFI
SYNTAX	mfi( PERIODS )
FUNCTION	Calculates the predefined Money Flow Index.
EXAMPLE	mfi( 14 )
SEE ALSO	The rsi() function (see Relative Strength Index (RSI)).
MA
SYNTAX	ma( DATA ARRAY, PERIODS)
FUNCTION	Calculates a PERIODS moving average of DATA ARRAY
EMA
SYNTAX	ema( DATA ARRAY, PERIODS)
FUNCTION	Calculates a PERIODS exponential moving average of DATA ARRAY
NVI
SYNTAX	nvi()
FUNCTION	Calculates the predefined Negative Volume Index.
SEE ALSO	The pvi() function (see Positive Volume Index).
OBV
SYNTAX	obv()
FUNCTION	Calculates the predefined On Balance Volume indicator.
SEE ALSO	The example formula (see On Balance Volume).
PVI
SYNTAX	pvi()
FUNCTION	Calculates the predefined Positive Volume Index.
SEE ALSO	The nvi() function (see Negative Volume Index).
PREC
SYNTAX	prec( DATA ARRAY, PRECISION )
FUNCTION	Truncates DATA ARRAY to PRECISION decimal places.
EXAMPLE	The formula "prec( 10.12981, 2 )" returns 10.120. The formula "prec( 10.12981, 4 )" returns 10.12980. Small binary rounding errors may cause some minor distortion in the decimal portion of any number stored in a computer.
ROC
SYNTAX	roc( DATA ARRAY, PERIODS)
FUNCTION	Calculates the PERIODS rate-of-change of DATA ARRAY expressed as percentage.
EXAMPLE	The formula "roc( CLOSE, 12, PERCENT )" returns the 12-period percent rate-of-change of the closing prices.
REF
SYNTAX	ref( DATA ARRAY, PERIODS )
FUNCTION	References a previous or subsequent element in a DATA ARRAY. A positive PERIOD references "n" periods in the future; a negative PERIOD references "n" periods ago.
EXAMPLE	The formula "ref( CLOSE, -12 )" returns the closing price 12 periods ago. Thus, you could write the 12-day price rate-of-change (expressed in points) as "C - ref( C, -12 )." The formula "ref( C, +12 )" returns the closing price 12 periods ahead.
RSI
SYNTAX	rsi( PERIODS )
FUNCTION	Calculates the predefined RSI indicator.
EXAMPLE	rsi( 14 )
ROUND
SYNTAX	round( DATA ARRAY )
FUNCTION	Rounds DATA ARRAY to the nearest integer.
EXAMPLE	The formula "round( +10.5 )" returns +11. The formula "round( -10.4 )" returns -10.
SEE ALSO	The ceiling() function Ceiling; the floor() function Floor; theint() function Integer.
SIN
SYNTAX	sin( DATA ARRAY )
FUNCTION	Returns the sine of DATA ARRAY. This function assumes that the DATA ARRAY values are in degrees.
EXAMPLE	You can plot a sine wave using the formula "sin(cum(5))." Increasing the value in this formula (i.e., "5") will increase the frequency of the sine wave.
SEE ALSO	The atan() function (see Arc Tangent); the cos() function (see Cosine).
SQRT
SYNTAX	sqrt( DATA ARRAY )
FUNCTION	Calculates the square root of DATA ARRAY. The square root of a negative number always returns a zero result.
EXAMPLE	The formula "sqrt( 16 )" returns 4.
SEE ALSO	The Standard Deviation example formula (see Standard Deviation).
STOCH
SYNTAX	stoch( %K PERIODS, %K SLOWING )
FUNCTION	Calculates the predefined Stochastic Oscillator.
EXAMPLE	The formula "stoch( 5, 3 )" returns the value of a 5-period %K slowed 3-periods.
SEE ALSO	The Stochastic example formula (see Stochastic Oscillator).
SUM
SYNTAX	sum( DATA ARRAY, PERIODS )
FUNCTION	Calculates a cumulative sum of the DATA ARRAY for the specifiednumber of lookback PERIODs (including today).
EXAMPLE	The formula "sum( CLOSE, 12 )" returns the sum of the preceding 12 closing prices. A 12-period simple moving average could be written "sum(C,12) / 12."
SEE ALSO	The cum() function (see Cumulate).
TRIX
SYNTAX	trix( PERIODS )
FUNCTION	Calculates the predefined TRIX indicator.
EXAMPLE	trix( 12 )
ULTIMATE
SYNTAX	ultimate( CYCLE1, CYCLE2, CYCLE3 )
FUNCTION	Calculates the predefined Ultimate Oscillator indicator using the three cycle lengths supplied as parameters. Note that each of the three parameters must be greater than the preceding parameter or an error messagewill be displayed (e.g., "ult( 5, 5, 5)" is not valid).
EXAMPLE	The formula "ult( 7, 14, 21 )" returns the default Ultimate Oscillator.






eGroup home: http://www.eGroups.com/list/amibroker
Free Web-based e-mail groups by www.eGroups.com