BollingerBands  |  BollingerOnBollingerBands  |  BBForex  |  EquityTrader  |  FundsTrader  |  GroupPower  |  MarketTechnician  |  PatternPower  |  BBScript  |  Mobile  
|
Chart
New
|
EquiVolume
|
Structure
|
Lists
|
Screen
|
Portfolio
|
Patterns
|
Edge
|
Mobile
New

What is BBScript?
Quoting the BBScript official website (www.BBScript.net):

"BBScript is a web-based programming language for technical analysis. It was developed as a quick, simple and easy to use scripting language for implementing and plotting technical indicators for equities and forex data in our interactive website charts: BollingerOnBollingerbands.com, EquityTrader.com and BBForex.com. Currently the latter three websites are the only ones to support BBScript.

Using BBScript, simple or complex indicators can be plotted in our highly interactive and customizable advanced charts. These charts employ advanced features such as dragging, zooming in and out, vertical and horizontal trackers, trendlines, continuous data updates, drag and drop re-ordering of charts, etc. A BBScript editor is built-in and can compile and run BBScript code. Indicators are then rendered and displayed using the chart engine."


For full documentation and the latest information on BBScript, please refer to the official website: www.BBScript.net. For questions and online support, go to the BBScript discussion forum.


BBScript Program Sample: (Momentum Indicator with Exponential Moving Average)
The following is an example of a BBScript code sample to plot the 12 period momentum indicator along with a 12 period exponential moving average of that indicator in the same indicator chart.

You need to be subscribed to BollingerOnBollingerBands in order to run BBScript. If you haven't subscribed yet, get your 30 day FREE trial here.

Once you've subscribed, go to the Chart section and make sure that the "Advanced" tab is selected.

Open the "BBScript" editor by clicking on its tab option in the main chart menu. The editor will open. To enable the script to run, make sure the "Run Script" checkbox is checked. On the left panel text area, insert the script you want to run. Click the "Run" button to run the script and plot its output. The script will run on the currently selected symbol and sample rate. In the case below, it is the ticker AAPL's DAILY chart. If you wish to run the script on another symbol or sample rate, just change those settings from their corresponding input fields and drop down menus.

data("x")
//data object


//create momentum indicator and its ema

period1 = 12
//mtm period

period2 = 12
//ema period


momentum = close(x) - close(x)[-period1]
//mtm formula

plot1 = plot(momentum,"Momentum","histogram","ff0000")
//mtm plot


ema_mtm = ema(momentum,period2)
//ema of mtm

plot2 = plot(ema_mtm, "EMA", "line", "0000ff")
//plot of ema


chart(plot1,plot2)
//display mtm and ema in indicator chart




BBScript Editor
The BBScript editor is displayed below. It consists of the following components:

BBScript Editor
  • Run Script Checkbox: (top left side) The script will run when this checkbox is checked.
  • New Button: This will create a blank new script and open it in the current workspace. The script name must be provided in the Script name field.
  • Browse Button: This button will open the file manager where all the user's scripts are displayed.
  • Delete Button: This button will delete the current script from the backend server and remove it from the workspace.
  • Script Name: The script name must be unique and can only contain up to 40 alpha-numeric characters, spaces or the underscore character (_). A script can't be saved or run until a valid name is provided.
  • Save Button: (top left side) To save your script to our server, click this button. A valid script name must be provided. If it is disabled, then your script is already saved.
  • Input Script Panel: (left side) Insert your code in this area. Comments are highlighted in green and errors are underlined in red. As you type your script, autocomplete functions and their description is displayed on the output screen.
  • Search Manual Text Field: (top right side) enter a keyword to lookup in the BBScript manual.
  • Output Panel: (right side) Displays the system notifications, variable printouts, error messages, manual or API lookups.
  • Duration Indicator: (bottom right side) Displays the duration of the script execution.

BBScript File Manager

BBScript is cloud based. It runs in a browser and all scripts are stored safely on our servers. You can access the scripts anytime you are on line and logged onto BollingerOnBollingerBands. You must have an Adobe Flash Player installed on your computer and be connected to the Internet to create, edit, save and execute your scripts from our web interface.

In the BBScript file manager, scripts can be loaded into the workspace, renamed or deleted by clicking the corresponding buttons ( load, rename or delete) next to a script's name in the same row.
  • Loading a Script: To load a script into the editor's workspace so you can edit or run it, click the "Load" button next to its name. Before the action is completed, you will be asked to save the currently displayed unsaved workspace script before it is removed from the workspace.
  • Deleting a Script: To delete a script, simply click the "Delete" button. You will be prompted to confirm your delete action before it is executed.
  • Renaming a Script: Clicking the "Rename" button will allow you to edit the script's name as shown below. Once you have finished entering the new name (with the name parameters outlined in Script Name above), click the "Apply" button next to it and the changes will be applied. If the name is invalid, an error message will appear.

Script Renaming


The resulting indicator is shown below the price chart. Notice the labels for the momentum and its exponential moving average. Also notice that the momentum indicator is plotted in histogram format (positive green vertical lines and red negative vertical lines). The exponential moving average is plotted in blue in a linear format. The created indicator behaves the same way as the built in indicators. If you hover the cursor above it you can determine the value at a specific point. You can zoom in and out as well as drag the chart to the right or left. As data get streamed the script will rerun and the indicator chart is updated automatically.

BBScript Programmatically Created Indicator