Академический Документы
Профессиональный Документы
Культура Документы
Table Of Contents
Welcome to BullScript......................................................................................................... 1
Using This Manual.......................................................................................................... 1
Printing This Manual ...................................................................................................... 1
Learning BullScript ............................................................................................................. 3
Learning BullScript......................................................................................................... 3
Language Overview........................................................................................................ 3
Operators......................................................................................................................... 3
Price Variables ................................................................................................................ 4
Security Variables ........................................................................................................... 5
Using 'If'.......................................................................................................................... 8
Hist, Future and Previous Functions ............................................................................... 9
Variables ......................................................................................................................... 9
Defining Formulae with Parameters ............................................................................. 10
Referencing Other Formulae......................................................................................... 11
Multiple Plots................................................................................................................ 11
Comments ..................................................................................................................... 11
Attributes ...................................................................................................................... 12
Functions....................................................................................................................... 16
Candle Patterns ............................................................................................................. 17
Displaying Text............................................................................................................. 20
Function Reference............................................................................................................ 23
Function Reference ....................................................................................................... 23
General.......................................................................................................................... 23
Mathematical ................................................................................................................ 34
Candle Pattern............................................................................................................... 49
Pattern Recognition....................................................................................................... 64
Date and Time............................................................................................................... 66
Highest/Lowest ............................................................................................................. 70
Indicator Functions ....................................................................................................... 74
Attribute reference........................................................................................................... 111
Attribute Reference..................................................................................................... 111
Attributes .................................................................................................................... 111
Color Attribute ............................................................................................................ 116
FillStyle Attribute ....................................................................................................... 119
LineStyle Attribute...................................................................................................... 120
Target Attribute ........................................................................................................... 127
Best Practices................................................................................................................... 129
Sample Scripts ................................................................................................................. 131
Exponential Moving Average...................................................................................... 131
Gap Up........................................................................................................................ 131
Simple Moving Average ............................................................................................. 131
iii
Getting Started with BullScript
iv
Welcome to BullScript
Manual updated: 26th May 2005
BullScript is a powerful, yet easy to use, scripting language that you can use to create your
own tools in BullCharts.
You can use BullScript in the following scenarios:
1. Use the Contents tab to read through the help in a structured order, or to find
articles grouped by topic.
2. Use the Index tab to find a specific article by keyword. For example, to find
details on a specific function.
3. Use the Search tab to perform a full-text search on all articles in this help file.
Use the Learning BullScript help topics to learn about how BullScript works, and use the
function reference and attribute reference help topics to learn about the different tools
available to you in BullScript.
1
Learning BullScript
Learning BullScript
The following pages will teach you about the main language features of BullScript such as
how to use functions, and attributes.
For details on specific functions, please refer to the Function Reference, or to the index.
Language Overview
BullScript is a functional programming language that is used to define indicators and
alerts. It is similar to some spreadsheet languages. The language is made up of functions,
such as ma() and atr(), and mathematical operations like +, -, *.
BullScript is not case sensitive, meaning that it doesn’t matter if words are typed in upper
case or lower case.
Operators
BullScript provides fourteen basic operators for doing mathematical calculations. These
are divided into five arithmetic operators: +, -, *, /, and ^, the six relational operators: <, >,
<=, >=, <>, =, and two logical operators: 'and', and 'or'. There is also an operator called the
assignment operator, :=, which is used to store a value in a variable.
The operators, in order of precedence, are:
^ Exponentiation 3^4 ? 81
* Multiplication 4*5 ? 20
/ Division 20/5 ? 4
+ Addition 4 + 5?9
- Subtraction 4 - 5 ? -1
3
Getting Started with BullScript
Logical Operators
The AND and OR operators are called logical operators. They are uesd to combine
true/false calculations together.
The expression H>hist(H,1) AND L>hist(L,1) will return true if both the high
and the low have increased over the last day.
The OR operator is an inclusive or, which means it returns true if either, or both, of the
expressions on each side are true. For example, H>hist(H,1) OR L>hist(L,1)
will return true if the high has increased, or the low has increased, or both have increased.
Price Variables
BullScript allows use of special variables to access the open, high, low, and close prices,
and the volume of the current bar the formula is being run on. The valid BullScript price
variables, and possible abbreviations are shown in the table below.
For example, the formula (H+L)/2 will plot the average of the high and low prices. The
formula H+1 will plot a line $1.00 above the high price.
Price
Abbreviation Description
Variable
4
Learning BullScript
Close C The closing price, or last price traded for the interval.
See Also
Security Variables
Security Variables
If you have subscribed to receive data from BullSystems, a number of security details, or
fundamentals, are also available such as PE ratio, earnings per share, and industry
information.
To reference a security variable, enter the word code Security. followed by the
variable to be included. For example Security.PERatio. See below for a table of all
security variables.
5
Getting Started with BullScript
Rolling 12 months
DividendPerShare
dividend rate per $/share Non-calculated
DPS
share.
Gross dividend
GrossDividendAmount $/share Non-calculated
amount.
6
Learning BullScript
capitalisation of this
security.
PERatio
Price Earnings Ratio Close/EPS
PE
Ratio between
DividendCover earnings and times EPS/DPS
dividends.
Dividend payments
DividendPayableDate Date Non-calculated
are made on this date.
Name of GICS
industry group.
IndustryGroup Text Non-calculated
Second of four levels
of classification.
Name of GICS
industry. Third of four
Industry levels of classification. Text Non-calculated
Not available for
many securities.
7
Getting Started with BullScript
The S&P/ASX200
index symbol for the
sector that the security
SectorIndex belongs to. Useful Text Lookup
when used in
conjunction with
LoadSymbol.
Example
if( Security.MarketCap > 100000000 and Security.Franked =
100, 1, 0);
See Also
Price Variables | LoadSymbol
Using 'If'
An important function in BullScript is the If function. If accepts three parameters. If the
first parameter is not zero, then it will evaluate to the second parameter, otherwise it will
evaluate to the third parameter.
For example, if you wanted to plot an indicator that is equal to the volume for the bar on
all bars where the closing price is greater than the opening price, and is equal to the
negative of the volume otherwise, you could use the formula If(close > open,
volume, -volume). If is very important, because it allows completely different
calculations to take place depending on whether a condition is true or not.
See Also
If function
8
Learning BullScript
See Also
Future | Hist | Previous
Variables
Some indicators require long and complex formulae. To make long BullScript formulae
simpler and easier to understand, partial results of a formula can be placed in a variable,
and that variable accessed later.
For instance, if one wanted to find the 14-day simple moving average of the typical price
(the typical price is the average of the high, low, and close prices), the formula,
MA((high + low + close)/3,14,SIMPLE) could be used.
This could be simplified by putting the typical price in a variable:
9
Getting Started with BullScript
See Also
Expression | Input | Param
10
Learning BullScript
See Also
Formula function
Multiple Plots
A single BullScript formula can plot multiple lines in an indicator. This is done by
seperating the calculations for each plot by a semi-colon (;). If for instance, you wanted to
plot a line $1 above the high price, and another line $1 below the low price, you could use
the formula:
High + 1;
Low - 1
A single formula can have an unlimited number of plots.
Comments
BullScript allows you to write comments, or notes, to yourself within a formula by placing
the comments in braces: { and }. Comments can be used to make the formula easier to
understand when it is read later.
The following example shows how a comment may be used to more clearly indicate what
a formula is doing. The syntax highligher will show comments in green:
ma(C,20) {a 20 day moving average}
BullCharts will completely ignore all comments. Therefore comments can also be a
convenient way to temporarialy remove some code while testing your scripts.
11
Getting Started with BullScript
Attributes
Using Attributes
BullScript allow you to specify the way you want the results of a script to be displayed
within the script itself, using its attributes system.
Attributes are defined within square brackets, ‘[‘ and ‘]’, and appear before the plots that
they relate to. They consist of the name of the attribute being used, followed by an ‘=’,
followed by the value of the attribute.
For instance, if you wanted to plot a 28-day simple moving average and a 14- day simple
moving average, but you wanted the 28-day moving average to be displayed in green, and
the 14-day moving average to be displayed in red, you could use the following code:
[color=green]
ma(C,28,SIMPLE);
[color=red]
ma(C,14,SIMPLE);
If a plot has more than one attribute, the attributes may be seperated by semicolons, or
placed in separate sets of square brackets. For example, if you wanted to plot a 14-day
moving average in red, on a new pane, you could use,
[color=red; target=price]
ma(C,14,SIMPLE);
or
[color=red]
[target=price]
ma(C,14,SIMPLE);
Some attributes, such as author and category may take multiple values. All values must be
given in the same attribute, and must be separated by pipes. See the table below for
details.
[category=Moving Average|Verticality]
ma(C,14,SIMPLE);
Available Attributes
Possible
Attribute Description Examples
Values
An alternative
Alias Any text name by [alias=MyRSI]
which the
12
Learning BullScript
formula may
be called
within
BullScript.
This will often
be an
abbreviation.
The author of
the indicator.
By
convention,
use the last
Any text (for [category=Hull, Alan]
name then the
Author example Hull, [category=Guppy,
first name.
Alan) Daryl|Wilson, Leon]
Multiple
authors may
be listed,
separated by
pipes.
The category
that the
formula is in.
Any text (for Multiple [category=Moving Average]
Category
example Volume) categories may [category=Volume|My Own]
be listed,
separated by
pipes.
A reference to
documentation
[citation="Trading Systems,
Citation Any text on which the
Wilder"]
formula is
based.
Colour names or
The default
RGB values given [color=red]
Color colour of the
as [color=rgb(0,255,128)]
plot.
rgb(red,green,blue)
13
Getting Started with BullScript
Background
Name of pattern to
FillStyle pattern for [fillstyle=Weave]
use. See list.
ribbons.
Default, or any of
The style of
Bold, Underline,
the font for [fontstyle=Bold,Underline]
FontStyle Italic or Strikeout
markers and [fontstyle=Default]
separated by
text plots.
commas.
Levels at
List of numbers which
HorzLine separated by horizontal [horzline=20,80]
commas. lines should be
displayed.
Solid, Dotted,
Dash, Long Dash,
Step, Dotted Step, The style with
LineStyle Horz Step, Bar, which the plot [linestyle=step]
Grounded Bar, will be drawn.
Points, Marker,
Fill, NoPlot, Text.
If an indicator
LinkedChart SelectionOnly has this [linkedchart=selectiononly]
attribute and it
is included in a
14
Learning BullScript
scan, then
when a linked
chart is
created, only
selected plots
are shown on
the chart.
The password
must be
entered to
view or edit
Password Text [password=12345]
the indicator
script again -
but not to use
the indicator.
The timeframe
that this
indicator
Daily, Weekly, intended for
Period Monthly, use on. Do not [period=Weekly]
Quarterly, Yearly specify if the
indicator can
be used on any
timeframe.
Normally an
indicators
plots are
shown in the
properties
window in the
SortPlots ByName [sortplots=byname]
order they are
scripted. This
attribute
causes them to
be sorted by
name.
15
Getting Started with BullScript
Specifies
[TextAlign=Above, Left]
Center, Above, where text is
TextAlign [TextAlign=Right, Center]
Below, Left, Right placed relative [TextAlign=Below]
to a data point.
Allows
advanced
formatting
[TextFormat=00 00 00 00]
Default, other options for
TextFormat [TextFormat=E]
format string displaying [TextFormat=default]
dates and
numbers as
text.
Specifies the
transparency
for a filled
linestyle. 0 for
Number between 0
Transparency completely [transparency=95]
and 100
opaque and
100 for
completely
transparent.
Whether or not
the plot is
Visible Yes, No [visible=no]
visible by
default.
The width of
Width Positive number [width=2]
the plot line.
Functions
BullScript contains many functions that perform more complex operations. An example of
such a function is the max function, which gives the maximum of two numbers. Functions
are run by placing their name followed by parenthesis that contain the parameters being
16
Learning BullScript
given to the function to operate on. So to find the maximum of two numbers, one could
write the formula max(4,C). This would evaluate to 4 if the close price is less than 4,
and to the close price otherwise.
Functions accept a certain number of parameters. It’s not possible to write max(5) for
instance, since finding the maximum of one number doesn’t make sense. The square root
function, sqrt, must have only one parameter though, since finding a square root is
performed on one number. Some functions, such as the max function, can take a varying
number of parameters. Max must be given at least two parameters, but it could be given
three or four parameters, in which case it will calculate the maximum of all the numbers it
is given.
There are also function equivalents to the mathematical operators, for example add does
the same thing as the + operator. The formula add(C,5) is equivalent to C+5.
The result of one formula may be used as a parameter for another formula. For example,
it’s possible to write max(add(C,5),8) to find the maximum of C+5 and 8.
If a formula does not require any parameters at all, such as the atr function, then it may
be written with an empty parenthesis after it, like atr(), or the parenthesis may simply
be omitted.
Certain functions take special parameters that are not numbers. An example of such a
function is the ma function, which calculates moving averages. Its third paramter specifies
the type of moving average being calculated, and may have parameters such as simple,
exponential, or variable, to indicate the type of moving average calculated. For
instance, ma(C,14,exponential) calculates a 14-day moving average of the close
price.
Candle Patterns
BullScript contains a number of functions designed to autmatically detect candlestick
patterns. These functions can typically be called without any parameters, and will return 1
(true) when the candle patterns is present, and 0 (false) at all other times.
Specifically, the patterns will return true when the pattern is present and the last bar of the
pattern is the bar being processed.
A list of candle pattern functions is as follows:
Name
17
Getting Started with BullScript
Bear Harami
Big Black
Big White
Black
Bull Harami
Doji
Doji Star
Dragonfly Doji
Engulfing Bear
Engulfing Bull
Falling Three
Falling Window
Gravestone Doji
18
Learning BullScript
Hammer
Hanging Man
Inverted Hammer
Morning Star
Rising Window
Rising three
Shaven Bottom
Shaven Head
Shooting Star
Tri-Star Top
Tri-Star Bottom
Tweezer Bottoms
Tweezer Tops
19
Getting Started with BullScript
White
Displaying Text
BullCharts normally draws formulas as a chart line. However, it is possible to create
formulas that show text on a chart.
The key components to drawing text are:
To draw text, set the LineStyle attribute to Text. Then two calculations need to be
provided. The first determines the text (if any) to be drawn for that bar, and the second
determines the y-position of the text (in dollars, or what ever unit the y-axis is using). If
either of these calculations returns undefined then no text is drawn.
Calculations must appear in pairs until the linestyle is changed to something else, or the
end of the script is reached.
Other aspects of text can also be controlled using the Font, Colour, FontStyle, FontSize
and TextAlign attributes. Refer to the help pages on these attributes to learn more.
When creating text (often called strings) you specify some text directly by enclosing it in
quote marks "such as this". The BullScript editor will colour these Aqua. Strings
can joined together by using the + operator. Remember to include spaces when joining
strings. So "This" + " and that" will give "This and that". Numeric values can
also be joined to strings. For example "The price is "+Close might show "The
price is 3.75".
Strings can be used in conjunction with some other BullScripts such as the if statement.
The code if(C>O,"Close","Open")+" is bigger" will either say "Close is
bigger" or "Open is bigger" depending on their values.
Example 1
The following BullScript will write the word 'Hello' above the high price of the 20th bar
on the chart.
[target=Price]
[linestyle=Text; textalign=Above,Center]
[font="Times New Roman"; fontsize=30; fontstyle=Bold]
20
Learning BullScript
if(barnumber=20,"Hello",undefined);
High;
Example 2
This chart can be created with the script shown below.
[target=Price]
size := input("Zig zag size",4,0);
z := zigzag(Close,size,%);
ispeak := z>hist(z,1) and z>future(z,1);
istrough := z<hist(z,1) and z<future(z,1);
[linestyle=Solid; color=Red]
z;
[color=Blue]
[linestyle=Text; textalign=Above,Center]
if(isPeak, "Peak at " + z, undefined);
High;
[linestyle=Text; textalign=Below,Center]
if(isTrough, "Trough at " + z, undefined);
21
Getting Started with BullScript
Low;
See Also
Attributes | Colour | Font | FontStyle | FontSize | LineStyle | TextAlign
22
Function Reference
Function Reference
The following pages list the functions that are built into BullScript. Each function
describes any arguments, gives a description of what the function itself does, and provides
an example of how to use the function.
Functions are grouped into categories, then listed alphabetically within each category.
General
General Functions
This section describes basic BullScript functions used to make decisions, refer to other
data bars, call other scripts and input data.
AllFalse
Usage
ALLFALSE(EXPR, N)
expr
23
Getting Started with BullScript
AllTrue
Usage
ALLTRUE(EXPR, N)
expr
AnyFalse
Usage
ANYFALSE(EXPR, N)
expr
24
Function Reference
See Also
AllFalse | AllTrue | AnyTrue
AnyTrue
Usage
ANYTRUE(EXPR, N)
ALERT(EXPR, N)
expr
BarsSince
Usage
BARSSINCE(EXPR)
25
Getting Started with BullScript
Expression
Usage
EXPRESSION([MESSAGE[,DEFAULT]])
message
default
FirstValue
Usage
FIRSTVALUE(EXPR)
expr
26
Function Reference
Formula
Usage
FORMULA(NAME[,ARG1,ARGn])
name
args
Future
Usage
FUTURE(EXPR,N)
expr
27
Getting Started with BullScript
See Also
Hist, Future and Previous | Hist
Hist
Usage
HIST(EXPR,N)
expr
If
Usage
IF(TEST,EXPR1,EXPR2)
TEST
expr1
expr2
28
Function Reference
Description
Returns expr1 if test is true, otherwise returns expr2. The if function can also be used test
for multiple cases by embedding consecutive ifs. Refer to the examples.
Example
if(OPEN > CLOSE, OPEN, CLOSE) returns the greater of open and close. Note: In
practice the max function would be used for this calculation.
if(CLOSE => 5 AND CLOSE <= 10, 500, 0) returns 500 if the closing price is
between 5 and 10 inclusive, otherwise it returns 0.
if(Volume >= 1000000 OR Trades >= 5000, 1, 0) returns 1 if either
Volume is at least one million, or trades if greater than 5000, otherwise 0 is returned. Note
that if both volume and trades are greater than their respective levels then 1 is still
returned. This is called an inclusive OR.
if(C > hist(H,1), "Above", if(C < hist(L,1), "Below",
"Within"))
This example returns the text Above, Below or Within to indicate how todays close relates
to yesterdays range. Note that a second if function has been put inside the first one. It is
said to be nested. If the close is not above, then it moves on to test for below and within.
if(condition1, result1,
if(condition2, result2,
if(condition3, result3,
if(condition4, result4,
result5))))
This example shows an convenient way to lay out nested if functions (remember that
BullScript ignores line-ends). condition1 is checked first. It could be Close>Open, for
example, or anything else that returns true/false. If condition1 returns true, then result1 is
immediately returned. Otherwise, it moves on to condition2. If that is true, then result2 is
returned, and so on. If none of the conditions are met then the value result5 is returned.
Note that the number of brackets on the last line matches the number of if statements.
In the above two examples, if has always been nested in the third parameter. It it also
possible to nest it in the second or first, but these are generally not recommended as it will
make the script more confusing to understand.
Input
Usage
INPUT(MESSAGE[,DEFAULT,MINIMUM,MAXIMUM])
message
29
Getting Started with BullScript
default
minimum
maximum
InputMA
Usage
INPUTMA(MESSAGE[,DEFAULT])
message
default
30
Function Reference
Example
n := input("Enter the moving average length",14,7,52);
method := inputma("Enter the moving average method",SIMPLE);
ma(C,n,method);
See Also
Input | Ma function
InputROC
Usage
INPUTROC(MESSAGE[,DEFAULT])
message
default
Param
Usage
PARAM([MESSAGE,DEFAULT,MINIMUM,MAXIMUM])
message
default
31
Getting Started with BullScript
minimum
maximum
Previous
Usage
PREVIOUS([SEED[,N]])
PREV([SEED[,N]])
seed
32
Function Reference
Description
Calculates the value of the current formula as it was n bars ago, or returns seed if there are
less than n bars available. If n is not given, 1 is used. If seed is not given, 0 is used. An
expression (eg Close) may be used for seed.
Example
0.20*close + 0.80*previous(close) calculates an exponential moving
average.
See Also
Hist, Future and Previous | Hist
ValueWhen
Usage
VALUEWHEN(N,EXPR1,EXPR2)
expr1
expr2
Wait
Usage
WAIT(EXPR,N)
33
Getting Started with BullScript
expr
Mathematical
Mathematical Functions
This section lists a variety of mathematical functions including statistical functions,
trigonometry, and rounding.
Absolute Value
Usage
ABS(A)
A number.
Description
Finds the absolute value of a. That is, the value of a without regard to sign.
34
Function Reference
Example
abs(4) is 4, and abs(-4) is 4.
Add
Usage
ADD(n1,n2...)
n1, n2...
Arc Tangent
Usage
ATAN(ANGLE)
angle
35
Getting Started with BullScript
Ceiling
Usage
CEILING(N)
A number.
Description
Calculates the smallest integer which is greater than or equal to n.
Example
ceiling(4.2) returns 5.
ceiling(-3.6) returns -3.
See Also
Floor | Frac | Int | Round
Correlation
Usage
CORREL(EXPR1,EXPR2,N)
expr1
expr2
36
Function Reference
Cosine
Usage
COS(ANGLE)
angle
Divide
Usage
DIV(A,B)
The numerator.
The denominator.
Description
Calculates a divided by b.
Example
div(8,2) returns 4.
See Also
Mod | Operators
Exponent
Usage
EXP(POWER)
37
Getting Started with BullScript
power
Fibonacci
Usage
FIB(N)
Floor
Usage
FLOOR(N)
A number.
Description
Calculates the greatest integer which is smaller than or equal n.
38
Function Reference
Example
floor(4.2) returns 4.
floor(-3.6) returns -4.
See Also
Ceiling | Frac | Int | Round
Fractional Part
Usage
FRAC(N)
A number.
Description
Returns the fractional portion of n.
Example
frac(4.87) returns 0.87
See Also
Ceiling | Floor | Int | Round
Int
Usage
INT(N)
A number.
Description
Returns the integer portion of n.
Example
int(7.8) returns 7
int(-7.8) returns -7
See Also
Ceiling | Floor | Frac | Round
39
Getting Started with BullScript
Linear Regression
Usage
LINEARREG(EXPR,N)
expr
Data to be processed.
Logarithm
Usage
LOG(N[,BASE])
40
Function Reference
A number.
base
Max
Usage
MAX(N1,N2...)
n1, n2
A list of numbers.
Description
Returns the largest value currently assumed by any of its parameters.
Max should not be confused with the Highest function, which returns the largest value a
single parameter has assumed over a number of bars.
Example
max(2,5,4) is 5.
max(open,close) is the greater of the open and close price for the current bar.
highest(close,5) is the largest value of close over the last 5 days.
max(expr1, 5) This example uses the min function to put an lower limit on the value
returned by expr1. If expr1 is greater than 5, then expr1 will be returned unchanged. But if
it's less 5, then 5 is returned.
min(max(expr1,0),100) The above technique can be used in this way to restrict a
result to a range. In this example, expr1 is cropped to return a result between 0 and 100.
41
Getting Started with BullScript
See Also
Highest | Lowest | Min
Min
Usage
MIN(N1,N2...)
n1, n2
A list of numbers.
Description
Selects the smallest value currently assumed by any of its parameters.
Min should not be confused with the Lowest function, which returns the smallest value a
single parameter has assumed over a number of bars.
Example
min(2,5,4) is 2.
min(open,close) is the smaller of the open and close price for the current bar.
lowest(close,5) is the smaller value of close over the last 5 days.
min(expr1, 10) This example uses the min function to put an upper limit on the
value returned by expr1. If expr1 is less than 10, then expr1 will be returned unchanged.
But if it's greater than 10, then 10 is returned.
min(max(expr1,0),100) The above technique can be used in this way to restrict a
result to a range. In this example, expr1 is cropped to return a result between 0 and 100.
See Also
Highest | Lowest | Max
Modulus
Usage
MOD(A,B)
42
Function Reference
Description
Calculates a modulo b. That is, the remainder of a divided by b.
Example
mod(21,8) returns 5.
See Also
Divide
Multiply
Usage
MUL(N1,N2...)
n1,n2..
Negate
Usage
NEG(N)
43
Getting Started with BullScript
See Also
Operators
Pi
Usage
PI
Description
Returns 3.14159265358979, the mathematical constant π. π is the ratio of a circle's
circumference to its diameter.
Power
Usage
POWER(A,B)
The base.
The exponent.
Description
Raises a to the power of b. Equivalent to a^b.
Example
power(5,2) returns 25.
See Also
Operators
Round
Usage
ROUND(A[,N])
A number.
44
Function Reference
See Also
Ceiling | Floor | Frac | Int
Sine
Usage
SIN(ANGLE)
angle
Square Root
Usage
SQRT(N)
45
Getting Started with BullScript
A number.
Description
Finds the square root of n. That is, it find a number that gives n when it is squared.
Example
sqrt(16) returns 4.
Standard Deviation
Usage
STDEV(EXPR,N)
expr
Number of periods.
Description
Finds the standard deviation of expr over the last n periods.
Example
stdev(C,14)
See Also
Standard Error
Standard Error
Usage
STEYX(EXPR,N)
expr
Number of periods.
46
Function Reference
Description
Finds the standard error of expr over the last n periods.
Example
steyx(C,14)
See Also
Standard Deviation
Subtract
Usage
SUB(A,B)
n1, n2...
Sum
Usage
SUM(EXPR[,N])
expr
Data to be summed.
47
Getting Started with BullScript
Trendline
Usage
TRENDLINE(EXPRY, EXPRX, EXTR, EXTL, DIR)
exprY
exprX
extR
extL
dir
48
Function Reference
The dir parameter allows constraints to be placed on the line such as "only draw if the
trend is sloping up (positive gradient) or down (negative gradient).
Example
z := zigzag(C,8,%);
tro := z<future(z,1) and z<hist(z,1);
trendline(L, tro, 1, 0, 1);
This example calculates a zigzag line with an 8% reversal requirement. The variable tro
evaluates to true whenever the zigzag has reached a trough. The trendline function as used
here will draw a trendline through the last two troughs of the zig zag. It will contine to the
right only, and it will only appear if the trendline is upward sloping.
Candle Pattern
Candle Pattern Functions
This section describes a number of functions built into BullScript designed to identify
candle patterns. Unless otherwise stated, each function returns true if the pattern is
completed on the current bar.
It is important to realise that all of our reversal candle patterns must be preceeded by an
up or down trend. The WebLink definition of a trend follows that given in the Securities
Institute Technical Analysis course notes section 3, page 9.
This states briefly that:
Bearish Harami
Usage
BEARHARAMI
Description
A small real body of either colour which is contained within the prior large white body.
This is a top reversal pattern and as such should be preceded by an uptrend.
49
Getting Started with BullScript
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p82.
Example
See Also
Bear Harami Cross | Bull Harami | Bull Harami Cross | Candle Patterns
Description
A Doji which is contained within the prior large white body.
This is a top reversal pattern and as such should be preceded by an uptrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p83.
Example
See Also
Bear Harami | Bull Harami | Bull Harami Cross | Candle Patterns | Doji
Big Black
Usage
BIGBLACK
Description
A large black body, where the open is near the high, and the close is near the low.
50
Function Reference
Example
See Also
Big White | Candle Patterns
Big White
Usage
BIGWHITE
Description
A large white body, where the open is near the low, and the close is near the high.
Example
See Also
Big Black | Candle Patterns
Black Body
Usage
BLACK
Description
A candlestick which has a black body.
Example
See Also
White Body | Candle Patterns
51
Getting Started with BullScript
Bull Harami
Usage
BULLHARAMI
Description
A small real body of either colour which is contained within the prior large black body.
This is a bottom reversal pattern and as such should be preceded by an downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p82.
Example
See Also
Bear Harami | Bear Harami Cross | Bull Harami Cross | Candle Patterns
Description
A Doji which is contained within the prior large black body.
This is a bottom reversal pattern and as such should be preceded by a downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p83.
Example
See Also
Bear Harami | Bear Harami Cross | Bull Harami | Candle Patterns | Doji
52
Function Reference
Doji
Usage
DOJI
Description
A candlestick where the open and close are the same. Doji can be powerful reversal lines
when preceded by a trend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p155.
Example
See Also
Candle Patterns | Doji Star
Doji Star
Usage
DOJISTAR
Description
A Doji which gaps above a white candlestick, or below a black candlestick.
Example
See Also
Candle Patterns | Doji | Evening Doji Star | Morning Doji Star | Shooting Star
Engulfing Bear
Usage
ENGULFINGBEAR
Description
A large black real body that contains a small real white body that precedes it. Also known
as the Bearish Engulfing Pattern.
53
Getting Started with BullScript
Example
See Also
Candle Patterns | Engulfing Bull
Engulfing Bull
Usage
ENGULFINGBULL
Description
A large white real body that contains a small real black body that precedes it. Also known
as the Bullish Engulfing Pattern.
This is a bottom reversal pattern and as such should be preceded by an downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p42.
Example
See Also
Candle Patterns | Engulfing Bear
Falling Window
Usage
FALLINGWINDOW
Description
A gap between the low of the first candlestick and the high of the second candlestick.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p126.
54
Function Reference
Example
See Also
Candle Patterns | Rising Window
Gravestone Doji
Usage
GRAVESTONEDOJI
Description
A Doji where there is no lower shadow and an extremely long upper shadow.
Gravestone doji are used as a top reversal line and as such should be preceded by an
uptrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p162.
Example
See Also
Candle Patterns | Doji
Hammer
Usage
HAMMER
Description
A small real body of either colour with a lower shadow at least twice the real body size,
which closes nears the high.
In practice there is some latitude for what constitutes 'a small real body'. The most
important aspect of this pattern is the long lower shadow with a minimal upper shadow.
The Hammer is a bottom reversal pattern and as such should be preceded by a downtrend.
55
Getting Started with BullScript
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p34.
Example
See Also
Candle Patterns | Hanging Man | Inverted Hammer
Hanging Man
Usage
HANGINGMAN
Description
A small real body of either colour with a lower shadow at least twice the real body size,
which closes nears the high. The main difference between this pattern and the Hammer is
the prior trend direction. The Hammer requires a prior uptrend but the Hanging man
requres a prior downtrend.
Note that because of the bullish nature of the long lower shadow additional confirmation
may be required before this pattern is considered bearish.
The Hanging Man is a top reversal pattern and as such should be preceded by an uptrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p39.
Example
See Also
Candle Patterns | Hammer
Inverted Hammer
Usage
INVHAMMER
Description
An upside-down Hammer that is either white or black.
56
Function Reference
See Also
Candle Patterns | Hammer
Description
A Doji that has particularly long upper and lower shadows.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p161.
Example
See Also
Candle Patterns | Doji
Description
A candlestick, either black or white, that has a lower shadow that is more than twice as
long as the upper shadow and body.
57
Getting Started with BullScript
Example
See Also
Candle Patterns | Long Upper Shadow
Description
A candlestick, either black or white, that has an upper shadow that is more than twice as
long as the lower shadow and body.
Example
See Also
Candle Patterns | Long Lower Shadow
Description
A Morning Star where the second candlestick is a Doji.
This is a bottom reversal pattern and as such should be preceded by an downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p70.
58
Function Reference
Example
See Also
Candle Patterns | Doji | Doji Star | Evening Doji Star | Morning Star
Morning Star
Usage
MORNINGSTAR
Description
A large black candlestick followed by a small real body of either colour that gaps down
from the previous candles real body. This is followed by a third candlestick that is white
and has a close higher than the half way point of the first candlestick's real body.
The ideal morning star pattern's third candle will gap above the preceeding candle's small
real body but in practice (as described by Nison) this is somewhat rare. We specifically
allow the case of the third candle engulfing the second to also satisfy the morning star
pattern.
This is a bottom reversal pattern and as such should be preceded by an downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p62.
Example
See Also
Candle Patterns | Evening Star | Morning Doji Star
Rising Window
Usage
RISINGWINDOW
59
Getting Started with BullScript
Description
A gap between the high of the first candlestick and the low of the second candlestick.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p126.
Example
See Also
Candle Patterns | Falling Window
Shaven Bottom
Usage
SHAVENBOTTOM
Description
A candlestick, either white or black, which has no lower shadow.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p25.
Example
See Also
Candle Patterns | Shaven Head
Shaven Head
Usage
SHAVENHEAD
Description
A candlestick, either white or black, which has no upper shadow.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p85.
60
Function Reference
Example
See Also
Candle Patterns | Shaven Bottom
Shooting Star
Usage
SHOOTINGSTAR
Description
A small real body that closes near the bottom of its range and has a long upper shadow.
There must be a real body gap up from the previous sessions candle.
This is a top reversal line and as such should be preceded by a rally.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p74.
Example
See Also
Candle Patterns | Doji Star
Description
Three long black candlesticks that each have lower close prices than the last. They
generally close at or near their low prices.
This is a top reversal pattern and as such should be preceded by an uptrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p97.
61
Getting Started with BullScript
Example
See Also
Candle Patterns | Three White Soldiers
Description
Three long white candlesticks that each have higher close prices than the last. They
generally close at or near their high prices.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p99.
Example
See Also
Candle Patterns | Three Black Crows
Tweezer Bottoms
Usage
TWEEZERBOTTOMS
Description
A large black candle followed by a candle with the same low.
Tweezer Bottoms are a bottom reversal pattern and as such should be preceded by a
downtrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p87.
62
Function Reference
Example
See Also
Candle Patterns | Tweezer Tops
Tweezer Tops
Usage
TWEEZERTOPS
Description
A large white candle followed by a candle with the same high.
Tweezer Tops are a top reversal pattern and as such should be preceded by an uptrend.
Reference
Japanese Candlestick Charting Techniques Second Edition - Steve Nison, p87.
Example
See Also
Candle Patterns | Tweezer Bottoms
White Body
Usage
WHITE
Description
A white candlestick. That is, where the close was higher than the open.
Example
63
Getting Started with BullScript
See Also
Black Body | Candle Patterns
Pattern Recognition
Pattern Recognition Functions
This section lists functions used to identify simple patterns such as gaps and crossovers.
Also refer to the candle patterns section for candle specific fuctions.
Cross
Usage
CROSS(EXPR1,EXPR2)
expr1
expr1
GapDown
Usage
GAPDOWN()
Description
Returns 1 for any bar where a gap down occurs, and 0 otherwise. A gap down occurs if the
previous bar’s low is greater than this bar’s high.
64
Function Reference
See Also
GapUp
GapUp
Usage
GAPUP()
Description
Returns 1 for any bar where a gap up occurs, and 0 otherwise. A gap up occurs if the
previous bar’s high is less than this bar’s low.
See Also
GapDown
Inside
Usage
INSIDE()
Description
Returns 1 if the current bar is ‘inside’ the previous one, and 0 otherwise. A bar is inside if
its high is less than the previous bar's high, and its low is greater than the previous bar's
low.
See Also
Outside
Outside
Usage
OUTSIDE()
Description
Returns 1 if the current bar is ‘outside’ the previous one, and 0 otherwise. A bar is outside
if its high is greater than the previous bar’s high, and its low is less than the previous bar’s
low.
See Also
Inside
65
Getting Started with BullScript
Date
Usage
DATE(YEAR,[MONTH,[DAY,[HOUR,[MINUTE,[SECOND]]]]])
year
month
day
hour
minute
second
66
Function Reference
DayOfMonth
Usage
DAYOFMONTH([DATEVALUE])
datevalue
Hour
Usage
HOUR([DATEVALUE])
datevalue
InputDate
Usage
INPUTDATE([MESSAGE,[DEFAULT]])
message
default
67
Getting Started with BullScript
Description
Allows input of a date from the user or another formula using this formula. Will display
message as a prompt to the user. Default will be used by default, or if default is not
specified then todays date will be used by default.
Example
{without a default}
d1 := inputdate("Trade Date");
{with a default}
d2 := inputdate("Trade Date", Date(2004,11,30));
See Also
Date | OnOrSkipped
Minute
Usage
MINUTE([DATEVALUE])
datevalue
Month
Usage
MONTH([DATEVALUE])
datevalue
68
Function Reference
See Also
Date | Year | DayOfMonth | Hour | Minute | Second
Now
Usage
NOW()
Description
Returns the date value of the current bar.
Second
Usage
SECOND([DATEVALUE])
datevalue
Year
Usage
YEAR([DATEVALUE])
datevalue
69
Getting Started with BullScript
Highest/Lowest
Highest/Lowest Functions
This section lists functions specifically designed to identify the highest and lowest bar in a
range.
Highest
Usage
HIGHEST(EXPR[,N])
HHV(EXPR[,N])
expr
HighestBars
Usage
HIGHESTBARS(EXPR[,N])
HHVBARS(EXPR[,N])
expr
70
Function Reference
HighestSince
Usage
HIGHESTSINCE(N,EXPR1,EXPR2)
expr1
expr2
HighestSinceBars
Usage
HIGHESTSINCEBARS(N,EXPR1,EXPR2)
71
Getting Started with BullScript
expr1
expr2
Lowest
Usage
LOWEST(EXPR[,N])
LLV(EXPR[,N])
expr
72
Function Reference
LowestBars
Usage
LOWESTBARS(EXPR[,N])
LLVBARS(EXPR[,N])
expr
LowestSince
Usage
LOWESTSINCE(N,EXPR1,EXPR2)
expr1
expr2
73
Getting Started with BullScript
Example
lowestsince(4,cross(mov(C,7),mov(C,21)),C)
returns the lowest close price that has occurred since the fourth time ago that the 7-day
simple moving average crossed the 21-day simple moving average.
LowestSinceBars
Usage
LOWESTSINCEBARS(N,EXPR1,EXPR2)
expr1
expr2
Indicator Functions
Indicator Functions
This section describes many of the indicator functions that can be used in BullScript.
Many of these indicators are written in BullScript themselves, and use the alias attribute to
make themselves available to other scripts.
limitmove
Limit on movement.
74
Function Reference
Description
Calculates the accumulation swing index, with the given limit on movement.
Developed by Welles Wilder, the Accumulation Swing Index compares current prices and
previous prices to illustrate the 'real' price of a security. It is the cumulative total of
another indicator also developed by Wilder, known as the Swing Index
Example
aswing(2.0)
See Also
Swing Index
Accumulation/Distribution
Usage
AD()
Description
Calculates the accumulation/distribution indicator according to this formula: sum((((C
- L) - (H - C))/(H - L))*V)
The accumulation distribution formula is an improved On Balance Volume indicator. This
indicator uses a relationship between volume and prices to estimate the strength of price
movements. If the volume is increased, there is a high probability that prices will move
up.
See Also
On Balance Volume | Chaikin Accumulation/Distribution Oscillator
Aroon Down
Usage
AROONUP(N)
AROONDOWN(N)
75
Getting Started with BullScript
Example
aroonup(24)
aroondown(24)
76
Function Reference
Bollinger Bands
Usage
BBANDTOP(EXPR,N,METHOD,DEVIATIONS)
BBANDBOT(EXPR,N,METHOD,DEVIATIONS)
expr
method
deviations
Description
Calculates the Chaiking Accumulation/Distribution Oscillator.
The Chaikin Oscillator indicator is the difference between a 3-day exponential moving
average and a 10-day exponential moving average applied to Accumulation Distribution.
See Also
Accumulation Distribution
77
Getting Started with BullScript
expr
78
Function Reference
value
margin
commission
79
Getting Started with BullScript
Number of periods.
expr
Number of periods.
Description
Calculates Wilder's Directional Movement Index.
Example
dx(21)
See Also
+DI | -DI | ADX | ADXR | CSI
Ease Of Movement
Usage
EMV(N,METHOD)
Number of periods.
80
Function Reference
method
Forecast
Usage
FORECAST(EXPR,N,AHEAD)
expr
Data to evaluate.
ahead
Forecast Oscillator
Usage
FORECASTOSC(EXPR,N)
expr
Data to evaluate.
Number of bars.
81
Getting Started with BullScript
Description
Calculates the Forecast Oscillator for expr, over n periods.
Example
forecastosc(CLOSE,21)
Fractal Dimension
Usage
FRACTALDIM(EXPR,N)
expr
cutoff
If the ROAR falls below this level, it will drop back to zero.
Typically 80.
sLiq
82
Function Reference
oLiq
entry
The ROAD must fall below this level to start. Typically -30.
cutoff
If the ROAD rises above below this level, it will drop back
to zero. Typically -20.
sLiq
oLiq
83
Getting Started with BullScript
Description
HullROAD calculate Alan Hulls Active Investing Rate of Annual Decline indicator. Refer
to Alan Hull's Active Investing course notes for more information.
Example
hullroad(-30,-20,12000000,10000000)
See Also
HullAtROAR | HullROAR
entry
cutoff
If the ROAR falls below this level, it will drop back to zero.
Typically 20.
sLiq
oLiq
84
Function Reference
Inertia
Usage
INERTIA(N,SMOOTHING)
Number of periods.
smoothing
RVI periods.
Description
Calculates Donald Dorsey's Inertia indicator over n periods, using the given smoothing.
number of periods.
Description
Calculates the Intraday Momentum Index over n periods.
The Intraday Momentum Index (IMI) was developed by Tushar Chande. The calculation
of the IMI is very similar to the RSI (Relative Strength Index), except it uses the
relationship between the intraday opening and closing prices to determine whether the day
is 'up' or 'down.' If the close is above the open, it is an up day. If the close is below the
open it is a down day. Therein lies its tie to candlestick charting. For those familiar with
candlestick charting, the IMI separates the black and white candlesticks and performs a
RSI calculation on the candlestick bodies.
Example
imi(21)
See Also
Relative Strength Index
85
Getting Started with BullScript
Keltner
Usage
KELTNERTOP(N)
KELTNERBOT(N)
Klinger Oscillator
Usage
KVO(N)
MACD
Usage
MACD()
86
Function Reference
Description
Calculates the MACD indicator. The MACD is approximately the difference between the
12 and 26 bar exponential moving averages. (The calculation of the moving averages is
slightly non-standard).
See Also
Price Oscillator
Description
Calculates the Market Facilitation Index according to the formula: (high -
low)/volume
Mass Index
Usage
MASS(N)
Number of periods.
Description
Calculates the Mass indicator over n periods.
The Mass index, described by Donald Dorsey, is developed to predict trend reversal by
comparing difference and range between high and low prices. If the Mass index is going
up, the range between high and low is bigger. If the Mass index is going down, the range
between high and low is smaller.
Example
mass(21)
Median Price
Usage
MP(N)
Description
Calculates the median price according to the formula: (high+low)/2. Importantly, this
is not the same as the Statistical Median.
87
Getting Started with BullScript
See Also
Midpoint | Statistical Median
Description
Calculates the MESA Adaptive Moving Average.
Midpoint
Usage
MID(EXPR[,N])
Description
Calculates the midpoint of the range of expr over the last n bars, or over the entire dataset
if n is not given.
Example
mid(CLOSE,21) will return the midpoint between the highest close and lowest close
over the last 21 periods.
mid(CLOSE) will return the midpoint of the close price over the entire dataset.
See Also
Median Price | Statistical Median
Number of periods.
Description
Calculates the Minus Directional Movement indicator over n periods.
Example
mdi(14)
88
Function Reference
See Also
+DI | DX | ADX | ADXR | CSI
Momentum
Usage
MO(EXPR[,N])
expr
Number of periods.
Description
Calculates the Momentum indicator over n periods according to the formula:
(expr/hist(expr,n))*100
Example
mo(14)
Number of periods.
Description
Calculates the Money Flow Index over n periods.
The money flow indicator compares upward changes and downward changes of the
volume weighted typical prices. This indicator is similar to the relative strength index,
with the difference being the volume weighted prices.
Example
mfi(14)
See Also
Relative Strength Index | Relative Volatility Index | Typical price
89
Getting Started with BullScript
Moving Average
Usage
MA(EXPR,N[,METHOD])
expr
method
90
Function Reference
See Also
InputMA | DEMA | TEMA
Description
Calculates the Negative Volume Index.
See Also
Positive Volume Index
On Balance Volume
Usage
OBV(EXPR)
91
Getting Started with BullScript
expr
Parabolic SAR
Usage
SAR(STEP,MAXIMUM)
step
Rate of acceleration.
maximum
Peak
Usage
PEAK(N,EXPR,CH)
expr
92
Function Reference
ch
PeakBars
Usage
PEAKBARS(N,EXPR,CH)
expr
ch
93
Getting Started with BullScript
Performance
Usage
PER(EXPR)
expr
Number of periods.
Description
Calculates the Plus Directional Movement indicator over n periods.
Example
pdi(14)
See Also
-DI | DX | ADX | ADXR | CSI
Description
Calculates the Positive Volume Indicator.
See Also
Negative Volume Index
94
Function Reference
Price Channel
Usage
PRICECHANNELHIGH(N)
PRICECHANNELLOW(N)
Price Oscillator
Usage
OSCP(N1,N2,METHOD,DIFFTYPE)
n1
n2
method
difftype
Points or percent.
Description
The Price Oscillator calculates difference between two moving averages of length n1 and
n2, calculated using the method moving average method. The result is either given as a
percent or as a value, depending on the value of difftype used.
95
Getting Started with BullScript
Example
oscp(14,21,SIMPLE,POINTS)
See Also
InputROC | MACD | Volume Oscillator
Description
Calculates the Price & Volume Trend indicator, which is the cumulative volume total,
calculated using relative changes of the close price.
Projection Band
Usage
PROJBANDTOP(N)
PROJBANDBOT(N)
Projection Oscillator
Usage
PROJOSC(N,SMOOTHING)
96
Function Reference
smoothing
Qstick
Usage
QSTICK(N,METHOD)
method
Rally
Usage
RALLY()
97
Getting Started with BullScript
Description
Returns 1 when the current bar rallies from the previous one, and a 0 otherwise. A bar
rallies when its high price is greater than the previous bar's high price, and its low price is
greater than or equal to the previous bar's low price.
Description
Returns 1 when the current bar rallies with volume from the previous one, and a 0
otherwise. A bar rallies with volume if it rallies, and its volume is higher than for the
previous bar.
Description
Michael Poulos developed the Random Walk Index in an effort to find an indicator that
overcomes the effects of a fixed look-back period and the drawbacks of traditional
smoothing methods.
The Random Walk Index is based on the basic geometric concept that the shortest distance
between two points is a straight line. The further prices stray from a straight line during a
move between two points in time, the less efficient the movement.
Range Indicator
Usage
RANGEINDICATOR(N,SMOOTHING)
Description
Calculates the Range Indicator, developed by Jack Weinberg, over n periods, with the
specified smoothing.
Example
rangeindicator(21,4)
Rate of Change
Usage
ROC(EXPR,N,DIFFMETHOD)
98
Function Reference
expr
diffmethod
Reaction
Usage
REACTION()
Description
Returns 1 when the current bar is in reaction from the previous one, and a 0 otherwise. A
bar is in reaction when its high price is less than or equal to the previous bar’s high price,
and its low price is less than the previous bar’s low price.
Description
Returns 1 when the current bar is in reaction with volume from the previous one, and a 0
otherwise. A bar is in reaction with volume when it is in reaction, and the current bar’s
volume is greater than the previous bar’s volume.
99
Getting Started with BullScript
100
Function Reference
R-Squared Indicator
Usage
RSQUARED(EXPR,N)
expr
Stochastic Momentum
Usage
STOCHMOMENTUM(KPERIODS,SMOOTHING,DOUBLESMOOTHING,DPERIODS,METHOD)
kperiods
%K Time periods
smoothing
%K Smoothing period
doublesmoothing
%K Double smoothing
dperiods
%D Time periods
method
101
Getting Started with BullScript
Description
Calculates the Stochastic Momentum for expr using the given settings.
The Stochastic Oscillator provides you with a value showing the distance the current close
is relative to the recent n-period high/low range, the SMI shows you where the C is
relative to the midpoint of the recent n-period high/low range. The result is an oscillator
that ranges between +/- 100 and is a bit less erratic than an equal period Stochastic
Oscillator.
Example
stochmomentum(5,3,3,3,SIMPLE)
See Also
Stochastic Oscillator
Stochastic Oscillator
Usage
STOCH(N,SLOWING)
slowing
Swing Index
Usage
SWING(LIMIT)
limit
102
Function Reference
Limit of movement.
Description
Calculates the Swing Index indicator with the given limit of movement.
This indicator assigns a Swing Index value from 0 to 100 for an up bar and 0 to -100 for a
down bar. This indicator uses the current bar's open, high,low and close as well as the
previous bar's open and close to calculate the Swing Index values.
Example
swing(7.5)
See Also
Accumulated Swing Index
TEMA
Usage
TEMA(EXPR,N)
expr
expr
103
Getting Started with BullScript
TRIX
Usage
TRIX(N)
Trough
Usage
TROUGH(N,EXPR,CH)
expr
ch
104
Function Reference
Description
Returns the value of expr at n troughs ago, as determined by the Zig Zag function.
Example
trough(1,L,8) returns the value of Low at the last trough on a 8% ZigZag on Low.
See Also
Peak | PeakBars | TroughBars | ZigZag
TroughBars
Usage
TROUGHBARS(N,EXPR,CH)
expr
ch
Typical Price
Usage
TYPICAL()
105
Getting Started with BullScript
Ultimate Oscillator
Usage
ULTIMATE(N1,N2,N3)
n1
n2
n3
Variance
Usage
VAR(EXPR,N)
expr
Data to evaluate.
Number of bars.
106
Function Reference
Description
Calculates the statistical variance of expr over the last n bars.
Example
var(CLOSE,14)
Description
Calculates the Vertical Horizontal Filter indicator.
Volatility
Usage
VOL([MAPERIODS,ROCPERIODS])
maperiods
rocperiods
Volume Oscillator
Usage
OSCV(N1,N2,METHOD,DIFFTYPE)
n1
107
Getting Started with BullScript
n2
method
difftype
Points or percent.
Description
Calculates the volume oscillator, using n1 and n2 length moving averages, calculated
using the method moving average method, with the given difference calculation type used.
Example
oscv(14,21,SIMPLE,POINTS)
See Also
InputROC | Price Oscillator
Weighted Close
Usage
WC()
Description
Calculated the Weighted Close indicator according to the formula: (close*2 + high
+ low)/4
Wilder's Smoothing
Usage
WILDERS(EXPR,N)
expr
Data to be smoothed.
108
Function Reference
Smoothing periods.
Description
Smooths expr using Wilder's Smoothing indicator over n periods.
Example
wilders(CLOSE,14)
Williams' %R
Usage
WILLR(N)
Number of periods.
Description
Calculates Williams’ %R indicator over n periods.
Example
willr(14)
Williams' A/D
Usage
WILLA
Description
Calculates Williams’ A/D indicator.
ZigZag
Usage
ZIGZAG(EXPR,CH,METHOD)
expr
ch
109
Getting Started with BullScript
method
110
Attribute reference
Attribute Reference
The following pages list the attributes that are built into BullScript. Attributes are used to
provide additional information about how your BullScript should be applied.
Attributes
Using Attributes
BullScript allow you to specify the way you want the results of a script to be displayed
within the script itself, using its attributes system.
Attributes are defined within square brackets, ‘[‘ and ‘]’, and appear before the plots that
they relate to. They consist of the name of the attribute being used, followed by an ‘=’,
followed by the value of the attribute.
For instance, if you wanted to plot a 28-day simple moving average and a 14- day simple
moving average, but you wanted the 28-day moving average to be displayed in green, and
the 14-day moving average to be displayed in red, you could use the following code:
[color=green]
ma(C,28,SIMPLE);
[color=red]
ma(C,14,SIMPLE);
If a plot has more than one attribute, the attributes may be seperated by semicolons, or
placed in separate sets of square brackets. For example, if you wanted to plot a 14-day
moving average in red, on a new pane, you could use,
[color=red; target=price]
ma(C,14,SIMPLE);
or
[color=red]
[target=price]
ma(C,14,SIMPLE);
Some attributes, such as author and category may take multiple values. All values must be
given in the same attribute, and must be separated by pipes. See the table below for
details.
[category=Moving Average|Verticality]
ma(C,14,SIMPLE);
111
Getting Started with BullScript
Available Attributes
Possible
Attribute Description Examples
Values
An alternative
name by
which the
formula may
be called
Alias Any text [alias=MyRSI]
within
BullScript.
This will often
be an
abbreviation.
The author of
the indicator.
By
convention,
use the last
Any text (for [category=Hull, Alan]
name then the
Author example Hull, [category=Guppy,
first name. Daryl|Wilson, Leon]
Alan)
Multiple
authors may
be listed,
separated by
pipes.
The category
that the
formula is in.
Any text (for Multiple [category=Moving Average]
Category
example Volume) categories may [category=Volume|My Own]
be listed,
separated by
pipes.
A reference to
Citation Any text documentation [citation="Trading Systems,
on which the Wilder"]
formula is
112
Attribute reference
based.
Colour names or
The default
RGB values given [color=red]
Color colour of the
as [color=rgb(0,255,128)]
plot.
rgb(red,green,blue)
A description
of the formula.
[description="The moving
This will
Description Any text average can be used to
appear on the
smooth noisy data"]
Insert
Indicator page.
Background
Name of pattern to
FillStyle pattern for [fillstyle=Weave]
use. See list.
ribbons.
Default, or any of
The style of
Bold, Underline,
the font for [fontstyle=Bold,Underline]
FontStyle Italic or Strikeout
markers and [fontstyle=Default]
separated by
text plots.
commas.
Levels at
List of numbers which
HorzLine separated by horizontal [horzline=20,80]
commas. lines should be
displayed.
Solid, Dotted,
LineStyle The style with [linestyle=step]
Dash, Long Dash,
which the plot
Step, Dotted Step,
113
Getting Started with BullScript
If an indicator
has this
attribute and it
is included in a
scan, then
LinkedChart SelectionOnly when a linked [linkedchart=selectiononly]
chart is
created, only
selected plots
are shown on
the chart.
The password
must be
entered to
view or edit
Password Text [password=12345]
the indicator
script again -
but not to use
the indicator.
The timeframe
that this
indicator
Daily, Weekly, intended for
Period Monthly, use on. Do not [period=Weekly]
Quarterly, Yearly specify if the
indicator can
be used on any
timeframe.
Normally an
SortPlots ByName indicators [sortplots=byname]
plots are
114
Attribute reference
shown in the
properties
window in the
order they are
scripted. This
attribute
causes them to
be sorted by
name.
Specifies
[TextAlign=Above, Left]
Center, Above, where text is
TextAlign [TextAlign=Right, Center]
Below, Left, Right placed relative [TextAlign=Below]
to a data point.
Allows
advanced
formatting
[TextFormat=00 00 00 00]
Default, other options for
TextFormat [TextFormat=E]
format string displaying [TextFormat=default]
dates and
numbers as
text.
Specifies the
transparency
for a filled
linestyle. 0 for
Number between 0
Transparency completely [transparency=95]
and 100
opaque and
100 for
completely
transparent.
Whether or not
the plot is
Visible Yes, No [visible=no]
visible by
default.
115
Getting Started with BullScript
The width of
Width Positive number [width=2]
the plot line.
Color Attribute
Usage
[color=named-color]
[color=rgb(red,green,blue)]
named-color
red
green
blue
Description
Specifies the color for the following plot or ribbon component. You can either specify one
of the named-colors listed below, or you can specify a colour exactly using the RGB
notation.
Colour names are case insensitive and space insensitive. That is, you can remove the
spaces from colour names and they will work as expected.
Example
[color=Red]
[color=AliceBlue]
[color=aliceblue]
116
Attribute reference
[color="Alice Blue"]
[color=rgb(0,128,255)]
Named Colors
• Alice • Dark • Light Sea •
Blue Turquoise Green Papaya
• Antique • Dark Violet • Light Sky Whip
White • Deep Pink Blue •
• Aqua • Deep Sky • Light Peach
• Blue Slate Gray Puff
Aquamarin • Dim Gray • Light • Peru
e • Dodger Blue Steel Blue • Pink
• Azure • Firebrick • Light • Plum
• Beige • Floral White Yellow •
• Bisque • Forest Green • Lime Powder
• Black • Fuchsia • Lime Blue
• • Gainsboro Green •
Blanched • Ghost White • Linen Purple
Almond • Gold • Magenta • Red
• Blue • Goldenrod • Maroon • Rosy
• Blue • Gray • Medium Brown
Violet • Green Aquamarine •
• Brown • Green • Medium Royal
• Burly Yellow Blue Blue
Wood • Honeydew • Medium •
• Cadet • Hot Pink Orchid Saddle
Blue • Indian Red • Medium Brown
• • Indigo Purple •
Chartreuse • Ivory • Medium Salmon
• • Khaki Sea Green •
Chocolate • Lavender • Medium Sandy
• Coral • Slate Blue Brown
• Cornsilk LavenderBlush • Medium • Sea
• Crimson • Lawn Green Spring Green Green
• Cyan • Lemon • Medium • Sea
• Dark Chiffon Turquoise Shell
Blue • Light Blue • Medium •
• Dark • Light Coral Violet Red Sienna
Cyan • Light Cyan • Midnight •
• Dark Blue Silver
• Light
Goldenrod Goldenrod • Mint • Sky
117
Getting Started with BullScript
See Also
Attributes
118
Attribute reference
FillStyle Attribute
Usage
[fillstyle=style-name]
style-name
Description
Specifies the fill style to be used on the ribbon backgound.
Example
[fillstyle=SmallConfetti]
• Divot • Percent 90
119
Getting Started with BullScript
See Also
Attributes
LineStyle Attribute
Usage
[linestyle=style-name]
style-name
120
Attribute reference
Description
The linestyle attribute describes how the following calculations will be display. Most of
the possible line styles change the formatting of a normal plot line.
There are several special formats available, some of which apply to results in pairs. See
below for a detailed example of using various linestyles.
Solid,
Dotted, Draws diagonal lines in the style [linestyle=Solid]
Dash, Long described from points to point. ma(C,10,S);
Dash
[linestyle=Points]
Points Dots are drawn at each value.
sar();
121
Getting Started with BullScript
122
Attribute reference
[linestyle=signal]
Equivalent to
Signal 1 [marker=Long]
[linestyle=marker].
cross(C,ma(C,10));
123
Getting Started with BullScript
Allows an indicator to
dynamically select the
colour for the price plot.
Works in a similar way as
the ribbon. Ie, specify
[linestyle=pricecolor]
several expressions, and
PriceColor many [color=Red] C<hist(C,1);
the colour of the first one
[color=Green] C>hist(C,1);
to evaluate to true gets
used for the current bar.
See the JB Volatility Profit
Taker indicator for an
example of this feature.
[target=Price]
[name=Short MA]
shortMA := ma(Close,5,simple);
shortMA;
[name=Long MA; linestyle=Dash]
longMA := ma(Close,13,simple);
longMA;
124
Attribute reference
{ Fill }
{ Note that fill is green when shortMA is above longMA. }
[linestyle=Fill]
[color=shortMA] res1;
[color=longMA] res2;
{ Markers }
{ The name attribute automatically gets shown as a label. }
{ Use 'tooltip' to display a message when you hover over the
marker. }
[name=Above; linestyle=marker; marker=Long]
[tooltip="Short MA passed above Long MA"]
cross(shortMA,longMA);
125
Getting Started with BullScript
[target=Price]
size := input("Zig zag size",4,0);
z := zigzag(Close,size,%);
ispeak := z>hist(z,1) and z>future(z,1);
istrough := z<hist(z,1) and z<future(z,1);
[linestyle=Solid; color=Red]
z;
[color=Blue]
[linestyle=Text; textalign=Above,Center]
if(isPeak, "Peak at " + z, undefined);
High;
[linestyle=Text; textalign=Below,Center]
if(isTrough, "Trough at " + z, undefined);
Low;
See Also
Attributes
126
Attribute reference
Target Attribute
Usage
[target=target-type]
target-type
Description
Specifies the pane and/or axis that the indicator should appear on by default. Note that this
can be overridden when the indicator is inserted.
BullCharts also has an option in the preferences to control how any indicator marked as
target=default should be treated. It is recommended that newaxis, newpane and overlay
not be used in light of this preference.
Presently only one target can be applied per script, however this may be revised in future
versions of BullCharts.
Example
[target=Price]
ma(C,10,S) * 1.1;
ma(C,10,S) * 0.9;
The indicator is added to the current (last clicked) pane and a new axis is
newaxis
created on the left hand side, replacing any axis that was previously there.
The indicator will be placed in a new pane, regardless of the whether the
newpane application preferences say that indicators should be placed. It is generally
better to use default.
overlay The indicator is added to the current (last clicked) pane. An axis is only
127
Getting Started with BullScript
Indicates that the resuls generated are of a percentage nature. Presently this is
percent
treated the same as default.
Indicator should appear on the same pane and axis as the selected price plot.
This is recommended for indicators that function similar to moving averages.
price
The results should be in roughly the same range as those for the price chart or
scaling problems may result.
Indicator should appear on the same pane and axis as the volume plot. If the
volume volume pane is not currently visible then it will be shown. The indicator
should give results roughly in the same range as the volume data.
See Also
Attributes | LineStyle | Ribbons
128
Best Practices
As with many programming languages, BullScript can be used well or poorly. When
writing your own scripts, we advise that you endeavor to write them in a clean, clear
fashion for several reasons:
Here are several guidelines that we suggest you follow when writing scripts:
• Use descriptive names when naming your scripts and their inputs. For example,
use "Smoothing periods" instead of "smooth" as an input.
• Add inputs to your script, so that results can be easily customized without having
to edit the script. Give a sensible default value for each input.
• Specify maximum and minimum allowed values for inputs as appropriate. For
example, an input that will be used to adjust the length of a moving average
should have a minimum value of at least 1. Don’t specify a maximum value
unnecessarily.
• Use consistent capitalisation when entering function names and variable names.
This will make your script more readable.
• White space (spaces and new lines) can be used to make your program more
readable. Use white space consistently. For example, put a space before and after
operators (+, -, *, /, :=, etc...).
• For complicated scripts, group sections of your script together that logically
belong together. For example, list all of your inputs together at the top. Then do
all of your calculations together. Finally return all of the results together.
• Only assign one variable per line. For example: a:=O+H; b:=a*3;
c:=b+D; should not all be given on a single line.
• Remember to use attributes to add meaning to your script. For example, if an
indicator logically belongs with the price, such as ma(typical(),5), then
use the [target=Price] attribute.
• When multiple results are being returned, use the name attribute to give each
result a meaningful name. For example: "MACD" and "Signal".
• If you publish your script, use the citation attribute so other people will
remember where they found the script. Include a web address if appropriate.
129
Getting Started with BullScript
• Use comments to describe any unusual steps in your script. However, a general
description of your indicator should be put in a description attribute. Use proper
grammar and punctuation for both comments and descriptions.
• Assign intermediate results to variables, rather than including them inline. This is
particularly important for complicated scripts. For example:
tmp := (O+H+L+C)/4;
ma(tmp,5,S) + ma(tmp,7,S);
is better than: ma((O+H+L+C)/4,5,S) + ma((O+H+L+C)/4,7,S);
• Use the BullScript functions to simplify your scripts where ever possible. For
example: use ma(C,n,S) instead of sum(C,n)/n when calculating a moving
average. Or use typical instead of (H+L+C)/3.
• Carefully test your scripts to ensure that they are working as expected. For
example, you may accidentally enter sum(C,m) when you intended
sum(C,n), but the mistake will only be revealed with testing if both m and n
are in use.
• Surround text attributes with quotes. [name="Modified Moving
Average"] rather than [name=Modified Moving Average] to make it
clear when the value begins and ends.
130
Sample Scripts
This section contains a number of popular indicators written in BullScript. All these
indicators are provided by BullScript, but sample formulae are provided here to
demonstrate how BullScript may be used to construct indicators.
The examples below have been coloured in the same way that the BullScript syntax
highlighter would colour them.
Gap Up
A gap up occurs when the low price of the current candlestick is higher than the high price
of the previous candlestick.
low > hist(high,1)
Typical Price
The typical price is the average of the high, low and close.
(H+L+C)/3
Weighted Close
(high+low+close*2)/4
See Also
Sample Indicator
131
Sample Indicator
This topic is designed to help you create advanced indicators by examining one of the
indicators that comes built into BullScript: the Stochastic Oscillator. First a simple
Stochastic formula script is shown, then a more advanced version, as used in BullCharts,
is shown, then a discussion of script follows.
Note: You can access the scripts for all of the indicators in BullCharts
133
Getting Started with BullScript
134
Sample Indicator
BullCharts on the Insert Indicator dialog. Note that the description tag spans multiple
lines. BullCharts will wrap the text of any back into a single line.
If you are not the original designer of an indicator, then a citation will both give credit to
the original author, as well as direct users to further information on the script in question.
Or if you have designed the indicator yourself, it is a good way to link the script back to
your own website or books. The citation will appear in BullCharts below the description.
It is a good practice to enclose description, citation, and any textual attributes in a pair of
quotes.
Target Attribute
Line 8 of the script appears as follows:
[target=Percent; category=Oscillators; alias=stoch]
Any number of attributes can be placed on a single line by separating them with a
semicolon (;). This can keep the script tidy. Note: If you want to use a semicolon in a
description, the text must be enclosed in quote marks.
The target attribute tells BullCharts the type of data that will be generated. This
information allows BullCharts to make intelligent choices about scaling, etc. For example,
an indicator with [target=price] will automatically appear on the same scale as the
price. See attributes for more details.
Category Attribute
By specifying a category, this indicator can be more easily found in the Insert Indicator
dialog by using the drop down category list. It is recommended that you use the existing
categories if applicable - but you may also create a new category simply by picking a
unique name. For example, if you have designed and published several indicators you
may want to use your name as a category - so users of your indicators can group them
easily.
An indicator can be listed under multiple categories by separating them with a comma.
Alias Attribute
You may want to refer to this indicator from another indicator. If the indicator name
contains spaces (such as "Stochastic Oscillator") then normally you can't directly refer to
the indicator in code - the formula function would be required instead.
The alias attribute allows you to specify a short name to be used in other scripts,
without sacrificing having a descriptive name for your indicator. In this case,
alias=stoch means that these two lines are equivalent in another script:
135
Getting Started with BullScript
formula("Stochastic Oscillator")
stoch()
Horzlines
The horzlines attribute, on line 10, allows any number of horizontal lines to be added
to the indicator. In BullCharts these can be subsequently modified or hidden by using the
indicator properties dialog. Here 80% and 20% are set as critical levels.
Inputs
Lines 12-17 allow the indicator to be easily configured by accepting several inputs, as
shown:
kperiods := input("%K Time periods",5,1); kslowing :=
input("%K Slowing periods",3,1); dperiods := input("%D Time
periods",3,1); method := inputma("%D Method",S); expr :=
expression("Expression"); signalperiods := input("Buy/Sell
signal periods",200,1);
Three types of input are used here: input, inputma, and expression, which allow
the input of a number, a moving average type, and a data column respectively.
Note that each input is assigned to a variable. It is possible to use an input directly in a
formula, but it is recommended that the input is assigned to a variable. This makes the
script more readable, and also means that the result of the input can be used in several
places if necessary.
Each input includes a short but informative description. This text will be shown on the
Insert Indicator dialog. Lines 12-15 and 17 include a default value for the input. That is,
the number following the description. It's a good idea to supply a default value for every
possible input. Following the default is a minimum value for that input. By providing this
information, BullCharts can ensure that only sensible number are passed into the script.
The %K Line
Lines 20-21 show the actual calculation of the Stochastic Oscillator as we saw in the
simple example, except fixed numbers have been replaced with our input variables. The
result is assigned to the variable kay. Line 21 simply has the work kay. This has the effect
of returning the previous calculation as a plot - but it was first assigned to a variable, the
result can be used in later parts of the script. Put differently, any calculation that is not
assigned to a variable gets returned as a plot. An attribute on line 20 preceeds the result
and tells BullCharts the name of that plot. In this case %K.
136
Sample Indicator
The %D Line
[name=%D; linestyle=Dash]
ma(kay,dperiods,method);
Lines 23-24 describe the signal line, %D. The linestyle attribute is also added to make the
signal appear as a dashed line by default. Because the %K result had been assigned to a
variable, it can be re-used in the calculation of %D. Line 24 specifies that the result is a
moving average over %K, of the length specified by the input, and of the type specified by
the inputma.
Markers
Lines 26-31 describe two markers that indicate when significant events occur on the chart.
The linestyle=market attribute indicates that the next result should be interpreted as
a marker. Whenever the following result evaluates to true, a marker will be drawn. In this
case markers are drawn when the %K rises above 20 or falls below 80, among other
conditions. Note the use of a comment, in green, to visually separate the markers from
other parts of the script. Comments are a useful way of making a script more
understandable to others.
See Also
Sample Scripts
137
Troubleshooting
BullScript prevents you from entering a formula that has a mistake in it by displaying an
error message and asking you to correct the formula before proceeding. BullScript
generally does a very good job at detecting what kind of error a formula has.
BullScript will display an error code when it displays an error message. This is a three-
digit number which usually begins with ‘1’. See the full list of error codes.
See Also
Error Codes
139
Error Codes
When BullScript encounters an error it will give an error code. Use the list below to learn
more information about a particular error.
101
Some code was expected at a certain point, but none was found. This typically
happens if a formula stops in the middle without concluding. E.g. 1 +
102
An opening bracket was found, without a matching closing bracket. E.g. (1 + 2
103
A closing bracket was found, but it doesn't have a matching opening bracket. E.g.
1 + 2)
104
To the right of a dot, there was something other than a single variable name. E.g.
myformula.my variable. This is not legal since 'my' and 'variable' are
seen seperately by BullScript. You can’t have a variable name that contains
spaces.
105
To the left of a dot, there was something other than a formula found.
106
Something was used as a formula, but that formula has not been entered, and
there is no builtin function with that name. Perhaps you forgot to enter the
formula, or perhaps the formula name was mis-spelt.
107
A variable within a formula was accessed using formula.variable syntax, and
formula is a valid formula, but it doesn't contain a variable with the name given.
Maybe the you mis-spelt the variable name?
108
The script appears to be attempting to call a function, but the bracket syntax isn't
correct. Perhaps brackets don't match?
109
A function or formula was called, but the wrong number of parameters was
supplied. E.g. add(4) or add(5,4,8).
141
Getting Started with BullScript
110
A function or formula was called, and a non-constant parameter was supplied
where a constant parameter is required. E.g. mov(C,V).
This is illegal because the second parameter to mov must be constant.
Alternatively, this error can also be triggered if a constant is of the wrong value.
E.g. mov(C,-10).
This is illegal because a moving average can't be calculated over a negative
number of periods, and so the function guards against this.
111
An operator was logically expected but none was found. E.g. 1 2. Some kind of
operation is expected between '1' and '2' but there is nothing there.
112
Something was found which looks like it's meant to be a number, but it's not
correctly formatted. E.g. 1.2e or 1.22.4
113
A string wasn't closed properly before the end of the formula. Perhaps you forgot
to put in a closing quote? E.g. input("Enter the number of
periods,5,0,10)
114
A valid variable, formula, or function name was found, but there is no known
variable, formula, or function with that name. Perhaps you mis-spelt it, or forgot
to add in a formula earlier? E.g. myvariable := 5; myvaraible * 2
115
A variable with the same name was defined twice in the same formula. E.g.
myvariable := 5; myvariable := 2
116
A formula with the same name was entered twice.
117
To the left of the assignment operator, :=, there was something other than a valid
variable name. E.g. 5 + 4 := 9
118
A variable name was not in a correct format, it contained illegal characters, or is
a reserved language keyword.
119
142
Error Codes
See Also
Troubleshooting
143
Index
A B
Abs function .......................................36 BarsSince function ............................. 27
Absolute Value....................................36 BBandBot function............................. 80
Accumulation Swing Index ................78 BBandTop function ............................ 80
Accumulation/Distribution .................79 Bear Harami ....................................... 52
ActTrade .............................................86 Bear Harami Cross ............................. 52
ActVest ...............................................87 Bearish Engulfing Pattern................... 56
AD function........................................79 Best Practices ................................... 137
Add function.......................................37 Big Black............................................ 53
ADX function .....................................79 Big White ........................................... 53
Alias attribute ............................. 13, 115 Black Body......................................... 53
AllFalse function ................................25 Black function .................................... 53
AllTrue function .................................26 Bollinger Bands.................................. 80
And .......................................................3 Bull Harami ........................................ 54
AnnualDividendPerShare variable .......5 Bull Harami Cross .............................. 54
AnyFalse function ..............................26 Bullish Engulfing Pattern ................... 56
AnyTrue function ...............................27 C
Arc Tangent ........................................37 C variable ............................................. 4
Aroon..................................................79 Category attribute ....................... 13, 115
AroonDown function..........................79 CCI function....................................... 82
AroonUp function...............................79 Ceiling function.................................. 38
AssetBacking variable ..........................5 Chaikin Accumulation/Distribution
Oscillator ....................................... 81
ASwing function.................................78
Chaikin’s Money Flow ....................... 81
ATan function .....................................37
Chande Momentum Oscillator ........... 82
ATR function ......................................80
Citation attribute......................... 13, 115
Attributes .................................... 13, 115
Close price............................................ 4
Average Directional Movement..........79
CMF function ..................................... 81
Average True Range ...........................80
145
Getting Started with BullScript
146
Index
147
Getting Started with BullScript
148
Index
149
Getting Started with BullScript
150
Index
151