QuantShare

This chapter will guide you through the tutorial parts:

Application:

Using the software
Docking windows
Toolbars
Workspaces
Events
Scripting
Intraday Settings

Charting:

Charts
Layouts
Templates
Drawing tools
Auto drawing tools

Symbols:

Symbols
Symbols Selection

Data:

Databases
Application Objects

QuantShare Language:

QuantShare Language
Composite Function
Advanced Rules

Plug-ins:

Indicators
Custom functions
Custom Drawing Tools
Composite
Watch List
Script Manager
Widget Panel
Sharing Server
Notes
Divers

Downloading Data
ASCII Importer
Downloader
Data Viewer

Rules Manager
Ranking System Manager
Simulator
Monte Carlo Simulation
Advanced Money Management
Screener
Pivot Tables
Portfolio

Artificial Intelligence
Optimizer

Portfolio123


Introduction

QuantShare is an advanced technical/fundamental analysis program.

We have built a flexible trading software whose possibilities are only limited by your imagination. But because we know that this is not enough, we have created a sharing server to let you exchange items with other traders in order to feed your imagination, increase your productivity, give you the opportunity to use advanced traders tools, and help you improve your trading skills.

QuantShare


Using the software

1. Starting the program

To start the program, double-click the QuantShare icon on the Windows desktop or select QuantShare menu item from the Programs menu.

2. Main window

The main application window contains the menu, the toolbars, the docking windows and the chart windows.

3. Application settings

To access the application settings (Accounts -> Application Settings)

The different tabs are:

- Visual Settings: Update visual settings such as the application backcolor, application font color...

- Memory Management: Update memory management options

- Databases: Specify the database optimization frequency.
You can instruct the application to start the optimization on the next run by clicking on "Schedule databases optimization..."

- Workers: Specify different settings for workers and tasks notifications (Download items, analysis...)

- Editor: Specify whether to display the wizard or standard formula editor by default

- ToolStrip: Update Color settings for the different toolbars and menus.

Note: Each account has its own application settings.


Docking Windows

A docking window can stick to the main application boundaries or to the other windows boundaries.

1. Move a docking window

In the picture below, we have a chart window and four docking windows.
To move the right panel or window to the left, first click on the caption of the right panel (Where it is written Composite in this example).

Move the mouse while keeping the mouse left button pressed; a blue rectangle will appears, continue moving this rectangle to the left panel.

An icon with five rectangles appears, select the right rectangle then release the mouse button.


Toolbars

This application contains two main toolbars, one located at the top below the menu and the other at the bottom.

1. Top Toolbar

The top toolbar contains mainly symbol's selection combo boxes and drawing tools buttons, it contains some other buttons created by the plug-ins and a list of shortcuts.

2. Bottom Toolbar

The bottom toolbar is used to display account name and to manage templates, layouts and workspaces.

The bottom toolbar has the following items:

  • The current account name
  • Templates menu
  • Layouts menu
  • Workspace menu
  • Divers menu, which contains the list of shortcuts
  • Symbols working information
  • Message and alerts
  • Intraday data-feeds

3. Accounts

The application starts the first time with a default account name. You can add, remove and update accounts later.
Each account has its own items, databases data, quotes…

3.1. Account files

Account files are located in the directory 'Databases'.
Each account has a sub-directory in the 'Databases' directory.
Example if your account name is 'Trader' then the full path to this account is 'Application Path\Databases\Trader', and within this directory are located all the objects, databases associated to this account.

3.2. Create an account

To create a new account (Accounts -> Add Account)

The database folder is updated automatically after you type the account name.

3.3. Change the current account

To change the current account (Accounts -> Change Account)

Select an account then click on 'Open'.

3.4. Update an account

To update an account (Accounts -> Change Account)

Select an account then select the 'Update account' tab.
Click on 'Update and reload' when you finish.

3.5. Remove an account

To remove an account, click on 'Change Account', select an account then click on 'Delete'.

3.6. Associate an existing database to an account

Select "Accounts -> Change Account"

Select an account then click on the 'Update account' tab.
In the database folder textbox, choose an existing directory that contains the data you want to use (usually the directory of another account).


Workspaces

1. Workspaces

A workspace contains the location of forms and charts.
You can create as many workspaces as you want.

Example: You can create a workspace that contains only charts, another one that contains the download forms...

2. Create a workspace

To create a new workspace, click on the button, in the toolbar, as shown in the picture, select 'Save workspace' and then type a name for your newly created workspace and finally click on save.

3. Remove a workspace

To remove a workspace, click on the button, in the toolbar, as shown in the picture, select 'Remove a workspace' and then select the workspace you would like to remove.

4. Load a workspace

To load a workspace, click on the button, in the toolbar, as shown in the picture, select 'Load a workspace' and then select the workspace you would like to use.


Events

Application & Thread events

1. Application events

Main application and plug-ins can throw events to notify the 'Event System' that they have completed a task or that a user did an action...

Main application and plug-ins can also subscribe to the 'Event System' and receive notification about a certain event they want to catch.

The plug-in that makes the more use of these events is the 'Task Manager'. Its role is to execute scripts depending on the application or system events and on your settings.

Example of notification:

2. Thread events

Thread events are events sent by plug-ins, the tasks associated with these events are generally time or CPU consuming tasks.

Example: (Downloading quotes)

The main application catches these events and adds notifications about whether these events start or end into a grid (as shown below)


Scripting

1. Introduction

Scripts in the QuantShare software use the .Net framework and the CSharp (c#) or Jscript.Net programming languages.

.Net Scripts extend QuantShare capabilities and make the application extremely flexible.
Scripts can be shared between QuantShare users.

There are two kinds of scripts, main script and specialized scripts.

The main script allows the user to:

· Control the application behavior

· Extract databases data

· Insert, inspect, control and modify database data

· Control the objects (composites, watch lists, list of rules...)

The specialized scripts allow the user to take control over some specific tasks.

The application offers you the possibility to write scripts for the following tasks:

Money management: Contains five events, the first and last events happen once while the other events could happen many times during the backtesting.

· OnStartSimulation: The simulator executes this script before starting the backtesting process.

· OnNewTrade: The simulator executes this script before entering a new position.

· OnCloseTrade: The simulator executes this script before exiting a position.

· OnEndPeriod: The simulator executes this script at the end of each period or bar. (In end of day back-testing, a period is a day)

· OnEndSimulation: The simulator executes this script when the back-testing process ends.

Example: Create a script that initializes an optimizable variable in the 'OnStartSimulation' event

Create a script, in the 'OnNewTrade' event, that updates the number of shares to buy depending on the trading system drawdown and the optimizable variable defined in the 'OnStartSimulation' event

Example: Create a time-series metric for your trading system using the 'OnEndPeriod' and the 'OnEndSimulation' events

Note: In money management scripts, you can define global variables that can be shared between events.

List of rules analyzer metrics: Script that let you create metrics to assess rules
Example: Calculate the average performance of a rule for each month.

Ranking system analyzer metrics: Script that let you create metrics to assess ranking systems
Example: Calculate the standard deviation of the buckets annual return.

Simulation metrics: Script that let you create metrics to assess simulations
Example: Calculate a custom metric that uses Sharpe, Sortino and some others ratios

Prediction model metrics: Script that let you create metrics to assess prediction models

Example: Calculate a custom metric that uses others already calculated metrics.

Pre-Parsing data: Script that let you manipulate text or CSV data
Example: Create a new column that is based on others columns data
Example: Update a column data so it can be parsed by the software

Post-Parsing data: Script that let you manipulate parsed data just before the application stores it

Example: Correct bad quotes

URL-Script: Script that let you dynamically create URLs for the downloader to download. The data is then passed to the Pre-Parsing and Post-Parsing scripts if they are implemented.
Example: Grab the download URL from a website that dynamically changes the URL path every day.

Functions: Function scripts let you create QuantShare functions. These functions could be used in charting, simulation...

Example: Correct a custom indicator that is not available in the QuantShare indicators list

2. Script Control

.Net script shares the same control; the control is an advanced text box control where you can type in your script.

You can press on CTRL+SPACE at any moment to display the list of functions or variable that you can use in the current

script.

Each script contains its own functions and classes.

You can click on the right icon to display information about the current script.

3. Global Variables

The Global variable class lets you define global variables.

This class is present in all scripts (main script and specialized scripts).

Its main functions are: GetVariable and SetVariable.

Example:

Global.SetVariable("myvar", 20);

The application will now create a global variable "myvar" that has a value of 20.

You can access this variable from any script. This will allow scripts to interact with each other.

4. Create functions inside a script

You can create inside a script as many functions as you want. You just need to tell the application where the main code

ends. This is done, by using the following keyword: #functions#

Example:

double a = 0;
for(int
i=0;i<10;i++)
{
a = Sum(a, 1);
}

MessageBox.Show(a.ToString());

#functions#
public double Sum(double a, double b)
{
     return a + b;
}

This C# script calls the function "Sum" ten times.

5. Reference External DLLs in a Script

In any script editor (Create Functions, Money Management, Custom Drawing Tools...), click on the "Menu" button located at the bottom then click on "Add References".

The new form displays all the external references of the current script.

To remove a reference, select it then click on "Remove Reference".
To add a new reference, click on "Add Reference", select the Dll or library you want to include then click on "Open".

Once a library is added, you can reference it in the script by typing the full namescape or by typing the "using" keyword.

Example 1: (Full Namescape)

System.Diagnostics.Debug.WriteLine("Hello");

Example 2: ("Using" Keyword)

using System.Diagnostics;
Debug.WriteLine("Hello");

Note that in the money management script, the menu button appears only in the script editor of the "Global" event. However, once a dll is added, you will be able to use it in any other event (Example: OnStartSimulation, OnEndPeriod...)


Intraday Settings

To open the Intraday Settings form:

- Select "Accounts" then "Intraday Settings"

1. Data Settings

- Create Intraday Snapshot from Tick data:

When you import or download tick data, this feature allows you to create intraday data and to store it in the intraday database.
In the input field, you can select the default time-frame to use when creating the intraday data.
This will allow quick access of data for your base time-frame.

Example:
Type 60 to create and save one-minute bars data from your tick data.

- Intraday data storage

Adding a lot of intraday data can slow your computer. This option allows you to instruct the application to delete old data by specifying the number of past days to keep in the database. Older data will be automatically deleted.
Set "0" to disable this option.

- Watchlist/Screener

This option allows you to specify the number of days worth of data to load when using the screener/watchlist and when working with intraday time-frames.
A value of 20 is usually enough for one-hour time-frame. You can set a lower value if you work with lower time-frames.
Set "0" to disable this option. The screener or watchlist will load all the available intraday/tick data.

2. Exchange Settings

Select the "Exchange" tab to open the Exchange settings control.
This control allows you to update exchange settings.

How to create an exchange:

The exchanges displayed in this control correspond to the different markets you can specify in "Symbol -> Categories".
- Select "Symbol" then "Categories"
- Type the exchange name near the "Market" field then click on "Add".

How to delete an exchange:

- Select "Symbol" then "Categories"
- Select a market then click on "Remove Selected Market".

Exchange Settings:

Name: The exchange name
Abbreviation: A short name for the exchange
Exchange Daylight Savings: Specify the start and end of daylight savings

Sessions Times:
Click on "+" icon to add a session and on the "x" to delete a session.
The "Start" and "End" corresponds to the session start time and end time.
Under "Days of week", click on the days of the week where the exchange is open.
The "Sync" time allows you to synchronize the time with the open time of the intraday bars.
Example: A sync time of 8:15 will cause a 30-minute chart to build bars that start at 8:15, 8:45, 9:15, 9:45...
The "Sync" time is usually the same as the day session opening time.


Charts

1. Introduction

2. Basic operations

2.1. Open a chart

Select "View" then "New chart".

2.2. Update chart symbol

Select a chart, and then select a symbol from the tool bar; the chart symbol will be automatically updated.

2.3. Arrange charts

To arrange charts, click on the button shown below.

You can also specify how to arrange charts by specifying the number of rows and columns.

2.4. Create linked chart

A linked chart is a chart that is linked with another one.

You can link charts by symbol or by time-frame.

If chart 'A' is linked by symbol to chart 'B', then if we change the chart 'B' symbol then the symbol of chart 'A' will be updated as well.
If chart 'A' is linked by time-frame to chart 'B', then if we change the chart 'B' time-frame then the time-frame of chart 'A' will be updated as well.

Linked Charts are those that have the same link index

To link two charts by symbol, click on the "S" button (at the bottom of the chart) then select a link index. Linked charts must have the same link index.

To link two charts by time-frame, click on the "T" button (at the bottom of the chart) then select a link index. Linked charts must have the same link index.

If you click on a given date on a chart A, that date will be displayed in charts that are linked to chart A.
If you create or update a drawing item, then linked charts will be automatically updated.

2.5. Shortcuts

To display a list of shortcuts, click on 'Divers' in the bottom tool bar, then click on 'List of Shortcuts'.

Other shortcuts:

- Open a new chart from "Select a symbol" field (Main Window) by typing the symbol name in this field, then using ENTER + SHIFT shortcut.
- Use mouse wheel to transalte a chart
- Keep pressing on CONTROL and use your mouse wheel to zoom in and out
- Press on CONTROL then double click on a pane to maximize it
- To quickly change the chart symbol, keep pressing on the UP arrow and type a symbol
- Type CONTROL+S to add a split to the current symbol for the selected data
- Type CONTROL+B to add a dividend/bonus to the current symbol for the selected data
- Type CONTROL+N to add a note to the current symbol for the selected data

2.6. Zooming

To zoom into a chart, click on CTRL then use the mouse wheel to zoom in and zoom out.

2.7. Window Types

There are three types of Chart Windows:

- MDI Window: The chart can only be moved within the application

- Owned Window: The chart is owned by the application but it can be moved outside of it.

- Floating Window: Create a separate floating window.

To update a chart window type, right click on a chart, select "Window Type" then select the type.

You may notice that it is not possible to update the symbol of a floating chart (using "Select a symbol" field) if you already have more than one chart.
To update a floating chart's symbol, keep pressing on "UP ARROW" key then type the symbol name.
You can also click on the "Tools" icon (Next to time frame menu at the bottom of the chart) then type the new symbol name.
If selecting the "Type a symbol..." doesn't work, try minimizing the main QuantShare form first.

3. Panes

Each chart is a collection of panes; a chart can contain one or several panes.
Each pane contains a template and one or many formula files.

Example of chart with three panes:

To maximize a pane, keep pressing on CONTROL then double click on it. To restore it, perform the same operation.

4. Select Line

There are three select tools available:

  • Line when chart clicked
  • Cross lines
  • Cross lines outside chart

You can specify some settings like color, line width, Stick to (See Drawing tools)...

5. Time-Frames

Available historical periods are day, week, month, year, and custom.
Custom historical periods let you select the number of days to use as timeframe.

Available intraday periods are 1 second, 1 minute, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 5 hours, and custom.
Custom intraday periods let you select the number of seconds to use as timeframe.

To switch from Historical to Intraday data, right click on a chart then select "Switch to Intraday" or "Switch to Historical".
To change a chart timeframe, right click on a chart, select 'Chart Timeframe' in the menu and then select the timeframe.
You can also update the current timeframe by selecting the option that is located at the bottom-left corner of the chart.

Custom Periodicties:

You can create a custom periodicity that are not time-based by right clicking on a chart then selecing "Periodicity" menu. (Extended menu)

To create a new periodicity, right click on a chart, select "Periodicity" then "Periodicity Settings".

Different Periodicities are available:

- Ticks per bar: A tick bar is based on a specific number of trades. A new bar is created when the number of specified ticks is reached.
Example: In a 50-Tick periodicity, each bar represents 50 ticks/trades.

- Volume per bar: A volume bar is bsaed on a specific traded volume value. A new bar is created when the sum of volume becomes equal or higher to the specified value.
Example: In a 50,000-Volume periodicity, each bar contains trades that represent a volume of 50,000 contracts.
NB: This periodicity is customizable. This means that you can update the default formula: volume

- Change per bar: A change bar is based on a security return. A new bar is created when the sum of the one-bar rate of return becomes higher or qual to the specified value.
Example: In a 5-Change periodicity, each bar represnts a change of 5% in the price of the security.
NB: This periodicity is customizable. This means that you can update the default formula: perf(close, 1)

- Range per bar: A range bar is based on a specific price range. A new bar is created when the price range is broken.
Example: In a 3-Range periodicity, each bar measure $3 (Measured from high to low).

If "Multiple of ticks" is specified then a unit represents the tick size of the security.
Example: In a 3-Range periodicity, each bar measures 3 ticks (Measure from high to low).
For Apple stock, a tick size is 0.01 and therefore each measures $0.03.

- Signal change per bar: A signal change bar is based on a signal/rule. A new bar is created when the signal or rule is TRUE (equal to 1).
Exampel: In a (Close > Open) signal-change periodicity, a new bar is created when the close price becomes higher than the open price.
NB: This periodicity is customizable. This means that you can update the default formula.

Options:
Do not show in menu: Check this option to disable the periodicity (It will not be visible in the list of periodicities that is displayed when you right click on a chart)
6. Chart Type

Besides Japenese Candlestick, Line and Bar charts, QuantShare allows you to create other chart types:

- Point & Figure: More Info
- Kagi: More Info
- Heikin Ashi: More Info

Chart Type Settings:

You can open the Chart Type Settings form by right clicking on a chart, selecting "Chart Type" then "Chart Type Settings".

7. Drag & Drop

You can drag and drop formulas from a pane to another one.
If you right click on a curve or a bar, the application will detect which formula this curve or bar belongs to, you just have then to drag and drop this formula to another pane.

Right click on a study then drag & drop to another pane

You can also drag and drop a formula to the widget or bookmark panel.
Note that unlike the majority of the other items (Trading systems, watch-lists, composites ...), when the drag & drop process completes, a copy is saved (not a reference).
This means that if you drag and drop a chart formula to the bookmark panel, then you update the formula in that panel, the chart formula will not change.

If you want to copy a formula, keep clicking on CONTROL then perform the drag & drop operation.

8. Plot Formulas

Charts are based on formulas.
You can create charts without writing any line of code, or you can create complex charts using the QuantShare Language.

You can plot candlesticks, lines, bars, smoothed lines, step lines, symbols, and texts.

There is also a special type of graphs called fixed graphs.

You can plot for example something like "Average daily performance for each day of the week", or "number of days up and days down for each month"...

Here is the formula syntax:

PLOTFIXED(vector1, vector2, string vector, calculation function, description, color, ChartStyle, Style);

Let us imagine we want to calculate the average closing performance for each day of week.

Vector1: (Day of week) (one means Monday, two for Tuesday...)

1

2

3

4

5

1

2

3

4

5

Vector2: (Close price)

10

11

12

10

8

6

9

11

13

12

Intermediate Vectors:
X vector:

1

2

3

4

5

Y vector:

10 | 11 | 12 | 10 | 8
6 | 9 | 11 | 13 | 12

Then if we have selected "Sum" as calculation function, we will have:
Y vector

16 (10+6)

20

23

23

20

In our case, we want the average closing price, so Y vector will look like this:

8

(10+6)/2

10

11.5

11.5

10

At the end, we plot the graph with X vector in X-axis and Y vector in Y-axis.

Example formula:

// Average daily performance per by day of week
// One day price change
performance = perf(close, 1);

// Day of week
dayofw = dayofweek();

// Change day of week numeric values to text
format
text = StringReplace(dayofw ,0,"Sunday");
text = StringReplace(text,1,"Monday");
text = StringReplace(text,2,"Tuesday");
text = StringReplace(text,3,"Wednesday");
text = StringReplace(text,4,"Thursday");
text = StringReplace(text,5,"Friday");

// Plot fixed chart
PLOTFIXED(dayofw, performance,text , iAvg,"Average daily performance per by day of week",colorGreen,ChartBar,StyleSymbolDiamond);

9. Formula Files

Charts don't contain reference to formula files but instead contain formula contents.
This means that even if you remove or update a formula file that a chart was build upon, the chart won't change.

Right click on a chart, and then click on 'Edit formula' to edit a chart formula.
Only the current chart will be affected if you update the formula or change its name.

You can save the content of this formula to a file and use it later with other charts.

10. Future Bars

Future bars option has no effect on the prices series and studies. This option is used to display more empty bars on the right.

To update the number of future bars in a chart:
- Right click on a chart
- Select "Tools" then "Set future bars"
- Type a number then click on "OK".

Example of usage:
Predict the date (in the future) when one trend-line crosses above another one.

Chart without future bars:

Chart with 30 future bars:
11. Chart Scale

To change the chart scale from linear to logarithmic:
- Right click on a chart
- Select "Tools" then "Set Log Scale".

12. Manage Charts

Charts Manager tool allows you to save charts and manage them by this plug-in.

Here are the different elements that are saved with the chart:
- Different panes and formulas
- Layout and templates
- Drawing data
- Chart settings

To open the Charts Manager tool, select "Views" in the main menu then "Manage Charts" (Extended Menu).

To save a chart:
- Select the chart you want to save
- Click on "Save Chart" button in the "Manage Charts" form
- Type the chart name then click on "Save"

To open a stored chart, double click on it
Alternatively, you can right click on an item to open a menu. In this menu, you can open/delete the chart and manage categories.

13. Additional Chart Settings

The chart formula editor can be opened by right clicking on a chart then selecting "Edit Formula".

The "UpdateSettings" formula allows you to update additional chart settings.

Examples:

UpdateSettings("Full Pane", 1);

Removes the date, indicator values and icons from the pane and reduces the top and bottom pane's margins.

UpdateSettings("Top-Bottom Chart Margin", 1);

Removes the top and bottom pane's margins.

UpdateSettings("Hide Formula in EOD Chart", 1);

Instructs the chart to hide the formula when EOD time-frame is selected.


Layouts

1. Layouts

A layout contains information such as:

How many panes a chart have?
What is the formula on each pane?
What is the template associated with each pane?
...

2. Create a layout

To create a layout from a chart, right click on that chart and click on 'Save layout as...' type a layout name then saves.

3. Default layout

The default layout is the layout that will be used when creating a new chart (View -> New chart).
To set a layout as a 'Default layout', right click on a chart that contains the layout you want to use as a default layout then click on 'Set current layout as default'.

NB: the default layout will be saved as 'Default.lay'. If this file is removed then the program will create a new default layout.

4. Remove a layout

Click on the button, in the toolbar, as shown in the picture, select 'Remove layout' and then choose the layout you want to remove.

5. Update a chart layout

To update a chart's layout, right click on a chart, select 'Change layout' then selects the layout you want to use.

6. Set the same layout to all charts

To set a layout to all opened charts, click on the button, in the toolbar, as shown in the picture, select 'Set layout to all charts', and then choose a layout.


Templates

1. Templates

Each chart contains one or more panes. A template is a pane visual setting; it defines the pane's back color, grid line width, the axis colors...

You can easily create new templates, modify them, and associate them to other panes...
A chart can also contain several panes; each pane can have a different template.

2. Create a template

On a chart's pane, right click then select 'Settings' in the menu.

In the settings form, you can update any field by clicking on its value.
When you finish, right click again on the chart's pane and click on 'Save template as...'

Type in the template name then click on "Save".

3. Remove a template

Click on the button in the toolbar as shown in the picture, select 'Remove template', and then choose the template you want to remove.

4. Update a pane template

On a chart's pane, right click then select 'Change template'; choose a template you want to apply for the selected pane.

5. Update several panes' template

Click on the button in the toolbar as shown in the picture.

To update the panes' template of the selected chart, select 'Set template to selected chart' then choose a template.
To update the panes' template of all the charts, select 'Set template to all charts' then choose a template.


Drawing Tools

1. Drawing tools list

List of the available drawing tools:

· Line

· Extended line

· Horizontal line

· Vertical line

· Automatic support & resistance lines

· Regression channel

· Triangle

· Ellipse (Keep clicking on SHIFT to create a circle)

· Trend line

· Pitchfork

· Rectangle (Keep clicking on SHIFT to create a square)

· Cycle line

· Arc

· Zigzag

· Parallel lines

· Arrow

· Text

· Pen

· Marker

· Gann fan

· Gann square

· Fibonacci extension

· Fibonacci retracement

· Fibonacci time extension

· Fibonacci time zones

· Fibonacci arc

· Fibonacci fan

2. Usage of the drawing tools

Select a drawing item then click on the chart, point the mouse to a second location then click on the left mouse button.

Some drawing tools require three points or more.

3. Drawing tools settings

Each drawing tool has its own settings. You can update these settings by clicking on the right mouse button when the cursor is pointing on the drawing item.

Some settings are common to all the drawing tools, while others are specific.

The common settings are:

Line color
Line width
Line style
Locked or not
Stick to (high, low, close, open, all and no stick)
Stick only near candle

Examples of specific settings:
Line: In the line tool, a setting named 'X axis distance' and another one named 'Y axis distance' let you draw distances on a chart.

The line can be transformed to a 'Support resistance line'.
On a support resistance line, the letter 'S' means that your line now is a support, while a letter 'R' means that the line is a resistance.

Regression channel:

4. Remove a drawing tool

Right click on a drawing tool to open the settings form; click on 'Delete'.
To delete all the drawing tools, right click on the chart then select 'Delete all studies' in the menu.

5. Saving drawing tools Settings

To save a drawing tool settings:

  • Right click on that drawing item
  • Update the settings according to your preference
  • Click on 'Save Settings' button to save setting for the selected drawing tool type (Example: Triangle)
  • Click on "Default" to get the default settings (As specified in the drawing tool toolbar)

6. Save/Load drawing data

To save drawing data of a specific pane:

- Right click on the pane (chart)
- Select "Tools" then click on "Save Drawing Data"
- Type a file name then click on "Save"
- Click on "Load Drawing Data" to load data from a file

7. Shortcuts

Copy Item: Select a drawing item then use CONTROL+C shortcut ("Drawing Item Copied" is displayed on the chart)
Paste Item: Use the CONTROL+V shortcut ("Drawing Item Created" is displayed on the chart)
Disable "Stick To": Use CONTROL to disable temporarily the "Stick To" option

8. Custom Drawing Tools

You can use the custom drawing tools plug-in to create your own drawing items. Please refer to the Plug-ins folder for more information.


Auto Drawing Tools

Auto drawing is a feature that automatically draws on a chart whenever a chart symbol changes or a new chart window opens.

You have to choose which drawing tools you want to use, then specify the number of days to use and the application will take care of the drawing.
The drawing generated by this feature is locked.
To unlock it, just right click on the drawing then uncheck 'lock position'.


Symbols

A symbol references a stock, an option, an index, a composite...

1. Add Symbols

To add symbols to your database (Symbol->Add Symbols)
You can add symbols in two ways:

1 – Insert comma separated symbols in the field then click on 'Add'

2 – Specify a file that contains a list of comma separated symbols.

You can also add symbols by downloading a list of symbols from the Sharing Server.
List of symbols are a collection of symbols shared by other users.
After you download a list of symbols. Select "Symbols" in the application main menu, then click on "Add-Remove from list of symbols". Click on "Select" to select a list, then click on "Add".

2. Remove Symbol

Select (Symbol -> Update Symbols)
Browse through the symbols and click on 'Remove' on the symbol you want to delete.

NB: Use the bulk symbol updater to remove many symbols at once.

You can also remove symbols that belong to a list of symbols. To do so, select "Symbols" in the application main menu, then click on "Add-Remove from list of symbols". Click on "Select" to select a list, then click on "Remove".

3. Update Symbols

Select (Symbol->Update Symbols)

You can update all symbols' information within this form.
After you have done, click on 'Update'.

NB: Use the bulk symbol updater to update many symbols at once.

4. Manage Symbols (Bulk Updated)

The Bulk Updater allows you to edit multiple symbols very quickly. (Symbol -> Manage Symbols)

- To open the Symbols Manager form, select "Symbol" in the main menu then click on "Manage Symbols".

- You can filter symbols by updating fields under "Filter" panel.

- Under the "Select" column, you can check one or several rows. You can then remove theses symbols by click on "Remove Selected Symbols".

- To update one or several fields, select them using your mouse, set a value next to "Update Selected Cells" then click on "Update" or "Append".

- You can select all columns fields, copy or replace data by right clicking on the symbols grid.

- Once you are done editing symbols data, click on "Save Changes" button.

5. Create a list of symbols (Export)

There are two ways to create a list of symbols:

  • Select "Symbols" then click on "Create a list of symbols". Specify the symbols to include using the "Symbols Selection Control" then click on "Create"
  • Select "Symbols" then click "Create a list of symbols from a file". Type a separator then click on "Load file" to load a file that contains your symbols. The first row lets you specify the type of each column. For example: the symbol name should be associated with the keyword "name". After you finish, click on "Create List".

You can use this list to add symbols in another account, or you can share this list, so other members can use it. They will thank you.

6. Symbols View

The Symbols View form displays the different symbol lists (Also called Symbols Filters) that you have created.
You can for example create a list of NASDAQ Stocks, another one for Penny Stocks...

These lists can be referenced in plug-ins such as Watchlist, Screener, Simulator...

To open the Symbols View form:
- Select "Symbol" then "Symbols View" (Extended menu)

To create a new list:
- Right click on the form
- Click on "Create a new Symbols Filter"
- To add a new condition, click on the "Add a condition" link
- When done, click on "OK"
- Click on "+" to display all symbols in your list

You can also directly create new lists from the "Symbols Filter" control, by clicking on the "Save" link.

To edit a list:
- Right click on a list
- Click on "Edit Symbols Filter"

To remove one or several lists:
- Right click on a list
- Click on "Manage Symbols Filter"
- Check one or several lists
- Click on "+" to expand the menu (It not already done)
- Click on "Remove Items"

To remove a symbol from a list:
- You can update the list and add a new condition
- Or you can right click on a symbol and select "Remove Symbol from List"

In the second solution, a new condition is automatically added to your Symbols Filter.

To download data for all symbols in a list:
- Right click on a list
- Select "Download Data"
- Click on the appropriate downloader

7. Auto-Manage Symbols

Using this tool, QuantShare will track securities traded on selected exchanges and update your database automatically a new security is added, removed or updated.

To open this control, select "Symbols" then "Auto-Manage Symbols".

Force the update of symbol information:

This will force the update of symbol information (Names, title, industry, indices...) for all securities in your database.

Actions:

This allows you to control the action to take when a new security is found, updated or removed:
Add with confirmation: Display a confirmation box before adding new symbols
Add without confirmation: Add new symbols silently
Ignore: Do not add new symbols

Symbol Names:

Select the symbol name to store in the "Name", "Name1", "Name2" and "Name3" fields.

Example: (Anglo American PLC)
Exchange Symbol: AAUKF
Yahoo Symbol: AAUKF.PK
Google Symbol: AAUKF:PINK
Bloomberg Symbol: AAUKF:PINKSHEETS

Example:
If you want to track U.S. Exchanges:

- Check "American Stock Exchange", "NASDAQ" and "New York Stock Exchange"
- Click on "Save".


Symbols Selection

1. Symbols selection control

You will often need to select certain symbols among the list of all available symbols.
Whether it is for creating a composite, a trading system or a watch-list, selecting symbols from the "Symbols Selection" control is easy.
We have created a unique control that is used by all the plug-ins.

You can select symbols using a single or a combination of filters:

· By group: Select symbols that belongs to specified groups

· By sector: Select symbols that belongs to specified sectors

· By Industry: Select symbols that belongs to specified industries

· By Index: Select symbols that belongs to specified indexes

· By Market: Select symbols that belongs to specified markets

· Custom symbols (list): Enter manually the symbols you want to include.

· Random Symbols: Type a value from 0 to 100. Zero means select no symbols, and 100 means select all symbols.

· Internal List: Select symbols from a watchlist or portfolio

· Quotes: Select symbols based on pre-calculated data (Example: Date of last quote, Close price...)

· Drawing: Select symbols based on pre-calculated data (Example: Distance to support). Works only when you use the support/resistance drawing tool.

· Symbols Info: Select symbols based on security information

In order for a symbol to be selected, it must pass all the filters.
You can also make the filter act differently (Opposite) by clicking on the icon as shown in the picture below.
You can also add the "Union" condition between two filters so that symbols of each filter are added to the final list.

Example:

Total symbols: 8000.

Filter1: Random; 50 percent. Number of symbols that passed the filter: 4000.

Number of symbols selected: 4000 symbols.

Filter2: Symbols whose names begin with 'a'. Number of symbols that passed the filter: 700.

Number of symbols selected: 380 symbols.

Because of the way the 'Random' filter is used in this selection process, if you run these filters again, you may end up with slightly different number of symbols.

2. Custom Filters (Quotes, Drawing and Symbols Info)

When selecting a custom filter, you can use pre-calculated data to filter symbols.
A Pre-calculated data can be a number, a text, a date or a boolean (true or false).
For each type you have to enter or select one or more values in order to create the filter.

Numeric:

Example: number of drawing objects => Quotes Filter

You have to specify the start and the end values. All symbols that have a number of drawing objects within these values will be selected.

Date:

Example: date of last quote => Quotes Filter

You have to specify the start date and the end date.

Boolean:

Example: active symbols (active) => Symbols Info Filter

You have to choose between TRUE or FALSE.

Text:

Example: symbol name (name) => Symbols Info Filter

You have to enter one or more values. Values are separated by semicolon.

A value can contain the following characters: (multiply *), (point .)

Examples:

A: select the symbol which name is 'A'.

A*: select symbols whose name start with 'A'.

A.(1 point): select symbols whose names start with 'A' and have only two characters.

A..(2 points): select symbols whose names start with 'A' and have only three characters.

*A*: select symbols whose names contain the character 'A'.

A*;B*: select symbols whose names start with 'A' or 'B'.


Symbols by Industry/Sector

1. Display Symbols by Industry/Sector

This view displays the different sectors, industries, indices, markets and groups and shows stocks that belong to each item.

To open this view, select "Symbol -> Symbols by Industry/Sector"

Make sure your stocks are associated with the different industries, sectors or indices.

You can do that manually (Symbol -> Update Symbol) or automatically using (Symbol -> Auto Manage Symbols -> Select some exchanges -> Check "Force the update of symbol information" -> Click on "Save")

You can also filter symbols by clicking on the "Filter" button. In the new control, you can add one or several conditions to choose which stocks to display in the "Symbols by Industry/Sector" view.


Databases

There are several types of databases:

  • Quote database
  • Intraday database
  • Tick database
  • Custom database

The quote database contains EOD data
The intraday database contains data from intraday time frames (Example: one-minute, 10-minute, 1-hour...)
The tick database contains tick data (Date, Price, Volume, Type {Last, Bid or Ask})
The custom database may contain any text or numeric data.
Example: news database, fundamental database

The custom database can be a daily or an intraday database.
A daily database is a database where each row corresponds to a date while in an intraday database each row corresponds to a date and a time.

1. Create a custom database

In 'Data' menu; click on 'Edit databases'. (Data->Edit databases)
In the new form, click on the tab' name 'Creator'.

Type in the name and the type (Historical or Intraday) of the database then click on 'Add new custom database'.

2. Delete a custom database

In 'Data' menu; click on 'Edit databases'. (Data->Edit databases)
In the new form, click on the tab' name 'Creator'.
Select a database in the 'Choose database name' combo box, then click on 'Delete'.

3. View data contained in a custom database

In 'Data' menu; click on 'Edit databases'.
In the new form, select 'Custom' in the 'Choose a database' combo box, then select a database name in the 'Choose database name' combo box.
Browse symbols by selecting a symbol in the 'Choose a symbol'. The database data, if any, should appears on the grid.

4. Add a field in your database

- Select a custom database.
- Type the field name in the text box near the button 'Add new field'
- Select the field type in the combo box located above the text box
- Click on 'Add new field'. A new field will appear in the grid.

Descriptive name and snapshot

The Snapshot feature instructs the application to save the last numbers/data of each custom database field.
If you set the "Save last numbers (snapshot)" option to TRUE for a database field ("Field Info" panel in "Edit databases" form) then:
- Each time new data is added to this field, the application saves the last value of each symbol in an internal database.

The database will contain historical data and the internal database will get only the last values.
This allows you to quickly access this data and select symbols (In "Symbols Filter" form) based on these numbers.
The "Descriptive name" field allows you to specify a descriptive name for a database field.

Example:

- Download fundamental data from (http://www.quantshare.com/item-606-fundamental-valuation-ratios-for-us-stocks)
- Set the "SnapShot" feature to each field of the database created by the above downloader
- Select "Analysis" then "Quick Screener"
- Add a new condition (based on the previous fundamental database)
- Select "PEG" ratio
- Select an internal (Max and min values) to find the stocks that meet this criteria

Here is how to add the Snapshot feature to a database field:

- Select "Data" then "Edit databases"
- Select "Custom" then chooses a custom database
- Select a symbol
- In "Field Info" panel, select a field next to "Field Name"
- Check "Save last numbers"
- Type a descriptive name then click on "Save" to enable the Snapshot feature for the selected field

5. Remove a field in your database

Select a custom database.
Click on the 'Remove this field' button, select the field you want to remove, and then click 'OK'.

6. Fill a database field

Select a custom database.
Type a value on the text box near the button 'Fill field'.
Click on the 'Fill field' button, select the field you want to fill then click 'OK'.

7. Fill a custom database

Right click on the grid then select 'add line' or 'add multiple lines'.

8. Save and Undo changes

Quotes and custom databases data can be modified manually in the grid.
You have to click on 'Save' to save the new data.
Click on 'Undo changes' button to undo all your previous changes.

9. Export data

The 'Export to CSV' button is used to export the current grid data to CSV.

10. Delete data

Delete data for a single symbol

- Select "Data" then "Edit Databases"
- Select the "Quotes", "Tick", "Intraday" or a "Custom" database
- Select a symbol in "Symbols" panel
- Right click on the grid/table that contains the data and select "Remove all rows"
- Click on "Save"

Delete data from a database for a date range

- Select "Data" then "Edit Databases"
- Select "Manage databases" tab
- In "Delete database data" panel, select a database, a list of symbols, the start and end dates
- Click on "Delete" to remove data


Application Objects

1. Introduction

We use the word 'object' or 'item' to point out:

· Trading systems

· Watch-list

· Composite indexes

· List of rules

· List of symbols

· Simulator metrics

· ...

All these objects share some common controls.

These controls are used to manage, save and load these objects.

Each object is stored in a specific file.
To rename an object, double click on its name, and then type a new name.
An object can either belong to a category or not.
These objects can be shared, you can visit www.quantshare.com for a list of all shared objects.

The majority of the plug-ins have drag & drop features that let you drag objects and drop them on widget or bookmark panels.

2. Bookmark panel

This panel hosts folders and objects (generally shortcuts of objects are used)

Right click on the bookmark panel to open a menu. Using this menu, you can create a new folder, add an object or object shortcut, update a folder name...

You can drag and drop objects within the bookmark panel to change their locations or to move them from a folder to another.

Right click on any object to display a menu. The menu content is specific to each object type.

Example: 'Trading system' object menu.


MetaStock Plug-In

1. How to Read MetaStock Data

You can use the Metastock plug-in to read data from Metastock databases instead of QuantShare databases.

To enable this plug-in:

- Select "Download" then "External Database"
- Check "Metastock Database"
- Click on "Settings"
- Click "Add Folder" then select one or several Metastock folders (QuantShare will read all sub-folders and add all the available Metastock databases)
- Click "OK"

In the next screen, you have the following options:

Add new symbols to QuantShare: Check this field to add Metastock symbols to your QuantShare symbols list (If they do not already exist)

Enable EOD data: Check this field to allow QuantShare to read EOD data from the Metastock database (Otherwise QuantShare EOD database will be used)

Enable Intraday data: Check this field to allow QuantShare to read intraday data from the Metastock database (Otherwise QuantShare Intraday database will be used)

- Click on "OK" to close the settings control

- Click on "OK" to save settings

Now, each time you read data from the Metastock database, a "Metastock" label appears on the chart (on the top-right corner). This tells you that the data of this security comes from the Metastock database.


QuantShare Language

1. Introduction

QuantShare language is a simple, complete and fast scripting language.
It is a vector based language and contains more than 200 build-in functions and indicators.

Example of a vector-based language: if you type 'a = 1'.
The variable 'a' will be represented as an array of N elements (N represent the number of bars for a specific symbol) where each element of the array has a value of '1'.

Other examples:
c = close;

This is the representation of the 'c' variable.

10.5

11

11.2

11

10.8

10.5

10

10

10.3

11.2

The current symbol has 10 quotes (elements).
The first column represents the first bar or bar number '0'.

If we type now: c = close + 2;

The representation of the 'c' variable will be:

12.5

13

13.2

13

12.8

12.5

12

12

12.3

13.2

We added "2" to each element of the array.
You can see these arrays at any time using the debugger tool. (Right click on the editor).

In the next example, we will use a very common function 'ref', this function let you refer to old or future quotes.

c = ref (close, 1) makes the array shift by one bar to the right.

NA

10.5

11

11.2

11

10.8

10.5

10

10

10.3

'NA' means that the element of the array contains no data.

2. Basic Concepts

A variable can be a number or a string.

v1 = "test"; (assign the text 'test' to the variable 'v1').
v2 = 2; (assigns the number 2 to the variable v2).

You cannot do math calculation using both numeric and text variables.

v3 = v2 + 2; (Correct)
v3 = v2 + v1; (Not Correct)

To concatenate two string variables or a string and a numeric variables: use "." (Point)

v3 = "test ".v2." test";

There are two types of functions:

  • Void function or function that does not return a value

Example: 'Plot' function plots a time-series on a chart.

  • Functions that returns a numeric or a string array

Example: 'Rsi' (Relative strength index indicator) returns a numeric array.

3. Edit a formula

Click on 'New Chart' in the 'View' menu to open a new chart.
Right click on the chart and click on 'Edit Formula'; the formula editor will open.

4. Add functions

There are two ways to add a function:

  • You can add a function by typing it in the formula editor.
  • You can add a function by clicking on the 'Add Method' or 'Add Indicator' buttons; the 'Function selector' form will appear.

5. Function Selection

6. Functions to plot time-series

Here is the list of the functions that let you plot data:

  • Plot: plots a vector; you can specify the color, the graph type...
  • Plot1: plots two vectors, example: higher and lower Bollinger bands.
  • PlotCandleStick: plots an OHLC chart
  • PlotFixed: plots a fixed chart, example: average performance per day of the week or volatility for the next ten days per Relative Strength Index values
  • PlotSymbol: plots symbols above or below other graphs.
  • SetMaxScale: sets the Y-Axis maximum value.
  • SetMinScale: sets the Y-Axis minimum value.
  • SetScale: sets the Y-Axis maximum and minimum value.
  • UpdateColor: updates a graph color, on certain X-Axis values.

7. Update formulas dynamically

Move the mouse over a graph then right click, a small form will appear.
Tabs shown on that form refers to functions available in your formula.

If for example your formula is:
r = rsi
(14);
Plot(r, "RSI", colorRed, ChartLine, StyleOwnScale);

Two tabs will be available (Rsi and Plot).
Under Rsi tab there is a cell whose name is 'timePeriod'; this cell has a value of "14".

Click on that value, and update it using the numeric text box or the track bar.
See how the graph updates dynamically while you change this value.

Click on the green button to make the form stick.

8. AutoComplete tool

In the 'Formula Editor', press on CTRL+SPACE, a list of 'Void' functions appears.

Now type something like 'a = ', then press on CTRL+SPACE, another list appears; this list contains all 'Return' functions.

There is also an 'AutoComplete' button on the 'Formula Editor'; click on that button, then type in something in the editor, the 'AutoComplete' list now appears each time you type in a letter.

9. Tooltip information

Tooltip shows you information about functions.
There are two kinds of Tooltip; one that appear right after you type in '(', example: 'Plot ('.
The other Tooltip appear when you move the mouse over a function.

10. Debugger

The debugger displays the elements of the variables initialized within the formula.
In the 'Formula Editor', right click on the editor.

You can export debug data by right clicking on the table then selecting "Export Data".
You will be promoted to enter the file name to save the table content in a CSV format.

11. Formula errors

When typing a formula, an icon located at the top shows you whether your formula syntax is correct or not, clicking on that icon shows you the formula errors if any.
The icon is red when there is an error otherwise it is blue.

The location of the error is underlined with a dotted line.

Click on "X" icon next to "Add Indicator" button to display the error message.


Composite Function

1. Introduction

"Comp" is a very powerful function that lets you create indicators and rules based on aggregate data of several securities (quotes, technical indicators, fundamental data...).
With a single line, you can for example instruct QuantShare to create a trading system that buys stocks when the difference between their close price and moving average is two times higher than the standard deviation of the same formula for all US stocks.

For the difference between the composite function and the composite plug-in, please look at:
http://www.quantshare.com/sa-136-create-a-stock-index-or-a-trading-indicator-using-the-composite-tools

2. Functions Parameters

The composite function name is "Comp" and it has several parameters:
Array: This is the array or time-series that will be used when calculating the composite
Calculation Method: The calculation method to use. Example: "Avg" computes for each trading bar the average value of the same bar (date/time) for all symbols included in the composite calculation.
Group: Performs a separate calculation for each group. Example, by passing "Industry()" to this parameter, the calculation will be performed independently for each industry.
Filter: Allows you to ignore securities during the calculation. Example: "close > 2" instructs the composite function to include only stocks that have a price higher than $2.
Symbols Filter: Allows you to define a list of symbols to include in the composite calculation. By default, all symbols in an analysis are included. For example, if you are backtesting NASDAQ stocks, then when calling "comp" function, only NASDAQ stocks will be used.
In this field, you can specify a symbols filter name (Symbol -> Symbols View) or a list of symbols separated by semi-colons (GOOG;MSFT;C;AAPL).

3. Calculation Methods

Count: For each trading bar, calculates the number of securities.
Sum: For each trading bar, calculates the sum of the different values.
Avg: For each trading bar, calculates the average of the different values.
Max: For each trading bar, gets the maximum value.
Min: For each trading bar, gets the minimum value.
Sdv: For each trading bar, calculates the standard deviation of the different values.
Rank: For each trading bar, returns the rank of each stock.
Percentile: For each trading bar, returns the percentile rank of each stock.
!Rank: For each trading bar, returns the rank of each stock. Securities that have the same value get the same rank. For more information, please read the following article: http://www.quantshare.com/sa-179-new-ranking-and-percentile-composite-functions
!Percentile: For each trading bar, returns the percentile rank of each stock. Securities that have the same value get the same percentile rank.

Examples:

Comp(1, "count")
This creates a market indicator that calculates the number of stocks that have quotes for each bar.

Comp(close > sma(30), "sum")
Here is a market indicator that calculates the number of stocks that closed above their 30-bar simple moving average.

Comp(rsi(14), "avg")
This trading indicator calculates the average RSI or relative strength index value of all stocks or securities included in the analysis. You can then compare this composite to the oversold or overbought threshold levels and determine whether the market is bullish or bearish based on the relative strength index interpretation.

Comp(GetData("fund", "mkcap") * close, "avg")
Here is how to create a capitalization-weighted market index. Take the time-series that corresponds to the market capitalization data of your stock and then multiply that value by the close price. By applying the composite's average method to this formula, you can produce your custom capitalization-weighted index.

Comp(perf(close, 1), "Max")
A trading indicator that calculates the maximum stock increase from previous close, among all stocks in your list of symbols.

Comp(perf(close, 1), "Sdv")
This trading indicator calculates the standard deviation of the different one-bar stock's returns that occurred on the same date. This is a measure of volatility; the market indicator will show you how the volatility of the one-bar stock's returns evolves over time.

Comp(perf(close, 1), "Rank") <= 5
The above trading rule returns the top 5 stocks that have the highest one-bar rate of return.

Comp(volume, "Percentile") >= 90
This volume-based trading rule gets stocks that are in the top 10% of stocks with the highest volume value. Unlike the above Rank function which returns only 5 stocks, the current one returns 10% (100 - 90) of stocks included in the analysis. If you have included 5000 stocks in your trading system then this volume rule will return 500 stocks.

For more information, please read the following articles:
http://www.quantshare.com/sa-140-how-to-create-market-indicators-using-the-composite-function-part-1
http://www.quantshare.com/sa-144-how-to-create-market-indicators-using-the-composite-function-part-2
http://www.quantshare.com/sa-160-how-to-create-market-indicators-using-the-composite-function-part-3
http://www.quantshare.com/sa-175-trading-indicators-using-the-rank-and-percentile-functions
http://www.quantshare.com/sa-179-new-ranking-and-percentile-composite-functions

4. Limitations

The sole problem with the composite function is that it doesn't work with some plug-ins and tools.
You cannot use the composite function with the following tools:

Charts: You cannot calculate and plot a composite, created with this function, on a chart. For this, you can use the composite plug-in.
Watchlist: You cannot use the composite function when creating a dynamic watchlist. Use the Screener tool instead.


Advanced Rules

1. Searchfor

Used to detect any complex pattern
Used to create advanced trading rules

Let you create unrestrictive rules

Syntax:

Searchfor syntax1 then syntax1 for (rule) set (special_rule)

syntax1: special_rule after period within period all

special_rule: Special rule (Supports QuantShare functions + special functions)
rule: Normal rule (Any rule that could be created using the QuantShare language)

Explanation: this function looks for successive events.
Example: search for a stock that rises 20 percent within 30 bars, then drops by 10 percent for the next 10 – 20 bars.

After (optional): specify that special_rule will be checked only after the number of bars specified after the keyword after

Within (optional): specify that special_rule must be TRUE in at least one of the bars starting from ‘current bar’ + ‘after value’ to ‘current bar’ + ‘after value’ + ‘within value‘

All (optional): specify that special_rule must be TRUE for all the bars starting from ‘current bar’ + ‘after value’ to ‘current bar’ + ‘after value’ + ‘within value’

For (optional): calculates the pattern only when the rule provided in (for) keyword is TRUE

Set (optional): The Searchfor function returns 1 on bars where the pattern is found, if we specify a formula in (set) keyword, the Searchfor function will returns the result of this function instead of 1

Special functions (that could be used in special_rule):

· _perf (Array): Gets the percent of change from the specified array, from the bar where the previous condition occurred to the current bar.

· _perf(Array, lag, length): Gets the percent of change from the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _change (Array): Gets the raw change from the specified array, from the bar where the previous condition occurred to the current bar.

· _change (Array, lag, length): Gets the raw change from the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _avg (Array): Gets the average value of the specified array, from the bar where the previous condition occurred to the current bar.

· _avg(Array, lag, length): Gets the average value of the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _min (Array): Gets the minimum value of the specified array, from the bar where the previous condition occurred to the current bar.

· _min (Array, lag, length): Gets the minimum value of the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _max (Array): Gets the maximum value of the specified array, from the bar where the previous condition occurred to the current bar.

· _max(Array, lag, length): Gets the maximum value of the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _sd (Array): Gets the standard deviation value of the specified array, from the bar where the previous condition occurred to the current bar.

· _sd (Array, lag, length): Gets the standard deviation value of the specified array, from "the current bar minus lag minus length" to "the current bar minus lag".

· _ref (Array , index_lag): Gets a value from the specified array on the bar where the condition "last condition index minus the specified index_lag" occurred.

Index equals to 0 means get a value from the specified array on the bar where the last condition occurred.

Index equals to 1 means get a value from the specified array on the bar where the next to last condition occurred.

FRef (Array): same as the last function but uses zero as "index_lag"

· _dis(index_lag): Gets the distance (in bars) between the current bar and the bar where condition "last condition index minus the specified index_lag" occurred.

Index equals to 0 means get the number of bars between the current bar and the bar where the last condition occurred.

· _iff (condition, if_true, if_false): Evaluates and returns the result of the if_true formula if the condition is TRUE, otherwise evaluates and returns the result of theif_false formula.

· _slope (Array): Gets the slope of the line that starts at the array value for the bar where the previous condition occurred to the array value of the current bar.

· _slope (Array, lag, length): Gets the slope of the line that starts at the array value for "the current bar minus lag minus length" to the array value of "the current bar minus lag".

· _aboveline (Array1, Array2): Returns TRUE if all the elements of the Array2 between the bar where the previous condition occurred to the current bar are ABOVE the line that starts at the Array1 value for the bar where the previous condition occurred to the Array1 value of the current bar.

· _aboveline (Array1, Array2, lag, length): Returns TRUE if all the elements of the Array2 between"the current bar minus lag minus length" and "the current bar minus lag" are ABOVE the line that starts at the Array1 value for "the current bar minus lag minus length" to the Array1 value of "the current bar minus lag".

· _belowline (Array1, Array2): Returns TRUE if all the elements of the Array2 between the bar where the previous condition occurred to the current bar are BELOW the line that starts at the Array1 value for the bar where the previous condition occurred to the Array1 value of the current bar.

· _belowline (Array1, Array2, lag, length): Returns TRUE if all the elements of the Array2 between"the current bar minus lag minus length" and "the current bar minus lag" are BELOW the line that starts at the Array1 value for "the current bar minus lag minus length" to the Array1 value of "the current bar minus lag".

Notes:
Special functions start with "_"

_change(close) is equivalent to _change(close, 0, _dis(0))

Example:

Let us say we want to look for stocks that have the following pattern:

· Positive performance of at least 20 percent in the last 30 bars

· Then a negative performance of at least -10 percent in a period between 10 and 50 bars, during this period the stock close price must be lower than the price at which the last condition occurred

· Then a positive performance of at least 20 percent within the next 30 bars

Here is the formula that describes this pattern:

rule = Searchfor perf(close, 30) > 20

then

_perf(close) < -10 && _max(close) <= _ref(close)

after 10 within 50

then

_perf(close) > 20

within 30;

Explanation:

· Positive performance of at least 20 percent in the last 30 bars. "Perf" is a vector-based function, while "_perf" is a special function.

perf(close, 30) > 20

· Then a negative performance of at least -10 percent in a period between 10 and 50 bars, the _perf functions doesn’t need a period parameter as perf do, because it will use the (current bar - last condition bar) as the period parameter

_perf(close) < -10

during this period, the stock close price must be lower than the price at which the last condition occurred.
Note the difference between close and _ref(close). Close references the close price for the current bar, while _ref(close) references the close price of the last condition bar. _ref(close, 1) references the close price of the next to last condition bar if it exists (otherwise it takes the last condition bar). Now, we only have one condition (perf(close, 30) > 20), because the current condition is not evaluated yet.

_max(close) <= _ref(close)

· Then a positive performance of at least 20 percent within the next 30 bars.

_perf(close) > 20 within 30

The first and the second panes contain the same ‘Searchfor’ formula.
They do not look the same because if a ‘Searchfor’ rule is plotted on a pane where a candlestick chart is available then the signal and conditions will be shown as triangles marks.

2. Output

Used to simulate outputs

References future bars

Could be used to create custom outputs when analyzing trading rules or when creating prediction models

Syntax:

Set syntax1 where syntax1 then syntax1 for (rule)

syntax1: special_rule after period within period all

special_rule: Special rule (Supports QuantShare functions + special functions) (look at Searchfor paragraph)
rule: Normal rule (Any rule that could be created using the QuantShare language)
(then syntax1) is optional.

Special rules are the same as in Searchfor.

Example:
Select ‘Analysis’ in menu, then click on ‘Rules Manager’.
Select or create some rules then click on ‘Analyze’.
Select ‘Outputs’ on the left panel, and then click on ‘Select Outputs’ on the right panel.
On the new ‘Output’ form, select ‘Custom output’ in the list, and then click on ‘Add’.
On the right panel, select the newly created output and then click on ‘Edit’.
Click on ‘click here to select an example’ and choose ‘… hedging with an option put’

This formula simulate an entry with a simultaneous buy of an option put.
In the Where input, _dis(0) >= 60, means that we evaluate the output with the condition that the number of bars equals to 60, in other words we exit after 60 bars.
In the Set input, we used a conditional statement to simulator the hedging strategy.
If the instrument return is higher than -20 percent then we want to set the return minus the cost of the option (2 percent) as output.
If the instrument return is lower than -20 percent then the output will be -20 percent (the maximum we can lose).
The _perf(close) calculates the performance of the instrument from the current bar to the bar where the last condition occurred, and in this example the last condition is _dis(0) >= 60, so we get the return of the next 60 bars.

This example is just a simulation of a hedge strategy and assumes:

The option expires in 60 bars
The option costs is 2 percent of the instrument price
The option strike is at -20 percent of the current instrument price

(If the price is 100$, the strike is at 80$, and the option price is 2$)

3. Controls

Right click on a pane, and then select ‘Edit formula’

Type CONTROL+SPACE, then select ‘SEARCHFOR...THEN’ or ‘SET...WHERE...’ to have a form appears.

You can type your rules directly in the inputs provided, or you can check the example provided.
Click on ‘Disabled’ and select an item to enable inputs.
When done, click on ‘OK’, your formula should appear in the formula editor.

4. Additional keywords

NoJump: This keyword tells the application not to jump after a pattern is discovered.
The default behavior (for speed purposes) is to jump to the bar where a pattern is discoverd, and to continue the search beginning from that bar.
Example: Starting from bar 5, the "searchfor" function discovered a pattern at bar 50.
The next search will begin at bar 51. However, if "nojump" were specified then the search would start at bar 6.
What you need to know is that using "nojump" keyword enables the application to discover more patterns. However, the drawback is that the function will be much slower.
The "NoJump" keyword works only with "Searchfor". The "Set" advanced rule uses the "nojump" automatically. This is because this function must return a value for each bar.

Example of usage: (nojump must be placed just after the SEARCHFOR keyword)
var1 = SEARCHFOR nojump gapup() THEN _perf(close) > 20 after 10 within 100;

Depth: This function tells the application to perform deep analysis of a particular condition. This will sometimes lead to the discovery of more patterns. By default, the application applies a depth of one.

Example:
var1 = SEARCHFOR gapup() THEN close > ref(close, 1) after 10 within 100 depth(5) THEN gapup() depth(10);


Profile Graphs

1. Introduction

The "PlotProfile" function of the QuantShare programming language allows you to plot profile graphs.

Here are some examples of what you can plot:

- Volume by price graph
- 1 day volume profiles on weekly chart
- 1 day volume profiles on intraday chart
- RSI by price graph
- 1 minute SMA profiles on daily chart

2. Function Parameters

Formula: Defines the profile formula

For a profile based on volume, simply type: "volume"

For a profile based on 25-bar simple moving average, type: "sma(25)"

New Profile Condition: Specify when to create a new profile

To display only one profile for all bars, type: 0

To display one profile for each trading bar, type: 1

In daily chart, to display one profile per week, type: week() != ref(week(), 1)

Time frame: Specify the time frame used to calculate "Formula"

Number of buckets: The number of buckets for each profile

Back Color: The back color of profiles

Font/Border Color: The font and border color of profiles

Style: Define one or several styles. To define several styles, separate them by '|'

Here are the available styles:

OperationAvg: calculate the average of the "Formula" values the belong to each bucket

OperationMax: calculate the maximum of the "Formula" values the belong to each bucket

OperationMin: calculate the minimum of the "Formula" values the belong to each bucket

OperationRank: calculate the rank of the "Formula" values the belong to each bucket

OperationSum: calculate the sum of the "Formula" values the belong to each bucket

ShowBorder: Display profile borders

ShowValues: Show the value of each profile bar

UseRthOnly: Uses data from regular trading hours only (intraday)

Note: If you have an EOD chart and you want to use intraday data in your profile graph, simply use a negative value as "Time frame".

For EOD data, time frame is expressed in days

For Intraday data, time frame is expressed in seconds

3. Implementation

Right click on a chart, select "Edit Formula". After you change the formula, click on "Update Graph" button to update the chart.

- Volume by price graph (daily chart)

PlotProfile("volume", 0, 1, 100, colorRed, colorRed, OperationSum);

- 1 day volume profiles on weekly chart (weekly chart)

PlotProfile("volume", 1, 1, 5, colorRed, colorRed, OperationSum);

- 1 day volume profiles on intraday chart (one-minute chart)

PlotProfile("volume", day() != ref(day(), 1), 60, 20, colorRed, colorRed, OperationSum);

- RSI by price graph (daily chart)

PlotProfile("rsi(14)", 0, 1, 100, colorBlue, colorBlue, OperationAvg);

- 1 minute SMA profiles on daily chart (daily chart)

PlotProfile("sma(25)", 1, -60, 10, colorBlue, colorBlue, OperationAvg);

You can change the opacity of a color by changing for example: colorBlue to colorBlue|200 (Here, "250" defines the opacity - max value is 255)


Auto Support/Resistance

1. Introduction

QuantShare can detect supports and resistances automatically and programmatically.

In QuantShare programming language, you have access to the "AutoSR" function.

This function returns the support or the resistance/support level based on the last bar (Last bar mode) or on each trading bar (backtest mode).

2. Last Bar Mode

Function parameters:
SR: Type "0" for support or "1" for resistance
Lag and Length: Are used to define which trading bars are used to calculate the support or resistance lines.

Example:
Lag 0 and Lenght: 10 => Calculation based on the last 10 bars
Lag 2 and Length: 15 => Calculation uses bars starting at (current bar - 17) and ending 2 bars ago

Formula Example:

a = AutoSR(0, 0, 10);

3. Backtest Mode

In backtest mode, the automatic support/resistance calculation is performed on each trading bar (instead of the last bar only).

To enable backtest mode, you have to update the first parameter. Set "2" to calculate supports and "3" to calculate resistances.

You can plot the following variables on a chart to see the difference:

a = AutoSR(0, 0, 10);
b = AutoSR(2, 0, 10);

plot(a, "Normal", colorRed, ChartLine, StyleNoScale);
plot(b, "Backtest Mode", colorGreen);

More information about the "AutoSR" function can be found in the following blog posts:
Detect chart patterns using the auto support/resistance indicator
Backtesting chart patterns using the auto support and resistance indicator


Real-Time Features

Realtime Feature

1. Connect to a data provider

- Select "Accounts -> Connect"
- Choose your data provider (Example: IQFeed)

In the "Data Provider Settings", you can update settings such as login, password, backfill, base time frame, maximum symbols...
For more information please check "Update Data Provider Settings" section.

A data provider could be a broker (Interactive Brokers, MBTrading...) or a company that provides real time data (IQFeed, BarChart, Teletrader...).

2. Disconnect a data provider

- Select "Accounts -> Disconnect"
- Choose your data provider (Example: IQFeed)

3. Update Data Provider Settings

At the bottom of QuantShare main window, are listed the active data feeds.

Click on ".. Data Feed(s)" to open a new table.

Here are the different fields of this table:
Status: Green if the data feed is connected, Red if it is not
Data Feed: The data feed name
Enabled: Choose whether to enable or disable a data feed
Connected: Tells you whether the data feed is connected or not
Last Message: The last log message sent by the data provider
Log: Click on this button to display log messages sent by the data provider
Settings: Click on this button to update the data provider settings

4. Open a real-time chart

- Select “View -> New Chart”

- Right click on the chart then select “Switch to Intraday” (if you are using a daily chart)

- Right click on the chart again, select "Data Source" then choose your data source.
- To disable real-time for that chart, select "No Data Source"

5. Backfill

Right click on the chart then select "Backfill"
Note that the "Backfill" appears in the menu only if the data feed provides backfill capabilities.

6. Time & Sales

In real time charts, there is an icon (circle) on the bottom/right corner.

The circle is Green when the chart is steaming data.

- Click on that circle
- Select "Trading Tools"
- Select "Time & Sales"

7. Market Depth - Level 2

In real time charts, there is an icon (circle) on the bottom/right corner.

The circle is Green when the chart is steaming data.

- Click on that circle
- Select "Trading Tools"
- Select "Market Depth"

8. Real time Settings

Select "Accounts -> Real-time Settings"

Streaming:
Maximum number of bars to load: Select the maximum number of bars to load when opening a real-time chart

Charts:

Backfill when a new symbol is selected: When this option is selected, a backfill is automatically performed each time you select a new security in a chart

Analysis:

Backfill when analyzing securities: Backfill securities before performing analysis (watchlist, portfolio...)

Save data when closing a real time stream: Save real time data when the analysis ends (watchlist, portfolio...)

9. Real time Monitor

Select "Accounts" then "Real time Monitor"

To select the default data feed, select a feed next to "Default DataFeed".

The "Data Feeds" tab, displays for each provider, the current active symbols (streaming), time frames and number of listeners (Example: Chart, Watchlist, Alert...)


DDE Connections

1. What is DDE?

DDE stands for Dynamic Data Exchange. It is a technology for interprocess communication under Microsoft Windows or OS/2.

Several brokers and data providers allow exporting real time data through DDE.
QuantShare can connect to any data provider who supports the DDE technology.

2. Create a New DDE Connection

- Select "Accounts -> Connection -> Add Connection"
- Type a name and short name for your connection. Example: MyBroker and MB
- Get DDE settings from your data provider and fill the "DDE Server" and "DDE Field Definitions" fields
- Click on "OK" to save your connection

Example settings for the Bloomberg DDE connection:

Name: BLP
Short Name: BLP
DDE Server: BLP

Last: M!'{Symbol},[LAST_PRICE]'
Last Size: M!'{Symbol},[SIZE_LAST_PRICE]'
Ask: M!'{Symbol},[ASK]'
Ask Size: M!'{Symbol},[ASK_SIZE]'
Bid: M!'{Symbol},[BID]'
Bid Size: M!'{Symbol},[BID_SIZE]'
Time: M!'{Symbol},[TIME]'

Note: If you have problems with DDE settings, you can always use Excel for debugging.

3. Connect to a data provider using DDE

To open a DDE connection:
- Select "Accounts -> Connect"
- Select one of your DDE connections (You can easily recognize it because its name always starts with "DDE_")
- Click on "Close"

4. Remove a DDE connection

- Select "Accounts -> Connection -> Remove Connection"
- Select your DDE connection then click on "Remove"


Real-time Grids

1. Introduction

The real-time grid is a tool that allows you to create excel-like sheets. The main advantage of this tool is that it makes referencing real-time and historical data very easy and also allows you to create QuantShare based scripts to manage/update the sheet. Note that this tool is very powerful and can be used to create any sort of grid/table.

2. How to create a new grid

- In QuantShare, select “Tools -> Grid -> Grid Editor”

This will automatically create a new grid.

To create another new grid, save current grid and close it, use the “File” menu at the top.

3. How to use the grid tool

As we said, this tool creates grids like Excel sheets. You can select any cell and update its content by typing a value or a formula.

You can right click on any cell to update its settings or use the toolbar menus at the top to update selected cell’s settings

4. How to reference a formula in a cell

To reference a formula in a cell, start by typing “=”. You can display the list of available functions, click on “Fx” button that is located above sheets.

Examples:

- Reference historical daily data (last close price)

=GetCloseHisto("GOOG", 1)

- Reference one-minute intraday data (close price before the last one)

=GetClose("GOOG", 60)[1]

If real-time data for GOOG is available then this field will be updated as soon as QuantShare gets new ticks for it. To define a data feed for one or several cells, right click on the cell(s), select “DataFeed” then choose your data feed.

If you have two or more data feeds, you can easily show side by side the real-time last price of a particular security for each data feed.

- Reference current time:

=Hour+":"+Minutes+":"+Seconds

- Reference current bid price for a security (updated in real time)

=GetBid("GOOG", 0)

- Reference the last custom database field:

=GetDataH("Fund", "Basic Eps - Total", "C")[0]

- Reference market depth data: (second best ask price)

=GetL2("GOOG", 1, "ask_price")

Of course, every value in the formula can be updated by a cell reference. For example, you can set “GOOG” in the cell “A1”, and “1” in cell “A2” then type the following formula in cell “A3”:

=GetCloseHisto(A1, A2)

Each time, you update the value of cell “A1” or “A2”, the value of “A3” is automatically updated.

5. How to copy a cell

You can copy one or several cells (select multiple cells using the mouse or by clicking on cells while pressing on CONTROL), using the “Edit” menu or by using CONTROL+C shortcut. To paste cells, use the CONTROL+V shortcut.

Note that if one of your formulas references a cell then the cell value will be updated as well during the copy/paste.

Example:

Cell A1: =A2 (it references cell A2)

If you copy cell A1 to B1 then the new formula of B1 will become B2

Like excel, you can instruct QuantShare to not update cell references by adding “$” sign.

Cell A: = $A$2

When copying A1 to B1, the formula of B1 will stay the same: $A$2

The “$” sign can be added to horizontal (1,2,3,4...) or vertical (A,B,C,D...) indices or both.

6. How to create a QuantShare formula

In the toolbar, click on “Formulas” then click on “Add Formula”.

The cell will display the last value of the time-series associated with the “cell” variable.

Example:

cell = rsi(14);

This will display the 14-bar relative strength index.

To display the RSI, update the formula name (set RSIF as name for example), select “Historical” next to “Data Used” then click on “Compile”.

Now, click on any cell in the grid then type:

=Formula.RSIF("GOOG", 1)

Each time you create a QuantShare formula, two parameters are automatically added (Symbol name and time frame)

7. How to create a button

You can replace the default cell by a button, a listbox or a checkbox. To do so, right click on a cell then select “Cell Type”. Choose “Button” for example then click on “OK”.

You can update the button text by updating the field next to “Fx”.

Right click on the button then select “Button Cell Function”

To create a function that is executed each time the button is clicked, click on “Create Function”.
Type your script then click on “Compile”.

The script contains several default classes you can use. These classes are the same as the ones available in the “Global Script”. You can for example, get active charts, update charts, get watchlists, parse formulas...

There are also two important variables you can use:

cell: This variable allows you to update the value of the current cell (In this case, it is the button cell)

Example:

cell.Value = “My Button”;

cells: This variable allows you to update any cell’s value, to get cell’s content, add/remove cells...

Example: (Get the number of open charts in cell A1)

Cell a1 = cells.GetCell(1, 1);

a1.Value = "Open Charts: " + Charts.NbCharts;

Note that scripts are not necessary linked to buttons, listboxes and checkboxes.
You can create a new script by clicking on “Formulas” button (Toolbar) then on “Add Script Formula”.

You can reference the script on any cell by typing (format):

Script.[Function Name]([Parameters]);

If the script name is “MyScript” then type:

Script.MyScript()

8. Create a form from a grid

- Save your grid (File -> Save)

- In QuantShare, select “Tools -> Grid -> Open Grid”

- Select the grid you want to display then click on “Load Selected Item”

Here is how to update the form’s settings:

- In the grid editor, open your grid then select “View -> Show Output”

- Select the backcolor

- Define whether to stretch rows and columns on resizing the form

- Select whether it is permitted to add and remove rows

- You can also define the original number of rows and columns by clicking on “Set Grid Size” button in the toolbar

Note that in a form not all cells are editable by default. If you want to make a cell editable (A cell where you can type a symbol name for example), you should right click on the cell, select “Editable Cell” then “Yes”

9. How to update cells based on specific conditions

Example of what you can create using this tool:

- Real-time matrix correlation

- Real-time news feed


Plug-ins

A Plug-in is a program that interacts with the main program and brings him more functionality.

This is the list of the currently available plug-ins:

  • Indicators
  • Custom Functions
  • Custom Drawing Tools
  • Composite
  • Watch List
  • Script Manager
  • Widget Panel
  • Sharing Server
  • Notes
  • Divers
  • Downloader
  • ASCII Importer
  • Data Viewer
  • Rules Manager
  • Ranking System Manager
  • Simulator
  • Monte Carlo Simulation
  • Advanced Money Management
  • Screener
  • Pivot Tables
  • Portfolio
  • Optimizer
  • Artificial Intelligence
  • Portfolio123


Indicators

Formulas

1. Introduction

Formulas are created using the QuantShare vector-based language. A formula can contain one or several indicators, it can also contain functions such as plot, plotsymbol...

More than 100 formulas are available:

  • Relative Strength Index
  • Aroon Oscillator
  • Bollinger Bands
  • Average True Range
  • Absolute Price Oscillator
  • On Balance Volume
  • ...

Example: Relative Strength Index

indicator = Rsi(14);
Plot(indicator,"Relative Strength Index",colorBlue,chartline,STYLESYMBOLNONE);

The above formula creates a variable 'indicator' and assign it the Relative Strength Index time-series.
The second line plots the 'indicator' variable (which is equal to the relative strength index).

2. Open the formulas/indicator form

Click on 'Formulas/Indicators' in the 'View' menu.
Select a category, and then select an indicator.
Right click on that indicator and a menu will show up.
On that menu, you can edit the indicator files, rename them, create new ones and set the action to take when you double click on them.

3. Drag & Drop formulas

In the formulas form, click on an formula then drag & drop it to a chart.
You can also drag any pane formula and drop it into another pane.

4. Add a formula to a chart

Besides adding indicators by updating the chart formula, you can add indicators using the indicator form by either double clicking on an indicator or drag & drop the indicator to a chart.
You can also right click on a chart, select 'Indicators' then click on 'Add study'.

5. Create a new formula

Rigth click on the 'Formulas' table then click on 'New Formula'.


Custom functions

1. Introduction

This plug-in lets you create custom function that you can use in your formulas.
Functions are created using CSharp or JScript.Net languages.

Let us say you created a function which have two numeric parameters and whose name is 'MyFunction'.
To use this function, open the formula editor (Right click on a chart, then click on 'Edit formula'), type for example 'a = ', then click on CTRL+SPACE; in the list box you will find your function 'MyFunction'.

2. Create a new function

Open the 'Create functions' form by clicking on 'Create functions' in the 'Tools' menu.

In the 'Create functions' form, click on 'Add', type a name then save.

Select the function, you have just created, in the 'Functions' panel, then move to the 'Script' panel.

Press on 'CTRL+SPACE' to see the initialized variables.

The application creates a variable for each parameter.
'result' is the variable that your function will return to the application
'result' is of type 'VectorD' if your function returns a numeric time-series or 'VectorS' if your function return a string time-series

Example: to create a function that returns an array containing the value '2'.

Type this code in your script panel:

for(int i=0;i<result.Length;i++)
{
    result.SetValue(i, 2);
}

You can add parameters to your function, by clicking on 'Add a parameter'.
You can update the parameters name, type, default value and description.
After adding a parameter, press on CTRL+SPACE to see the new variable in the list.

Example: to create a function that adds one to the provided parameter (var1) and returns the new array.

double val =
0;
for(int i=0;i<result.Length;i++)
{
val = var1.GetValue(i);
result.SetValue(i,
val + 1);
}

When done, click on Save.

3. Update a function

Clicking on 'Save' button will compile the function and updates it.

4. Remove a function

Select a function, click on 'Remove' then confirm.

5. Functions

The 'cFunctions' class contains the symbol name, close, open, high, low, volume, open interest and date vectors of the symbol that is used when executing a formula.
Example: To get the close vector, type:
VectorD close = cFunctions.Close;

Create an empty vector
To create an empty numeric vector, type:
VectorD vectorNumeric = cFunctions.CreateNumericVector();

To create an empty text vector, type:
VectorS vectorText = cFunctions.CreateTextVector();

This class also contains three important functions:

CompileFormula: This function compiles a QuantShare formula and returns a QSFormula class. This class can be used to extract vectors.

Example: cFunctions.CompileFormula("a = rsi(14);").GetVectorDouble("a");

GetCustomDatabaseData: This function loads custom database data for the current symbol or another one and returns a VectorCustom class.
The vectorCustom class is like the other vector classes with the difference that it can contain more than one element in a bar period.
If you execute a function on a daily timeframe and you reference an intraday database (news for example), then for a specific bar (date), you may have more than one news item.

SetForwardAndBackwardBars: This function let you define how many backward and forward bars your formula use.
Forward and Backward bars are used to optimize the execution of formulas.
As an example, the RSI or relative strength index function (rsi(14)), uses 14 backward bars and 0 forward bars. Because for each bar, it needs the previous 14 bars to perform its calculation and it does not require any future bar.

6. Vector Operations

Within the script/indicator editor, you can add, subtract, multiply, divide and compare vectors (VectorD class).

Example:

VectorD close = cFunctions.Close;
VectorD copen = cFunctions.Open;
VectorD sum = close + open;

The above formula creates the "sum" vector. Each element of the "sum" vector is constructed by adding the close price to the open price. The element of the vector "sum" at index 0 is equal to the close + open prices at the same index.

Example of other operations:

VectorD vect = cFunctions.Close - cFunctions.Open;
VectorD vect = cFunctions.Close / cFunctions.Open;
VectorD vect = cFunctions.Close * cFunctions.Open;
VectorD vect = cFunctions.Close > cFunctions.Open;
VectorD vect = cFunctions.Close < cFunctions.Open;
VectorD vect = cFunctions.Close >= cFunctions.Open;
....

Note: The "VectorS" class supports the operator (+). It can be used to concatenate strings.

7. Technical Analysis Object

"TA" object allows you to use the indicators that are available in the QuantShare vector-based language.

After you type "TA.", use CONTROL+SPACE to display the list of available functions.

The list contains several hundred indicators.

Example 1: (C#)

VectorD vect = TA.Rsi(cFunctions.Close, 14);

This will create the RSI indicator and assigns the time-series to the "vect" variable.
The equivalent of this line in QuantShare language:

vect = rsi(close, 14);

Example 2: (C#)

VectorD vect = cFunctions.Close - TA.Sma(20);

This will return the difference between the close price and its 20-bar simple moving average.
The equivalent of this line in QuantShare language:

vect = close - sma(20);

8. Charts Object

"Charts" object allows you to plot lines, bars and objects on a chart.

After you type "Chart.", use CONTROL+SPACE to display the list of available functions.

Example 1:

Chart.Plot(cFunctions.Close, "Close Price", Color.Red, ChartType.ChartLine, Style.StyleSymbolNone);

Plots the close price on the chart.

Example 2:

VectorD a = TA.Rsi(14);
Chart.Plot(a, "RSI");

Plots the 14-bar Relative Strength Index on the chart.

9. Parse a formula in a different time frame

You can parse a formula based on QuantShare language in a different time frame.

Let us say that you are executing the following function in a daily trading system. Here is how to calculate the number of times the price crosses above its moving average using one-minute period (You must have of course one-minute data in your database)

VectorCustomDouble a = cFunctions.CompileFormula("a = cross(close, sma(10));", 60, false).GetVectorDouble("a");
for(int i=0;i < a.Length;i++) // For each trading bar (daily) => Variable "a" is automatically synchronized with daily bars
{

for(int j=0;j < a[i].Length;j++)
// For each one-minute bar in the daily
bar number "i"
{
if(a[i][j] > 0)
{
result[i]++;
}
}

}

// You can also get the same result by typing
result = a.ToVectorD("sum");

10. Auto Support/Resistance

For an introduction to the "AutoSR" function, please go here.

By creating a C# custom indicator (Tools -> Create Functions) and using the "TA.AutoSR" function, you can build advanced indicators based on the auto support and resistance feature.

The "TA.AutoSR" function returns a "VectorCustomDouble" variable.

For each trading bar, you will have an array that contains three values.

Index 0: Support or resistance level (The value returned by "AutoSR" function of the QuantShare programming language)
Index 1: Returns the "slope" of the support or resistance line
Index 2: Returns the "intercept" of the support or resistance line

Note: The equivalent "AutoSR" function in QuantShare programming language provides only the resistance/support level.

Example:

VectorCustomDouble d = TA.AutoSR(2, 0, 20);
for(int i=0;i<result.Length;i++)
{
result[i] =
d[i][1];
}

// Calculates for each trading bar, the slope of the support line

The "TA.AutoSR" function can also be used to calculate support and resistance lines of other time series.
Note that by default (in case no time-series defined), the high/low price series are used.

Example:

VectorCustomDouble d = TA.AutoSR(2, 0, 20, TA.Rsi(14));
for(int
i=0;i<result.Length;i++)
{
result[i] = d[i][0];
}

// Calculates for each trading bar, the support level (based on the previous 20 bars) of the 14-bar relative strength indicator

11. Protect Your Code Source

Here is how to protect a function with a password:

- Click on "Manage" button at the top
- Check your function
- In the new control, click on "Tools" (Expand the top menu if necessary - Click on "+" button)
- Select "Encrypt Checked Items"
- Click "Yes"
- Enter your password then click "OK"

Your function is now protected. If you select it in the "Create Functions" form, a dialog box will prompt you to enter a password. If you do not enter the correct password then the function code will not be displayed.

Note that you can still use protected indicators in your charts, trading systems...


Custom Drawing Tools

This plug-in lets you create your own drawing tool. A drawing tool allows you to display objects, lines, texts in a chart (Example: Trend lines, Gann Square...)

1. Presentation

To open the custom drawing tool plug-in, select "Tools" in the main menu then click on "Custom Drawing Tools" (Extended menu)

In the main form, you have:
- Top Panel: Menu where you can add, remove and manage items
- Top-Left Panel: List of available drawing items
- Bottom-Left Panel: Description of the selected drawing item
- Top-Right: Code control. Here you should type the script (CSharp or JScript.Net) that is executed each time the mouse cursor moves within the bounds of the chart.
- Bottom-Right: Here you can manage the drawing item settings. You can for example add a color setting and then access this setting in your code so you can plot a line with the user specified color.

2. Create a Custom Drawing Tool

- Click on "Add"
- Type the custom drawing tool item name
- Click on "Save Item"

3. Remove a Custom Drawing Tool

- Select a custom drawing tool
- Click on "Remove"
- Click on "Yes"

4. Add a Custom Drawing Tool to the Bookmark Panel

You should add a custom drawing tool to the bookmark panel so you can select it and use it.

- Right click on the Bookmark Panel (Blue bar under the main menu - Just above Charts)
- Select "Add Shortcut"
- Select "Drawing Tool" and make sure "Create a shortcut for an existing item" is checked
- Click on "OK"
- Select a custom drawing tool then click on "Load Selected Item"
- In the bookmark panel, double click on the newly added item to activate it then move the mouse pointer to the chart.

5. Custom Drawing Tool Script

For more information please refer to the "QuantShare CSharp" topic or click on "Help" under the script control in the custom drawing tool form.

The script is executed when the custom drawing tool is selected and the mouse cursor moves within the bounds of the chart.

You can detect the current state of the drawing tool by checking the following variables:
- Functions.IsMoving: Specify whether the user is currently moving the item or not.
- Functions.CursorPosition: The current mouse position on the chart (X, Y and Date)
- Functions.ClickPositions: Array that contains positions of the clicked points (When user clicks on a chart and the item is selected)

Example 1:
- Displays the price above the mouse cursor (http://www.quantshare.com/item-449-close-price-above-cursor)

PointPosition pos = Functions.CursorPosition;
double[] close = Functions.ChartData.GetTimeSeries("close"); // Get the "Close" time-series
int barindex = (int)pos.X + Functions.ChartData.StartIndex - 1; // Get the current bar index (under the mouse cursor)
double closePrice = close[barindex]; // Get the close price
TextObj text1 = Functions.PaneObject.DrawText("", "Close: " + closePrice + "\n\n", pos.X, pos.Y); // Create a TextObj to be displayed on the chart
text1.FontSpec.Border.IsVisible = false; // Update object settings
text1.FontSpec.FontColor = Color.Blue;
text1.FontSpec.Fill.Color = Color.Transparent;
if(Functions.ClickPositions.Length > 0)
{
Functions.FinishDrawing(); // Complete the drawing process (No more points can be added to the ClickPositions array)
}

Example 2:
- Displays a trend line with the sum of volume (http://www.quantshare.com/item-989-volume-accumulation-trend-line)

if(Functions.ClickPositions.Length == 0) // No click on the chart -> Exit
{
return;
}

PointPosition point1 = Functions.ClickPositions[0]; // First click location
PointPosition point2 = Functions.CursorPosition; // Second click set Mouse cursor
if(Functions.ClickPositions.Length > 1) // There is a second click
{
point2 = Functions.ClickPositions[1]; // Second click associated with point2
 Functions.FinishDrawing(); // Finish drawing after the second click
}

// Draw line using point1 and point2 locations
LineObj line = Functions.PaneObject.DrawLine("Line1", point1.X, point1.Y, point2.X, point2.Y);

// If point1 Y value is higher than point2 Y value then set the line color to Red
if(point1.Y > point2.Y)
{
line.Line.Color = Color.Red;
}
else // Otherwise we set the line color to Green
{
line.Line.Color = Color.Green;
}

string text = "";
if((bool)Functions.GetSettings("Show Distance"))
{
text = Math.Abs(point2.X -
point1.X) + "
bar(s)";
}
if((bool)Functions.GetSettings("Show Sum of Volume"))
{
double[] volume1 = Functions.ChartData.GetTimeSeries("volume");
double volume =
0;
int start = Functions.ChartData.GetBarIndex(point1);
int end = Functions.ChartData.GetBarIndex(point2);
if(end > start)
{
for(int
i=start;i<=end;i++) volume += volume1[i];
}
else
{
for(int
i=end;i<=start;i++) volume += volume1[i];
}
if(text == "")
{
text = text + "Ac. Volume:
" + volume;
}
else
{
text = text + Environment.NewLine + "Ac. Volume: " + volume;
}
}

if(text != "")
{
TextObj text1 = Functions.PaneObject.DrawText("Text1", Environment.NewLine +
Environment.NewLine + text, point2.X,
point2.Y);
text1.FontSpec.Border.IsVisible = false;
text1.FontSpec.Fill.Color =
Color.Transparent;
}


Composite

1. Introduction

Create any kind of composite using this plug-in.

Examples of composites:

  • Percentage of stocks trading above their 50-day moving average
  • Number of advancing stocks within a sector
  • Price to book ratio of the entire US stock market
  • Percentage of stocks that have an overbought RSI

The composite plug-in automatically detect if there are new quotes and recalculate the composites if necessary.

2. Create a composite

Tools -> Composite

Click on 'Add' to open a new form.

Select the symbols you want to include in the composite calculation.
'Include composite tickers' check box is used to specify whether to include composite symbols or not.

N.B: If there are two composites which have this box checked, a calculation error will appears in the case where composite 'A' symbols include composite 'B' and composite 'B' symbols include composite A.

Type then the composite formula, choose the calculation function, the start and end periods, then the composite name, full name and description.
The new composite will be added to the 'Composite' form's grid and the calculation will start.

3. Update a composite

In the 'Composite form', select a composite item and then click on 'Update' button.

4. Remove a composite

In the 'Composite form', select a composite item and then click on 'Remove' button.

5. Re-Calculate a composite

In the 'Composite form', select a composite item and then click on 'Recalculate' button.
To recalculate all the composites, click on 'Recalculate all' button.

6. Composite Plug-in Settings

In the 'Composite' form, select the 'Settings' tab.
You can select whether the composite should be recalculated automatically on new data or not.

7. Composite Function

Difference between the composite function and the composite plug-in:
 http://www.quantshare.com/sa-136-create-a-stock-index-or-a-trading-indicator-using-the-composite-tools

8. How to use "Composite" class in the script editor

The "composite" class allows you to re-calculate a composite programmatically from the script editor.
This is very useful for example if you want to create a real time composites.

Example:

while(true)
{
Composite.Calculate("MyComposite");
App.Main.Sleep(1000);
}


Watch List

1. Introduction

This plug-in displays symbols that meet your criteria.

To open the watch list plug-in:

· Click on menu 'Tools'

· Click on item 'Watch List'

2. Create a simple watch list

A simple watch list is a watch list where you can specify simple criteria based on symbol information, example: symbol names, symbol industry...

To create a simple watch list:

· Click on 'Create' link in the 'Watch-list' form

· Click on 'Create a basic watchlist' then enter your conditions

· Click on 'OK'

3. Create a static watch list

A static watch list is a watch list that contains a list of symbols.

To create a static watch list:

· Click on 'Create' link in the 'Watch-list' form

· Click on 'Create a static watchlist' then type one symbol per line

· Click on 'OK'

If you want to create a static watch list from the active watch list, click on 'Create' link then 'Create from the current watchlist symbols'.

You can add a symbol to a static watchlist by dragging it from a chart then dropping it to the watchlist window. Drag and drop operation is performed using the right mouse button.

When the operation is completed, a menu will appear. You can then select to which static watchlist you want to add the dragged symbol (Chart symbol).

To remove a symbol from a static watchlist, perform the latter drag & drop operation while pressing on the [CONTROL] key.

4. Create a dynamic watch list

A dynamic watch list is a watch list where you can specify advanced criteria.
Dynamic watch-lists update its list of symbols dynamically on new data.

To create a dynamic watch list:

  • Click on 'Create' link in the 'Watch-list' form
  • Click on 'Create a dynamic watchlist'
  • In the new form, set the symbol filters
  • Click on 'Next'
  • Type your formula and make sure it is correct by clicking on 'Compile'
  • Click on 'Finish'

Note: If you want to create a real-time watchlist, make sure you select an intraday time frame next to "Select a time frame".
After that, check "Real-time - Data Source" and select a real-time data provider.
Check "Analyze on each incoming tick" if you want the watchlist formula to be analyzed on each tick (instead of each minute if for example you select a one minute time frame).

After clicking on "Finish", the watch list plug-in will display all the symbols and start the calculation process.

When the calculation process is done, symbols that fail to pass the criteria are removed.
The dynamic watch list will calculate the variable 'filter' for each symbol and if this variable is false or equal to zero then it will reject the symbol.

Example: Select overbought symbols (Relative strength index superior to 70)
filter = rsi(14) > 70;

More Settings:

Click on 'Show more settings' to display additional settings.

The 'Display symbols that pass the rules' option allows you to specify whether to account for the last bar/date only or for a specific number of past bars/days.

Example of a real-time watchlist:

filter = ask == bid;
AddColumn("Bid", bid);
AddColumn("BidSize", bidsize);
AddColumn("AskSize", asksize);
AddColumn("Ask", ask);

Show assets that have a bid price equal to the ask price. (Make sure you check "Analyze on each incoming tick")

5. Add columns to a dynamic watch list

You can add column to a dynamic watch list, the watch list grid will shows you these columns with their values for each symbol.
To add a column, use the function 'AddColumn' or select an already created columns set.

Example:
filter = rsi(14) > 70;
AddColumn("RSI", rsi(14));

This will create a column named 'RSI' that will contain the value returned by the formula rsi (14).

6. Update a watch list

Click on 'Select Watchlist', select the watch list you want to update then click on the button 'Update'.

7. Watch lists grid colors

The grid line color is white when data for the corresponding symbol is up to date. (The last quote date corresponds to the current date). The line color changes depending on the date difference between the last quote date and the current date.

8. Watch lists Settings

To update settings:

Rigth click on the watch list grid then select 'Settings'.

You can specify whether the watch list performs update automatically or not.

9. Switch between watch lists

To change the current watch list, click on 'Select Watchlist' link then double click on a watch list.

10. Value Column

The last grid's column contains Pre-Calculated values.
Right click on the grid then select 'Value'; choose the item you want to use for this column.

Example of use: Select the item 'Distance from support' to see the distance between the last symbol quote and the support you have drawn for this symbol (if any).

11. Associate a Layout to a Watchlist

By associating a layout to a watchlist, every time you select a security in this watchlist, the selected layout will be automatically applied to the active chart.

- Select your watchlist
- Right click on the watchlist table
- Select "Settings" then set the layout name in the "Chart layout to use when selecting a symbol" field

You can check available layouts by right clicking on a chart then selecting "Layout".

12. Open several watchlists at the same time
- Open the Watchlist manager (Tools -> Watchlist)
- Select a watchlist
- Right click on the watchlist table
- Click on "Create a new Watchlist Window"

Repeat the same process to open as many watchlists as you want.


Alerts Tool

The alerts tool allows you to create alerts based on specific conditions. Each time these conditions are met for a specific symbol, the alert is triggered and you will be notified by message, sound, email...

1. Create daily, weekly, intraday and real-time alerts

Select “Tools” then “Alerts Manager” to display the alerts control.

This control displays all your alerts.

Click on “Show” to select whether to display working alerts, triggered alerts, alerts with error and disabled alerts.

Working Alerts: Alerts that are currently active.

Triggered Alerts: Alerts that are triggered (not active anymore)

Alerts with Errors: Alerts that have errors (probably errors in the condition’s formula)

Disabled Alerts: Alerts that are currently disabled.

To create a new alert:

- Click on “New Alert”

- Type one or several symbols for which you want to apply the alert (symbols must be separated by a semi-colon)

If you want to apply the alert for several symbols, you can click on “Add Symbols” then specify one or several conditions for symbols selection.

- Next to “Select a time frame”, specify the period you want to use for this alert (Daily, Weekly, Hourly...)

You can define a real-time alert (Alert that will check real-time data for the specified symbols) by checking the “Real time - data source” option. After that, you can select the data provider to use.

- Check “Analyze on each incoming tick” to verify the alert each time a new tick is detected. Otherwise, the alert will be verified on each new bar (Example: Once a minute for a 1-minute time frame).

- In “Conditions” panel, click on “Add” to add a new condition and on “Remove” to remove the selected condition.
- Next to this control, specify the rule for the selected condition.

Example: Close > Open

or: (Value) rsi(14) > 90

Set “Value” if you want to define a custom indicator/formula.

- In the bottom panel, select “Notifications” then define how you want to be notified each time an alert is triggered.

Popup Message: Displays a popup message informing you that an alert was triggered.
Color: Font color of the message

Back color: Back color of the popup control

Duration: The number of seconds to keep the popup active
Custom Message: Define a custom message to display
Example: [SYMBOL] closes above $10

[SYMBOL] is a keyword that is replaced the symbol name of the security that is triggered.

Chart Message: Displays a message on the active chart

Color: Font color of the message

Duration: The number of seconds to keep the popup active
Custom Message: Define a custom message to display
Example: [SYMBOL] closes above $10

[SYMBOL] is a keyword that is replaced the symbol name of the security that is triggered.

Play Sound: Plays a sound each time an alert is triggered

File Path: Specify the location of the sound file to play

Speech: Text to speech

Volume: Defines a volume from 0 to 100
Custom Message: Define a custom message to speech
Example: [SYMBOL] closes above $10

[SYMBOL] is a keyword that is replaced the symbol name of the security that is triggered.

Send Email: Sends an email to a particular email address each time an alert is triggered

Profile: Specify a profile number to save your current email settings

SMTP Server: smtp.gmail.com (Gmail Example)

Port: 25 (Gmail Example)

Secure Connection: TRUE (Gmail Example)

Email: username@gmail.com (Gmail Example)

Username: username@gmail.com (Gmail Example)
Password: Specify your email password (Password is hidden and encrypted)
Custom Message: Define a custom message to speech
Example: [SYMBOL] closes above $10

[SYMBOL] is a keyword that is replaced the symbol name of the security that is triggered.

Execute Script: Executes a QuantShare script (Tools -> Script Editor) each time an alert is triggered

Script Path: Define the file location of the script to execute

At the bottom of this control, you can check “Disable” to disable the current alert.

Click on “Add Alert” or “Update Alert” to save settings.

2. Alerts Settings

Create a new alert or update an existing one by selecting it then clicking on “Update” in the “Alerts Manager” form.

Select “Settings” tab at the bottom panel.

Auto Reset: When checked, this field instructs QuantShare to reset the alert (Set it to working state again) in case it is in “Triggered” state and the conditions of the alert are no longer met.

3. Alerts Log

Create a new alert or update an existing one by selecting it then clicking on “Update” in the “Alerts Manager” form.

Select “Alert Log” tab at the bottom panel.

Specify the log message and color.

The log messages are displayed each time an alert is triggered. If the Auto Reset option is set then the alert messages can be displayed multiple times.

Example:
You can define the following alert message (Stock Overbought) with the following condition: rsi(14) > 80

“Stock Overbought” message will be displayed each time the RSI of a tracked security crosses the 80 threshold.

To open the log control, click on “Log” button in the “Alerts Manager” form.

At the bottom of the form, you have 2 settings:

Alert Menu: Specifies for which alerts to display the log messages

Color: Specifies the back color of the log messages.

NB:

- If an alert condition is met for two securities then 2 log messages will be displayed (one for each security)

- You can dock log control by moving them while pressing on ALT key.


Script Manager

1. Introduction

The script manager is a tool that let you write, update and manage your scripts.
Scripts are used to perform tasks and to control application behavior.
Scripts use CSharp or JScript.Net as programming languages.

2. Create a new Script

In 'Tools' menu, click on 'Script Editor'. Click then on 'File', then 'New'. Type a file name, and then click on 'OK'.
CTRL+SPACE shortcut shows you the available functions and variables.

Script Example:

Chart chart = Charts.GetSelectedChart();

for(int
i=0;i<1000;i++)
{
chart.ScrollBarIndex = i;
App.Main.Sleep(30); // Sleep 30
milliseconds
}

3. Open an existing script

To open an existing script in the 'Script Manager', click on 'File', then click on 'Open' and then select a file; a new tab will appears.

4. Execute a script

To compile and execute a script within the 'Script Manager', select the script you want to execute then click on 'Execute' in the menu bar


Widget Panel

1. Introduction

The widget panel is a container where you can add application object shortcuts or widgets. You can drag and drop objects like a pane formula, a trading system, a composite... to a widget panel.
You can also add widgets or .Net controls to the 'Widget Panel'.

2. Manage panels

You can create a docked widget panel or dashboard by selecting Tools -> Dashboard -> Docked Dashboard
You can create a floating dashboard by selecting Tools -> Dashboard -> New Dashboard

In the 'Widget Panel' form, click on 'Menu' then click on 'Add panel' to create a new panel.

To rename a panel, double click on its name as shown below, then type a new name.

3. Create a shortcut

Click on 'Menu' then select 'Create Shortcut'

Select an item type
Check the check box if you want to get a shortcut for an existing item, otherwise you will create a shortcut for a new item
Follow the instructions, then click on 'Finish'

A shortcut will appears on your panel

4. Add a widget

You can add a widget or .Net control.

Click on 'Menu' then select 'Add Widget'.
Select the control you would like to add then click on 'Finish'.

5. Drag & Drop

You can create a shortcut directly in your widget panel by dragging and dropping objects.

Example:
Create a chart then click on a time-series line or bar within that chart, drag & drop it to a widget panel, a shortcut will appears inside this panel.

6. Panel Menu

Right click on the panel to make the panel menu appears.

This menu contains the following options:

· Create new panel for the selected items

· Add shortcut

· Add widget

· Assign a new name for the selected items

· Arrange all the items

· Arrange the selected items

· Remove all the items

· Remove the selected items

· Select everything

· Select only shortcuts

· Select only widgets

7. Shortcut and Controls Menu

Click on the Red Cross to remove this item.
Click on the arrow icon to drag this object, you can drag it to another panel or to a chart pane if the shortcut you are selecting is a formula.
Edit a shortcut name by clicking on its name.
Resize a shortcut by clicking on the blue line.
Right click on shortcut to make a menu appears.

Example: the menu of a trading system shortcut


Sharing Server

1. Introduction

All the data used in the application except the databases, can be shared.
You can share and upload trading systems, list of rules, watch lists... and download others users items.
The sharing server is the place where you can search, comment, rate other users items.
The website we have developed is a combination of a sharing server and a social network.
You can communicate with others users, create and join groups, discuss about your favorite subjects, monitor which objects or items others users are downloading or uploading, download your favorite items, search for the most rated items...

2. Sharing Website

Sharing website benefits:

  • See what others users are uploading and downloading
  • Search for specific objects
  • Create alerts and be informed when new objects that meet your criteria are uploaded
  • Review, rate and report shared objects
  • Send messages to others members
  • Create and join groups
  • Discuss with other users about your favorite topics.

3. Share an object

  • Open the 'Share Items' form (Tools -> sharing server)
  • Click on the 'Share' button at the top
  • Select the item type
  • Select an item, then click on the 'Share selected item' button, which is located on the right
  • Read the guidelines
  • Update the description if necessary
  • Click on 'Share'

It is important that you follow the guidelines, because any shared object that does not meet the guidelines will be deleted.

4. Download an object

  • Open the 'Share Items' form (Tools -> sharing server)
  • Click on the 'Download' button at the top
  • Select the item type
  • Select the item that you want to download, then click on the 'Download' button, which is located on the right
  • The 'Status' column shows updates about the downloading process
  • Once the object is downloaded, the 'Save an item' dialog will appear
  • Select a name and a category (not necessary) for this object, then click on 'Save'

Now, you can use this object in your application

5. Bookmarks

In the download panel and in the panel "My Lists", click on "Bookmarks" to see all the objects that you have bookmarked.

6. Sharing Server Website

QuantShare


Notes

Notes Tool

1. Introduction

The Notes tool allows you to write custom notes.
Each note is associated with a security and a date.

Notes are stored in a custom intraday database, which name is "_notes". This database is automatically created (The name of automatically created databases are preceded with "_").

2. Create a new note

- In a chart, move your mouse over a specific date/bar then type CONTROL+N
- In the "Notes" form, type something then click on "Add Note"

You can update the date of the note by updating the "Date" field.
You can see the number of notes and the current symbol next to "Info" field (bottom)
You can display a note, by selecting an item next to "Select Note" field.
You can instruct QuantShare to change automatically the active symbol by checking "Auto" field

3. Remove a note

In "Notes" form:

- Select a note
- Delete the note text (Blank note)

4. Update a note

In "Notes" form:

- Select a note
- Update the note text (Changes are automatically saved)

5. Display notes

To display all notes for one or several symbol:

- Use the "Database Viewer" tool
- Select "Tools" then "Database Data"
- Select "_notes" database

6. Use notes in other plug-ins

As with any custom database, you can reference notes data within the QuantShare programming language.
The functions you can use includes: GetData, GetDataCount, GetDataCountInside, GetDataExtern...

To display the number of notes of a specific security in a chart, type the following formula:

a = GetDataCount("_notes", "note");
plot(a, "");


Divers

Excel

1. Excel

You can open an excel form within your application. To do so, click on 'Divers' menu then on 'Excel'.

2. Internet explorer

You can open an internet explorer form within your application. To do so, click on 'Divers' menu then on 'IExplorer'.

3. Output

Output form is a small form that displays text in a text-box.
You can add text to this form using the .Net function 'App.AddToOutput', or the QuantShare function: 'Output'.

4. Output list

Output form is a small form that displays text in a grid.
You can add text to this form using the .Net function 'App.AddToOutputList', or the QuantShare function: 'OutputList'.


Replay Tool

1. Introduction

The replay tool is a QuantShare feature that allows you to replay historical and intraday bars.
You simply select a time frame, a start date and an end date and the replay tool will make bars appear one by one.

This tool is ideal for practicing and learning.

Please note that the replay or playback is simulated on the chart, which means that the tool reads data from your internal database but it does not update or modify it.

2. Open the Replay Tool

Select "Tools" then "Replay Tool"

3. Replay Tool Settings

Dates: Select when to start and stop the simulation.
Click on "Default" to use the start and end date of the active chart symbol's data.

Period: Select the time frame to use during the replay of the trading bars.

If you select "Daily" period then each update will increase the replay date by one day.
If you select "One-minute" period then each update will increase the replay date by one minute.

Note that weekends are skipped and that the playback will occur only during the intraday session.
To visualize or update the open and close time of the intraday session of a security, click on the circle located at the right-bottom corner of the chart then select "Exchange Settings".

Use selected chart time frame: Check this field if you want to use the period that is currently used by the active chart.

Select "Settings" tab to get more options:

Replay all charts: Check this to replay all active charts. Otherwise, only the selected chart is replayed.

Reset Settings: Initialize replay settings with default data.

Load Settings: Load settings from a file

Save Settings: Save settings to a file

4. Start the Replay Tool

To start replaying chart(s), click on "Start" button at the bottom. The active date is available next to "Current Date".
You can "Pause" the replay by clicking on "Pause" button.
You can "Stop" the replay by clicking on "Stop" button.

Forward/Backward:

Click on "Forward" to move the chart forward.
Click on "Backward" to move the chart backward.

The number of bars to move is determined by the "bars" field.
If set this field to 10, replay daily data then click on "Forward", the chart will move forward by 10 days.

Speed: This field allows you to define the speed of the replay. The higher the value the quicker the replay tool will playback bars.

5. Simulated Trading with the Replay Tool

When the replay tool starts, you will see two buttons on each working chart (Chart used by the replay tool).
The "Buy" button allows to enter long the current security.
The "Short" button allows you to enter short long the current security.

After clicking on "Buy" (Short), you can exit the position by clicking on the "Sell" (Cover) button.

You can see trade entry arrows on chart. You can also see trade details after selecting the "Trades" tab of the "Replay Tool" form.
To create an advanced report (Like the simulator report) from trades generated by the replay tool, select "Trades" tab, click on "Menu" item at the bottom then click on "Show Advanced Report".

In "Settings -> Trades" tab of the replay tool, you define how to enter buy, sell, short and cover orders.

Next bar open: Trade will be executed on the open of the next bar
Current bar close: Trade will be executed on the close of the current bar
Limit: Trade will be executed when it reaches the % limit defined by you


ASCII Importer

1. Introduction

The ASCII Importer is used to parse text or CSV files and include the parsed content into the application's databases.
The ASCII imported has many settings that let you import any kind of data into quotes or custom databases.

N.B. the downloader plug-in use the ASCII Importer engine to parse the downloaded data.

2. Import Text or CSV data

To import data into the application's databases, click on 'Data' in the menu, then select 'ASCII Import'.

Once the import form opens, select one or many files by clicking on 'Pick files'.
If there are no reference to symbols in your files then you have to associate each file with a symbol name. To do so, just select a file in the list box, then type in a symbol name in the text box nearby the button 'Update symbol name', click on that button to associate a symbol to the file.

Note that you do not have to do that if there are references to symbols in your files content.

Click on 'Next' to go to the next screen. This screen let you define how to parse the content of your files, extract dates, symbols, execute script before or after parsing, associate symbols to groups, markets...

Let us take an example; we are going to show you how to parse the current lines:
A;01/12/08;12.2;13.3;11.5;12.1;1200
A;01/13/08;12.2;13.3;11.5;12.1;1200
A;01/14/08;12.2;13.3;11.5;12.1;1200

First, we have to define the separator, in this case its ';'.

We do not need to escape any lines.
We have to choose '/' as a separator for dates.
Since the date format is Month/Day/Year, we then choose MDY as 'Date type'.
Now we are going to create columns by clicking on the button 'Add Column'; we need to create seven columns.
For each column, we select 'Quotes' as database.
The first column field will be 'Symbol', the second one 'Date', the third 'Open', the forth 'High', the fifth 'Low', the seventh 'Close', the eighth 'Volume'.

Click on 'Next' to go to the 'Input & Output' panel. You will get a sample of your files content as well as a sample of the parsed content.
You have to click on 'Database->Field' items to see what the output will look like.
Click again on 'Next', so that the application can parse your files. After parsing the data, you will get the number of errors if any, the number of symbols that will be added... If during the parsing the engine finds errors, go back to the previous panel and correct the errors; if there are no errors then click on 'Next' to start the importing process.

3. Columns

The columns are used to parse the content of the files. Look at the 'Import Text or CSV data' paragraph for an example.

Click on the Red Cross to remove a column.
You can associate a column to a quote or a custom database; double click on the cells that belong to the 'Database' column to see the available databases.
You can set 'Skip' as a field to skip the current column.

4. Import Settings

  • Automatically add new symbols: Add the new symbols the parser finds.
  • "Disable 'Associate new symbols to ...'": Make sure symbols will not be associated with any market, industry, group or index.
  • "Replace data if same date": Override the existing data if data of the same date is found
  • "Remove old data from database if exists": Before parsing, remove all the available content for the symbols that are going to be used in the import process.
  • "Continue parsing even if there are errors": Continue the parsing process even if there are errors.
  • "Text Qualifiers": Text between text qualifiers is treated as a single element.
    Example: (comma as separator and double quotes as text qualifiers)
    12,"12,5" -> element 1: (12) and element 2: (12,5).
    If we haven't specified text qualifiers, we would have: element1 : (12), element 2: ("12) and element 3: (5")

5. Advanced Date Format

In the 'ASCII Import' form, set 'Data type' to custom.

The date format is defined as: [Y]/[M]/[D] [h]:[m]:[s]:[i]

[Y]: year with four digits, example: 2008.
{Y}: year with two digits, example: 08.
[M]: month
[D]: date
[h]: hour
[m]: minute
[s]: second
[i]: milliseconds

If the date you want to parse if for example: 12 01 2002 20:10, then set the date format to [D] [M] [Y] [h]:[m].

Exclude button:

Exclude keywords from a date.
Example: If your date is "Monday 12/01/2004", before parsing this date, you should get rid of the word 'Monday'. To do so, click on 'Exclude button' and insert the word 'Monday'.

Replace button:

Replace a keyword with another one.
Example: If your date is "2001M1" and M1 means January. You should click on replace button, and then click on 'Add row'. In that row, you have to type 'M1' under the 'old' column and type '/01/01' under the 'new column'. The date value will be "2001/01/01".

6. Pre-Parsing Script

Pre-Parsing Script is used to modify content before parsing begins.

Example:
Your content looks like this:
A;01/01/2008;A was upgraded by JP Morgan
B;01/01/2008;B was upgraded by JP Morgan
C;02/01/2008;C was downgraded by JP Morgan
D;01/01/2008;D was upgraded by JP Morgan

You want to create a column that contains data indicating whether the stock was downgraded or upgraded.

First, we should create four columns; set the databases and fields.

Now click on "Pre-Script" button.
At any moment you can press on 'CTRL+SPACE' to see the available variables.
In the Pre-Parsing script, we have one variable: "Content".

"Content" is of type "PreScript"
"Content" contains the content of each row or line. It also contains two functions:

AddRow: Add a new row or line. You must pass the elements to be added as parameters. The number of elements must be equal to the number of elements in the orginal content. There are three elements in our example.
Example of how to use "AddRow":
Content.AddRow("GOOG","01/01/2008","GOOG was upgraded then downgraded");

GetURLORFileName: Gets the URL of file name of the content we are going to parse.

Each row contains two variables: 'Data' and 'IsIgnoreLine'

"Data" is an array of string: Contains the parsed line data. In our example: (for line number 1) Data[0] contains 'A', Data[1] contains '01/01/2008'...
"IsIgnoreLine" is a Boolean: Specify whether to accept or ignore the current line or row.

The Pre-Script is executed for each file or document.

In our example, we want to check if the column number three (referenced by Data[2] -arrays start with the index zero-) contains the word 'Upgraded'.

Here is the script:

for(var i:int = 0;i<Content.Rows.Length;i++)

{

if(Content.Rows[i].Data[2].Contains("Upgraded"))

{

Content.Rows[i].Data[3] = "1";

}

else

{

Content.Rows[i].Data[3] = "0";

}

}

The fourth column value is '1' if the stock is upgraded, otherwise its value is '0'.
You can remove the 'else' statement in the script and set a default value of '0' in the fourth column.

7. Post-Parsing Script

Post-Parsing Script is used to modify parsed content.
Example of usage: Look at the parsed symbol quotes and correct bad ticks.

The Post-Parsing Script contains one variable: "Data"

"Data" is of type "PostScript"
"Data" contains the parsed content for each date.

Each row contains two variables:

Date: A date
Data: An array of objects (could be numeric 'double' or 'text') for the date referenced by the variable 'Date'
IsIgnoreLine: Specify whether to ignore the current row or not.

The Post-Script is executed for each symbol.

If your columns are defined like this:
Column 1: Symbol
Column 2: Date
Column 4: Open
Column 5: High
Column 6: Low
Column 7: Close
Column 8: Volume

In addition, your file content is:

A;13/12/2008;11;11;11;11;100
A;12/12/2008;12;12;12;12;200

Then variable 'Data' (of type PostScript) will contain two rows.
In the first row, the variable 'Date' will have '13/12/2008' as value and the variable 'Data' will be an array.
Data[0] = 11
Data[1] = 11
Data[2] = 11
Data[3] = 11
Data[4] = 100


Downloading Data

1. Downloader

The downloader plug-in is a powerful tool that allows you to automatically download data from the Internet, parse it then add it to your quotes or custom databases.

A download item is an object created using the downloader plug-in. It contains the URLs, scripts and the logic that lets you get your favorite data automatically.

There are hundreds of download items freely available on QuantShare Sharing server.

If you want to create your own download item, please go to the "Downloader" section of this documentation.

2. Download data wizard

The download data wizard is a tool that allows you to download automatically a list of symbols and one or several downloaders for the selected exchange/market.

The list of symbols and downloaders are available in the sharing server.

To open the download data wizard:

- Select "Download" then "Download Data Wizard".
- After the form is opened, the list of items is downloaded from our servers.
- You can use the "Search" field to find a specific exchange/market.
- Select an exchange to display the list of items that will be downloaded from the sharing server.

Once you click on the "Download" button, the following steps are performed:

- A new account is created
- The objects are downloaded from the sharing server
- The objects are installed and executed

If you want to add the symbols in the current account, check the "Install the package in the same account" field.

Example of available markets: (+40 Markets/Exchanges are available)
US Stock Market
US Delisted Stocks
US Options
Forex Market
Exchange-Traded Funds
Futures Market
Russian Stock Market
Amsterdam Stock Exchange

Note that not all markets are available. In this case, you should visit the sharing server to find a specific data downloader for your market.

3. Auto-Download quotes

"Auto-Download" is a feature that automatically downloads EOD and Intraday data when you open a new chart or select another symbol for an active chart.

QuantShare automatically detects the downloader that was previously used to get data for the current symbol and then use it to get new data.

To enable "Auto-Download" feature, select "Download" then "Auto-Download Quotes".

Perform the same action to disable this feature.

4. Download from watchlist

- Select one or several securities in your watchlist
- Right click on the grid/table
- Select "Download data for selected symbols"
- Select the appropriate downloader

There are two categories of downloaders (Name in grey)

- Historical/Intraday: Downloaders that save data in historical/intraday/tick databases
- Custom: Downloaders that save data in custom databases

You can download data for all securities in a watchlist by selecting "Download data for all symbols" (In the context menu after you right click on the watchlist grid/table)

5. Download from chart

To download data for a security directly from a chart:

- Click on the circle icon located at the bottom-right corner of the chart
- Select "Download Data for..."
- Select the appropriate downloader

The chart is automatically updated when the downloading process is completed


Downloader

The downloader plug-in downloads CSV, text, excel, compressed (ZIP), or RSS data from any website, parses it, transforms it, and then imports it to your databases.

N.B. the downloader plug-in uses the ASCII Importer engine to parse the downloaded data.

1. Introduction

Each download item is associated with one or sereral URLs, and each URL can contain any number of fields.

If for example you want to import stock quotes for the server 'www.example.com', and the complete URL to get stock quotes for the symbol "goog" is "www.example.com/quotes.php?id=goog".
In addition, you have to login using the following URL
"http://www.example.com/login.php?user=xx&pass=yy" before being able to download any quotes.

Given this example, your download item, should contains two URL:

1 – "http://www.example.com/login.php"
2 – "http://www.example.com/quotes.php"

The first URL should contain two fields, one for the login and another one for the password.
The second URL should contain a field named 'id', you have to set this field's type to 'Symbol'.

2. Create a download item

Open the download manager by clicking on 'Download' in the menu bar, then 'Download Manager'.
Click on 'Add', in the download manager.

2.1. Download Steps

'Download Steps' are the URLs that the downloader must visit in order to download your content.
Click on 'Add URL' to add a new download step.

2.2. Fields

You can associate one or more fields to each 'Download Step' or URL.
First, add a new URL, and then click on the button 'Fields' under the 'Fields' column. Fields are used as parameters.

To add new fields, click on 'Add Field'.
To remove a field, select one, and then click on 'Remove Selected Field'.
To close the fields form, click on 'Close'.

When adding a field, you should specify four things:

· Field name: The name that will be used in the URL

· Field value: The value that will be used in testing and in static fields like the login and password fields; the value of a dynamic field is automatically updated in the downloading process.

· Field Type: The type associated with the field.

· Field visibility: Indicate whether to display the field as a URL parameter or not. Check the box to hide the field. You still can use the fields data (please refer to how to use brackets).

Example:

URL: "www.example.com/test.php?a=2"
Field Name: b
Field Value: test
Field Type: Custom

In the testing process, the software will use this URL: www.example.com/test.php?a=2&b=test .
In the downloading process, if you put the following values (EX1 and EX2) in the text box inside the tab associated with the field "b":

The downloader will use theses URLs to download your content:
"www.example.com/test.php?a=2&b=EX1"
"www.example.com/test.php?a=2&b=EX2"

How to use brackets:
In order to use a field inside a URL you should insert the field name inside brackets.
Let us take the last example: "www.example.com".
You can display the value "2" that corresponds to the field "a", using the following text: [a]
Example: "www.example.com/test_[a].php".

Keywords:
[DATE]: displays the date
[SYMBOL]: displays the symbol
[field_name]: displays any field value

2.3. Ordering URLs

Open the 'Update Download Item' form.
Click on the icon within the 'Up' column.

2.4. CSV, Excel, RSS, ZIP

After you have added the URL, specified the fields, and depending on the content you are parsing, click on the cell within the 'Parser' column and select the appropriate content type.
Click on 'Parser' to open the 'Parser' form.
This form will upload some content to help you fill in the appropriate parsing settings.
Look at the 'ASCII Import' plug-in for more information.

Excel: Download excel file and parse the content of every sheet.
RSS: Download RSS feed then transform it to CSV.
Zip: Download a compressed archive and parse every file included inside the archive.

2.5. Settings

Click on the "Settings" cell to open the settings form.
Within this form you can specify:
Whether to submit the fields data with a POST or GET method.
Whether to execute the URL-Script once or for each combination of fields.
For more information on the URL-Script, please visit the appropriate section.

The URL-Script is executed before downloading any data. This script lets you define dynamic URLs. It is executed for each combination of fields, which means that if for example you are using 10 symbols and a custom field with 2 custom data, this script will be executed 20 times, once for each "Symbol - Custom data" combination. If you check the above element (execute the URL-Script once), then the script will be executed only one time. You will have to define the URLs inside this script.

2.6 Test

In the 'Update Download Item' form, there is a button named 'Test'.
Click on this button to see how the application will browse your URLs to import your content.
This tool is designed to help you find and correct possible problems.

2.7. Detect

In the 'Update Download Item' form, there is a button named 'Detect'.
Click on this button to open a browser page. Visit your content pages URLs to look for all the form fields names.
This tool is designed to help you create your download item.

3. Download Settings

3.3. Settings

  • Maximum number of download threads to allow: specify how many concurrent threads to use during the downloading process.
  • This item should download data every: You specify here a number of days for your download item, and the application will alert you each time a download item needs to be run. A column named 'Need a run', in the 'Download Manager' form, tells you if the download item needs a run or not.
  • Number of seconds to wait between requests
  • Database to use for the 'last symbol date': Use this option to download only missing quotes or data. Select a database so the downloader can grab the last date from the symbol data in the specified database.

3.4. Proxies

Specify a list of proxy URLs to use when downloading data.
Each line represents a proxy URL.

3.5. Symbol translation table

Translate symbols before downloading data.
Change the symbol name in the URL that will be used to download data.

Each line represents the source and destination symbol pair.

3.6. Offset dates

The "offset dates" button let you offset dates components.
If for example yahoo wants the month component to vary from 0 to 11, 0 means January and 11 means December, then in the 'Offset Dates', set the 'Offset Month' numeric box to one.

4. Using the downloader

To open the downloader form, select "Download -> Download Manager".
Select a download item then click on "Open".
Click on the button "Start" to begin the downloading process.
The progress column shows you the download progression and each time a download is complete, the corresponding row is unchecked.

In the "download items" grid, the "Last" column indicates the number of days since the last execution of the corresponding item.

4.1. Symbols

If you have specified a symbol field in the 'Update Download Item' form, then a 'Symbols' tab will appear.
Select the symbols you would like to download.

4.2. Dates

If you have specified a Date field in the 'Update Download Item' form, then the 'Dates' tab will appears.

In this tab, select the start date, the end date, the format, the interval, then click on 'Save'.

The 'Dates' text box, will show you the dates that are going to be used in the downloading.

Format text box:

[Y]: year, example: 2008
[Y2]: year, example: 08
[M]: month, example: 01 or 10
[M2]: month, example: 1 (without the 0) or 10
[D]: day, example: 01 or 22
[D2]: day, example: 1 (without the 0) or 22

In 'Update Download Item' form, you can also specify dates component within the URL.

Example for yahoo: http://ichart.finance.yahoo.com/table.csv?a=[2M2]&b=[2D2]&c=[2Y]&d=[M2]&e=[D2]&f=[Y]&g=d&ignore=.csv

Dates format are a little bit different here:
[Y], [Y2], [M], [M2], [D], [D2] refers to first date (FROM), while [2Y], [2Y2], [2M], [2M2], [2D], [2D2] refers to second date (TO).

4.3. Start and end dates

If you have specified date components within URLs, a 'Start & End Dates' tab will appears in the 'Download Data' form.

Select 'Last symbol data' to download only missing quotes or data.
The database that will be used to get the last downloaded date for a particular symbol can be set in the 'Download Settings' form.

4.4. Custom fields

If you have specified a custom field in the 'Update Download Item' form, then a tab containing a text box will appear.
Each line inside this text box corresponds to a value.

4.5. Description

In this control, the description of the download item is displayed.

To update the description:

- Select the download item
- Click on "Update"
- Type the description under "Description" panel
- Click on "OK"

4.6. Settings

There are two settings you can update here:

- Send updates every (n) minutes: If this option is disabled then the downloader waits until the downloading process is completed before informing plug-ins of new data. Otherwise it informs plug-ins (Composites, Watchlists...) of new data every (N) minutes.

- Refresh charts after download: If this option is enabled then charts are automatically refreshed when the downloading process is completed.

5. Downloader Scripts

5.1. URL-Script

If you need to dynamically specify the URL to download then you have to use the URL-Script to programmatically specify what URLs or URLs paths to use.
A URL path is a sequence of URLs. It is used if for example before loading a URL, the website requires that you load some other pages, login...
A URL is added using the following function:
Functions.AddURL

A URL path is added using the following functions:
Functions.CreateURLPath: creates an URL path.
AddURL: adds an URL to an URL path.
Functions.AddURLPath: adds an URL path.

The (Functions.Net) class contains different methods to download, extract and parse HTML documents.

5.2. Summary

The engine will look for URLs specified in the URL-Script; it downloads them and split the content using the parser settings. It then passes the split content to the Pre-Script. This script allows you to modify the provided data. Finally the content is parsed and before added to the quotes or custom databases, it is passed to the Post-Script.


Data Viewer

1. Introduction

The data viewer lets you display database data inside a table.

2. Show database data

To open the 'database data' form; select the 'Tools' menu then click on 'Databases Data'.
To display database data, you need to select a database by selecting one in the 'Database' combo box, then click on the icon next to Filters and select for which symbols you want to display data. If you select 'Selected chart', then the grid content will be automatically updated each time the select chart symbol changes.

Click on the watch icon, depending on the period of time you select, the plug-in will only display data that meets the time constraint.

3. Filter database lines

You can filter database data, by typing a keyword in the 'Search' text box and by selecting a database field.

4. Data Viewer Settings

Each grid line has a different color depending on the age of the data. You can choose the colors by selecting the 'Settings' tab in the 'Data Viewer' form.

5. Plot data on the chart

To plot data on a chart, click on 'Show data on chart' in the 'Data Viewer' form.

Click on the chart rectangle or circle to display information.
You can control how to display data on the chart in the 'Settings' tab panel.

6. Action on row double click

By right clicking on the data table, you can select the default action to take when a row is double clicked.

Nothing: No action is taken
Change the selected chart: Associates the selected symbol to the current active chart and displays the bar where the data entry occurred.
Open a new chart: This will open a new chart for the selected symbol


Rules Manager

1. Introduction

The Rules manager allows you to manage and create easily and quickly as many rules as you want.

A rule is a formula that can be used in charting, simulation...
A list of rules is a list that contains one or many rules.
A rule can have one or several iterations.

You can create undefined variables within a rules and specify the start, the end and the increment value of these variables.
This process makes it easy to create hundreds of rules.

List of rules can be used in many situations.

Examples:
You can back-test rules to see how each rule performs.
You can use the optimizer, and run a genetic algorithm process on a list of rules to see which combination of rules performs best.
When creating a trading system, you can define already created rules as buy, sell, and short or cover entries.

2. Create a rule

Open the rule manager (Analysis -> Rules Manager)
Click on 'Add' to create a list of rules
Select the list of rules you have just created.

Here is how to create a rule.
If you rule is something like x > y or x = y, you just have to type the first component in the first input box, and the second one in the second input box.

Example: rsi (14) > 50

A red flag means that there is an error in the formula, if everything is ok then the red drag will turn into a green one.

In the combo box you can select NA, and then type directly the formula in the first input

When you click on the icon next to the red flag, a small form will appear.
This form contains all functions definitions and parameters, use it to select the function you would like to include in your formula then click on OK.

The grid below the inputs boxes is used to transform one rule into several ones.

Example: instead of specifying "rsi (14) > 50", you can type "rsi (14) > a", a line in the grid will appear.

Type in the minimum, the maximum and the step value
In this example, we set a min of 50, a max of 90 and a step of 10, and this rule became a five iterations rule.

3. Rules Manager

Open the rule manager (Analysis -> Rules Manager)

  • Add: Create a list of rules, a dialog box will show up, you just have to enter a name and click on OK
  • Remove: Select a list of rules from the list of rules List then click on "Remove" to delete this list
  • Analyze: Analyze a list of rules (See below)
  • Mass Rules: Create mass rules (See below)
  • Close: Close the 'Rules Manager' form

4. Drag and drop

You can drag and drop rules or list of rules by selecting a rule or a list of rules and dragging it to the clipboard.
From the clipboard, you can drag the posted rules by clicking on 'copy'.

5. Mass Rules

'Mass rules' is a tool that will help you create many rules very quickly using masks.

Click on 'Mass Rules' button; a dialog box will appears.

Now you have two ways to add functions:

  • Add button
  • Add from time-series button

The added functions will appear on the left list.
In our example, we added two functions: Inside() and Outside()

You can now create your masks and specify variables within masks if needed.

Type for example: mask > ref(mask, a) then click on Create, and make variable "a" vary from one to 10 with one as a step. We are about now to create 20 rules (2 rules and ten iterations for each rule)

After clicking on "Create Rules", two rules will be created (with 10 iterations for each rule)

Inside() > ref(Inside(), a)
Outside() > ref(Outside(), a)

6. Analyze rules

Analyze rules is a tool that will let you back-test your rules one by one before using them in ranking systems, simulation, neural networks...

The rules analyzer is not limited to analyzing the performance of trading rules, it can also be used to analyze any market behavior that occur after the trading rule signal become valid.
If you are trading options, you can for example analyze which rules or combination of rules lead to a security higher volatility.

Select a list of rules then click on Analyze, the settings dialog box will appear.

6.1. Symbols & Periods

Specify the symbols and the simulation period.

6.2. Filter

Specify upper and lower limits for a position output; every position with an output value outside these limits will be rejected.
You can also specify limits by selecting a maximum number of standard deviation for position outputs.

6.3. Outputs

Outputs are formulas that the back-tester calculates when he enters a new position. Example: Performance for the next 10 bars which corresponds to the formula "perf(open, -10)"

The outputs form appears once you click on the "Select Outputs" button.

Defined outputs:
Performance, use a trailing stop: Enter a position then exit when drawdown reach –X Percent (Trailing stop)
Performance, use N-Bars stop: Enter a position then exit after X bars (N-Bars stop)
Performance, custom rule for exit + trailing stop: Enter a position then exit when drawdown reach –X Percent or when the specified rule is TRUE.
Performance, exit when rule is false: Enter a position then exit when the rule is no longer TRUE or valid.

The "Custom Output" lets you add your own advanced formula.
See (HELP: Advanced Rules; Output) for an example

6.4. Fixed Rule

You can specify a fixed rule that will be added to the rules to be analyzed.
Fixed rule can contain iterations.
Example:

Let us say we want to analyze theses rules:

  • RSI (14) > 10
  • Perf (close, 10) > a, where "a" varies from two to four, with a step of two

As a fixed rule, we have:
"close > cl" , where "cl" varies from 10 to 20 with a step of 10.

You will end up with a total of "1 + (1 * 2)" rules multiplied by 2 (fixed rules) for a total number of six rules.
Here is the list of all the rules that will be analyzed:

close > 10 && Rsi(14) > 10

close > 10 && Perf(close, 10) > 2

close > 10 && Perf(close, 10) > 4

close > 20 && Rsi(14) > 10

close > 20 && Perf(close, 10) > 2

close > 20 && Perf(close, 10) > 4

6.5. Metrics

CSharp or JScript.Net languages are used to create metrics.

Example of metric formula:

Fitness = OutputPerBar * (NbPositions > 100);

Set the output to zero if the number of position generated by the rules is lower than one hundred.
For each "metric formula", you can add additional metrics using the following function: Functions.AddMetric

6.6. Results

When analyzing rules completes, a grid containing the results appears.

Each line represents a rule or iteration.

Columns abbreviations:

· Out PB: Average position outputs per bar

· Output: Average position outputs

· Bars held: Average number of bars per position

· Positions: Number of positions

· PP: Percentage of positive position output

· Best: Best position output

· Work: Worst position output

· SDV: Standard deviation of position outputs

You can easily create new list of rules from the analyzed rules.

On the "Rules" column click on the right mouse button to make a menu appears.

Search:
Search for rules that contain a specific keyword, found rules will be checked.

Graph per Output:

Displays a chart that plots the analyzer results per output. The average of all rule outputs for each output type will be calculated.

Group results per variable:

Displays a chart that plots the analyzer results per variable value. The average of all rule outputs for each variable value will be calculated.


Ranking System Manager

1. Introduction

A Ranking System takes a list of symbols and assigns a value to each symbol within this list.
Generally, a symbol value ranges from zero to 100.

2. Create a ranking system

To create a ranking system, open the ranking system manager, Analysis->Ranking System Manager, click on the 'Add' button and then type a name.
Now select the ranking system you have just created and start adding formulas and nodes.

Add parent node: Add a top node
Add node: Add a node within the selected node
Add formula: Add a formula within the selected node

Nodes and formula have in common: the name and the weight properties.
Right click on a node or formula to open a menu.

You can assign a different weight to each node or formula to give them more or less importance.

Formulas have some others properties:

  • Formula: a rule or formula you want to use. The red flag nears the formula input box and the circle in the tree view indicates whether the formula is correct (green) or incorrect (red).
  • Factor: multiply the formula result by the provided value
  • Description: the description of the formula
  • Maximum and minimum levels: The maximum and minimum value the formula can have, if a formula return 110 while the maximum level is set to 100, then the application will use a value of 100.

Auto update factor: If this item is checked, the application will decide which factor to apply to the formula. The chosen value is not always accurate, so it is better to update the 'factor' field manually. Generally if the formula return values between 0 and 100, for example an indicator like the relative strength index (rsi), then a factor of one should be used; if the formula return either zero or one (Ex : close > 20), then a factor of 100 should be used.

Calculation example:

Let us make some calculation using this above ranking system as an example.
As you can see, this ranking system contains two nodes.
The first node contains one node which contains two formulas.
The second node contains one formula.

The calculation begins with the formulas.

Formula: rsi (14)

Bars | 1 | 2 | 3 | 4 | 5
Values | 45 | 46 | 50 | 52 | 54

Formula: rsi (7)

Bars | 1 | 2 | 3 | 4 | 5
Values | 20 | 23 | 29 | 20 | 19

Formula: rsi (21)

Bars | 1 | 2 | 3 | 4 | 5
Values | 60 | 61 | 60 | 50 | 45

The values equals the rsi value multiplied by the factor value of the formula, we took here a factor value of one.
Now the software will calculate the parent node of theses formulas.
For each bar, the software takes the value of each node's children (formula or node), multiply it by the formula or node's weight, add all the values, and then divide the result by the sum of the children's weights.

For the bar number one and for the node 'Node1 – 1'
S = sum of children's weights: 10 + 10 = 20

rsi(14) value = 45 * 10 = 450
rsi(7) value = 20 * 10 = 200
rsi(14) value + rsi(7) value = 450 + 200 = 650
'Node 1 – 1' value = 650 / 20 = 32.5.

Node: Node1 - 1

Bars | 1 | 2 | 3 | 4 | 5
Values | 32.5 | 34.5 | 39.5 | 36 | 36.5

We make the same calculation for the 'Node2'.
Because the 'Node2' has only one child, it will get the same values as its child.

Node: Node2

Bars | 1 | 2 | 3 | 4 | 5
Values | 60 | 61 | 60 | 50 | 45

Node: Node1 (same as Node1 – 1)

Bars | 1 | 2 | 3 | 4 | 5
Values | 32.5 | 34.5 | 39.5 | 36 | 36.5

Now, the software will calculate the 'Top Node' (Ranking system values) which has two children (Node1 and Node2).
The same calculation as described above applies.
Top Node = ((Node1 * Node1_weight) + (Node2 * Node2_weight)) / (Node1_weight + Node2_weight).

Therefore, for the first bar it will be:

Top Node bar1 = ((32.5 * 100) + (60 * 50)) / (100 + 50)

Top Node: (Ranking system values)

Bars | 1 | 2 | 3 | 4 | 5
Values | 41.67 | 43.33 | 46.33 | 40.67 | 39.33

NB:
If you want to ignore a node or formula you can uncheck it, only checked nodes are evaluated.

3. Create a ranking system from a list of rules

Select a node, right click on it and then click on 'Add rules from list of rules'.
You just have to select a list of rules then your ranking system will be populated with these rules.

4. Analyze Ranking System

To analyze or back-test a ranking system, click on 'Analyze Ranking System'.
The 'Analyze Ranking System Settings' form will appears, update settings then click on 'Analyze'.

The ranking system analyzer settings are the same as in the 'Analyze List of Rules Settings'.
However, there are two more fields:

· Number of buckets: Let you specify the number of buckets you want to create
Let us say, our ranking system returns values from zero to 100, if we specify 10 as the number of buckets, then the application will back-test or analyze ten systems.
The first system will be the one that have values between 0 and 10, the next one with values between ten and 20... (If you choose Normal Ranking as a Ranking Calculation)

· Ranking calculation:

Same number of positions in each bucket: The boundary between states are choosen so that each state is assigned the same number of positions.

Normal Ranking: The boundary between states are choosen so all the states have the same size.
Example: number of buckets = 10; bucket 1 will contains all the positions that have a rank between zero and ten, bucket 2 will contains all the positions that have a rank between ten and twenty and so on.

Ranking on each rebalance date: For each rebalance period, calculate the values, sort symbols by their value and assign a rank to each symbol (distance between the ranks will be equal).
Example: For a specific date, we have four symbols with the following ranks: 11, 10, 20, and 90; we first sort these symbols then assign a new rank to each one, we will end up with the following new ranks: 0, 25, 50, and 100, where symbol number one have a rank of 25, symbol number two have a rank of 0 and so on.
(The trading system back-tester uses this type of ranking)

  • Rebalance every: The analyzer starts at the start date and advance by a number of days as specified in this field. For each period, a rebalance is done (old positions are closed and new ones are taken).
    Unlike the 'Rules Analyzer', which rebalance or taking a new position occur only after the old position is closed, the 'Ranking System Analyzer' takes new positions after a specific number of days; this position is then assigned to a bucket depending on the value of the ranking system at this date.

5. Analyze Ranking System Report

The 'Analyze Ranking System Report' contains all the back-testing results related to your ranking system.

6. Analyze Nodes

Instead of analyzing a ranking system, you can also analyze each node of a ranking system separately; this will let you know which nodes perform well.
To analyze ranking system nodes, select a ranking system then click on 'Analyze Nodes'.

7. Analyze Nodes Report

The 'Analyze Nodes Report' contains all the back-testing results related to your ranking system nodes.

Each line represents a node, as you can see in the picture below.

Click on the charts to display additional back-testing information.

8. Ranking System & Formulas

You can access a ranking system from the QuantShare language by using this function:
Ranking("ranking system category", "ranking system name");

This function will return the ranking system value of the current symbol. You can use it to create rules and then apply them to the rules analyzer, ranking system analyzer (Ranking system based on another ranking system), trading systems and prediction models...


Simulator

1. Introduction

The Simulator lets you test strategies or trading systems under historical market conditions to determine whether certain scenarios would have worked well in the past. The idea is that if a trading strategy would have performed well previously, it may be worth considering today.

A trading system includes:

  • Buy rules
  • Sell rules
  • Short rules
  • Cover rules
  • Capital settings
  • Stops
  • Money management rules
  • Long and short ranking systems

2. Create a Trading System

Open the 'Simulator' (Analysis->Simulator)

· Click on 'New'

· Set entries and exits

· Set the capital settings

· Set stops

· Set money management rules

· Set symbols that are going to be used in this trading system

· Set a ranking system

Finally, click on 'Create trading system'.

3. Entries, Exits and Stops

System Type: specify whether to create a long, a short or a long/short trading system

Number of positions: Specify the maximum number of positions in the portfolio. You can use the advanced money management script to dynamically change the number of positions in your portfolio.

Entries and exits settings: If a label is underlined when the mouse is over it, click on the mouse left button to display a small menu. You can also update values directly using the mouse wheel.

Order Types: This is where you specify the default order type to use when entering a buy, sell, short or cover position. Click on the label next to "Buy", "Sell"... to open a menu. Select the order type then specify additional fields (for certain order types).

Available orders:
Market at open: Execute the order at bar open
Market at close: Execute the order at bar close
Limit Order: A Stop Limit order instructs the application to submit a buy or sell limit order when the user-specified stop trigger price is hit.
Stop Order: A Stop order is an instruction to submit a buy or sell market order when the user-specified stop trigger price is attained or penetrated.
Stop Limit Order: A Stop Limit order instructs the application to submit a buy or sell limit order when the user-specified stop trigger price is hit. The order has two settings: the stop price and the limit price. When a security reaches the stop price, the order is transformed to a limit order and it is submitted at the limit price.

 Order Types

Entries and exits rules: Click on a rule or on "add rule" to update, add, remove and manage rules.

Specify the stops to apply to the trading system by clicking on the appropriate icon:

· Maximum loss stop: Exit a position if the symbol's performance (points or percent) falls below this level

· Profit target stop: Exit a position if the symbol's performance reaches this level

· Trailing stop: Exit a position if the symbol's drawdown falls below this level

· N-bar stop: Exit a position after a specific number of bars

4. Capital Settings

The Capital settings include:

  • Initial equity
  • Periodicity: rebalance period
  • Reference symbol: generally an index like the SP500
  • Risk free rate
  • Percent of capital to invest: Specify the percentage of capital to invest
  • Activate stop immediately: If activated then when exiting a trade because of a stop, uses the stop value as the trade exit price, otherwise exit as defined in the sell or cover price and delay settings)
  • Reverse entry forces exit: When checked, the back-tester will close a long position if he encounter a short signal for the same symbol and close a short position if he encounters a long signal for the same symbol.
  • Volume filter: tell the back-tester to enter position only if there is enough liquidity.
  • Order are valid for: The number of bars to keep limit orders. After this period, entry orders are canceled and exit orders are transformed into market orders.
  • Pending Orders: Specify which order types are used in the calculation of available cash and positions in the portfolio.
  • Margin: a factor to specify the margin you want to allow for this trading system (A value of 2 means that the amount of money you are allowed to use within this trading system is twice your current equity value)
  • Minimum shares: This is the minimum number of shares you can buy or short. (The position will not take place if the number of shares to buy or short is less that this value)
  • Minimum position value: The same as 'Minimum shares', but we use here the position value or volume.
  • Commissions: Brokerage commissions
  • Slippage: specify the average slippage associated with each trade. (Difference between the simulated entry price and the real entry price)
  • Allow penny stocks: Reject a trade or a position if the stock price is lower than 2. Use this field only if you are trading stocks.

5. Futures Settings

To open the futures settings control, select "Settings" tab then click on "Futures Settings" button.

There you can define the default value for the following fields:

Tick Size: The minimum price move of a given security

Random Lot Size: A normal unit of trading or multiple units of trading of a security

Point Value: The amount of profit generated by one contract for one point increase in price

Margin Deposit: The amount of money required to open a single contract position
Instead of specifying a fixed margin deposit amount, you can specify a variable amount that depends on the contract price.
To do this, type a negative value in the margin depost field.
For example:
Type "-20" to tell QuantShare that margin deposit should be equal to 20% of the contract price.

Disable Futures Mode: Check this field to ignore "Point Value" and "Margin Deposit" options during the backtesting process

Note that you can define a different value for each symbol. For that, select "Symbol -> Update Symbol" in the main menu then update the corresponding fields.

By default, the backtester will search for values that are specific to each symbol. If one of these fields is set to "0" then it will search for the corresponding global value defined in this control.

6. Money Management

See Advanced Money Management topic

7. Optimize a trading system

You can optimize a trading system using the optimizer plug-in or using the simulator optimizer.
The optimizer plug-in uses complex algorithms to find the best trading system, while the integrated simulator optimizer use bulk optimization (that is, the simulator will back-test all the possibilities)

Optimize trading system settings:

- Create or update a trading system
- Select "Optimize" icon
- Click on "Optimization"
- Click on "Add Item"
- Select a variable. For example: Number of symbols.
- Specify the min, max and step values

If you select "Number of symbols", 1 as Min, 10 as Max and 4 as Step then the optimization will create three trading systems:
Trading System 1: Maximum number of symbols is equal to 1.
Trading System 2: Maximum number of symbols is equal to 5.
Trading System 3: Maximum number of symbols is equal to 9.

Optimize trading system formula:

To optimize a trading system formula, use the "Optimize" function.

Example:

Optimize("level", 60,
80, 10);
buy = rsi(14) >
level;

The first instruction will create an optimizable variable whose name is "level".
The second line instructs the trading system to buy a security if its relative strength index value is higher than "level" variable.

This will create three trading systems:

Trading System 1: buy = rsi(14) > 60;
Trading System 2: buy = rsi(14) > 70;
Trading System 3: buy = rsi(14) > 80;

8. Run or optimize a simulation

To run a simulation, first select a trading system, and then click on "Simulation".
To optimize a simulation, first select a trading system, and then click on "Optimize".

9. Create a portfolio from a trading system

A portfolio that uses a trading system allows you to generated trading signals (buy, sell, short and cover orders)based on this trading system, money management logic and latest data.

You can create a portfolio using the Portfolio plug-in (Portfolio -> Portfolio), or you can directly created a trading system-based portfolio from the simulator form.

- Select a trading system
- Click on "Create Portfolio" (at the bottom)
- Update portfolio settings
- Click on "Update Portfolio"
- Type portfolio name then click on "Save item".

10. Trading System Report

10.1 Introduction

The "Trading System Report" analyzes all the signals generated by the simulation and gives you a detailed report.
The report of each simulation is saved and you can review it at any time by clicking on the "Optimization Report" button.

10.2 Grid

The grid control shows you the simulation basic statistics.
When using optimization, this grid shows all generated simulations, a column for each variable shows you what value were used for each simulation.

Double click on the 'Report' column icon to open the report of the selected simulation.

10.3 Chart

Plot equity, drawdown and others time-series graphs.

Right click on the chart to open a menu.
You can create new panes, remove panes, and remove a graph from a pane...

To add a graph to a pane, select a time-series from the combo box as shown below then click on 'Drag' icon then drag the time-series and drop it into a chart's pane.

By default, each time series uses its own scale.
To have time series use the same scale, right click on a time series, select "Selected Graph -> Use default scale".
Repeat this process for each time series you want to associate with the default scale.

To plot entry and exit signals in a symbol chart, check 'Plot Entries & Exits on chart' then select a symbol that was used in the simulation.

The symbol chart will look like the picture below. Click on the arrows to display the position details.

10.4 Statistics

Capital:

Initial Capital – The size of your account before the simulation started

End Capital – The size of your account after the simulation ended

Net Profit – The profit generated by the trading system

Net Profit in Percentage – The profit generated by the trading system in percentage

Exposure – The percentage of your account that was invested for all bars

Net Risk Adjusted Return – Net profit % divided by Exposure %

Annual Return – Compounded annual return %

Risk Adjusted Return - Annual return % divided by Exposure %

Average Profit/Loss - (Profit of winners + Loss of losers)/(number of trades)

Average Profit/Loss in Percentage - (% Profit of winners + % Loss of losers)/(number of trades)

Average Bars Held - sum of bars in trades / number of trades

Winners:

Total Profit – Total profit generated by winning trades

Number of Winners – The number of winning trades

Average Profit - Average profit of the winning trades

Average Profit in Percentage – Average profit of the winning trades in percentage

Average Bars Held For Winners

Max Consecutive Winner

Largest Winner

Number of Bars in Largest Winner

Losers:

Total Loss – Total loss generated by loosing trades

Number of Losers – The number of loosing trades

Average Loss - Average loss of the loosing trades

Average Loss in Percentage – Average loss of the loosing trades in percentage

Average Bars Held For Losers

Max Consecutive Loser

Largest Loser

Number of Bars in Largest Loser

Drawdown:

Maximum Trade Drawdown - The largest peak to valley decline experienced in any single trade

Maximum Trade Drawdown In percentage - The largest peak to valley decline in percentage experienced in any single trade

Maximum system drawdown in dollar - The largest peak to valley decline experienced in portfolio equity

Maximum system drawdown in percentage - The largest peak to valley decline in percentage experienced in portfolio equity

Recovery factor - Net profit divided by Maximum system drawdown

CAR/MaxDD - Compound Annual percentage return divided by Maximum system percentage drawdown

RAR/MaxDD - Risk Adjusted Return divided by Maximum system percentage drawdown

Misc:

Number of trades – The total number of trades generated by the simulation

Percent of winners – The percentage of trade's winners

Annual turnover – Example: a value of 100% means that the average holding period of a trade is one year; a value of 200% means that the average holding period of a trade is six months

Total trading costs – The sum of all the trading costs generated by the simulation

Volume activity – The sum of all the positions size generated by the simulation

Percent trading cost of volume - Total trading costs / Volume activity

Percent positive days – The percentage of positive days in the simulation equity

Percent positive months - The percentage of positive months in the simulation equity

Percent positive years – The percentage of positive years in the simulation equity

Average daily return

Average weekly return

Average monthly return

Stats:

Ulcer index - Square root of sum of squared drawdown divided by number of bars

Ulcer performance index – This indicator is used to measure the riskiness of an investment

K Ratio - A ratio that is used in the performance evaluation of an equity relative to its risk. The ratio examines the consistency of equity's return over time. Higher is better

Standard deviation - A measure of the dispersion of a set of data from its mean. The more spread apart the data, the higher the deviation. Standard deviation is calculated as the square root of variance.

Downside standard deviation - The downside standard deviation from the ordinary standard deviation insofar as the sum is restricted to those returns that are less than the mean

Sharpe ratio - The Sharpe ratio tells us whether a portfolio's returns are due to smart investment decisions or a result of excess risk, the higher the better

Sortino ratio - The Sortino ratio is similar to the Sharpe ratio, except it uses downside deviation for the denominator instead of standard deviation, the higher the better

Profit factor - Profit of winners divided by loss of losers

Payoff ratio – Ratio of average wins / average loss

Performance Vs Benchmark:

Beta - A measure of the volatility, or systematic risk, of a security or a portfolio in comparison to the market as a whole; if a stock's beta is 1.2, it is theoretically 20% more volatile than the market.

Alpha - A measure of performance on a risk-adjusted basis, a positive alpha of 1.0 means the fund has outperformed its benchmark index by 1%. Correspondingly, a similar negative alpha would indicate an underperformance of 1%.

R Squared – The percentage, of a fund or security's movements, that can be explained by movements in a benchmark index. R-squared values range from zero to 100. An R-squared of 100 means that all movements of a security are completely explained by movements in the index

Correlation - a statistical measure of how the security and the benchmark move in relation to each other

10.5 Trades

Realized trades: This window shows you the list of all realized trades.

Trades flow: This window shows you the list of all the trade's entries.

10.6 Detailed trades

This control shows you a snapshot of your portfolio for any date. It displays, for each date, the portfolio statistics, the current positions, the opened positions and the closed positions.
It also shows you the orders that were created for each date, and the orders that were rejected along with the reason of the rejection.

10.7 Performance Per

This window shows you the performance of the trading system per day, week, month and year.

10.8 Symbols

The Symbols tab contains the list of the symbols that were used by the simulation.

10.9 Formula

The formula tab contains the formula that was used to create the trading system.

10.10 Profit distribution

Display a graph that shows you the profit distribution.

10.11 MAE/MFE

Display two graphs, one for maximum adverse exclusion and the other for the maximum favorable exclusion.

You can also display the MAE/MFE data in a scatter plot.
To do this, click on the listbox available next to "Chart Type" then select "Scatter".

More info about scatter plot:
http://en.wikipedia.org/wiki/Scatter_plot

10.12 Custom graphs

Create custom graphs, could be Trade/MAE or Drawdown/MFE...

10.13 S.I.M.I

Shows you the position symbols distribution over markets, industries, sectors and indexes.

10.14 Reference symbol

The symbol used as reference, usually an index such as "^GSPC".

10.15 Exit rules

Shows you the exit rules distribution and the average trade's performance for each exit rule.

10.16 Monte Carlo Simulation

For more information please visit: Monte Carlo Simulation

10.17 Report settings

The Report settings tab allows you to define the default graph interval values.

10.18 Errors Tab

This tab displays the errors, if any, that occurred during the execution of the money management scripts.
The tab name will change to "No errors" if no error occurs during the money management scripts execution or if no money management rules are defined.

11. Trading System Templates

A trading system template is a basic trading system used as a start point to create new trading systems.
For example, you can create a template that contains your broker commissions settings.

To create a new template:

- Create a new trading system
- Click on "Save As Template" button
- Type the template name then click on "Save Item"

To create a new trading system based on a template:

- In "Simulator Manager", click on the arrow next to "New"
- Select "New From Template"
- Select a template name then click on "Load Selected Item"

12. Load trading system report from file

In the "Simulator Manager", click on "Tools -> Trading System Report -> Show report from file" (Click on "+" icon to expand top menu if necessary)

You can save any trading system report to a file, by backtesting your trading system, selecting "Report Settings" tab in the simulator report then clicking on "Save Report".

13. Walk-Forward Testing

Walk-Forward testing is a tool that helps you create robust trading systems.
This technique requires a trading system with optimizable variables.

Here is how it works:
- Your strategy is optimized with the in-sample period
- The strategy that has the best return (or any custom measure) is selected
- The previously selected strategy is backtested with the out-of-sample period
- The in-sample period is moved by X days
- The process is repeated

Walk-forward testing shows us how a trading system performs under various market conditions. It helps us detect whether the performance of a trading system is due to curve fitting or not.
We can consider that the strategy result is realistic if it performs well on out-of-sample data.

Perform a walk-forward testing

- Open the simulator manager by selecting "Analysis -> Simulator"
- Select a trading system
- Click on "Optimize" (top-right corner) then select "Walk-Forward Testing"

Walk-Forward Settings

Follow previous instructions to bring the Walk-Forward settings control.

In-Sample/Out-of-sample Tests:

Start Period: The start date of the first in-sample or out-of-sample period
Anchored: Makes the start date of each sample constant
End Period: The end date of the first in-sample or out-of-sample period
Last Date: The start date of each sample should not be higher than the last date
Use Today: Sets today as last date
Step Period: On each iteration moves the in-sample or out-of-sample period by the step period
Step Interval: Defines the interval of each step

Note that when you update one of these fields, the in-sample or out-of-sample periods are automatically displayed on the corresponding tables.

Metric: Select the metric that will be used to select the best trading system among the different in-sample optimizations. The default metric is the Annual Return.

To start walk-forward testing, click on "OK" button.

Walk-Forward Testing Report

During the execution of the walk-forward testing, the result of each sample is added to the simulation report table.
When testing is completed, the walk-forward report is displayed.

The report displays the result of each iteration (In-Sample + Out-of-sample).
It also displays the best, worst, average, annual return and efficiency of each iteration.

The walk-forward efficiency measure is calculated by comparing annualized returns of in-sample and out-of-sample tests.
This measure can help you quickly detect the robustness of a trading system. As a rule of thumb, a walk-forward efficiency above 60% indicates that you have a robust trading system.

14. Combine Trading Systems Tool

This tool allows you to combine several trading systems and see which combination performs best.

- In the simulator manager, select "Tools" then "Combine Trading Systems".
- Click on "Add Trading Systems"
- Check several trading systems then click on "Load Checked Items"
- Click on "Analyze" to start the analysis.

If you select 3 trading systems (S1, S2 and S3) then this tool will backtest the following combinations:

S1
S2
S3
S1 + S2
S1 + S3
S2 + S3
S1 + S2 + S3

For example for the last trading system, the tool will allocate $10, 000 to each strategy and perform the backtesting. The result will be displayed on the report table. You can display the advanced report of each combination by clicking on the "Report" button.


Monte Carlo Simulation

1. Introduction to Monte Carlo

Monte Carlo simulation is a computerized mathematical technique that allows traders and investors to account for risk in quantitative analysis and decision-making.

The main function of a Monte Carlo Simulation is to determine the robustness of a system.

Monte Carlo simulation creates equity curves that use the same data than the original equity curve but they are calculated in random ways. It creates thousands of equity curves and lets you examine the values and distribution of the returns, annual returns, drawdowns and Sharpe ratios.

To run a Monte Carlo simulation, backtest a trading system, select "Monte Carlo" tab in the "Report" form then click on "Start Simulation".

2. Simulation Types

Reordering:

The equity curve is split into several blocks where each block contains a fixed amount of bars (Specified by user).

In each simulation, blocks are randomly re-arranged and a new equity curve is computed.

Because blocks are only re-arranged, each equity curve has the same return than the original equity curve (The equity curve that results from the backtest of your trading system).

Reordering creates equity curves with different maximum drawdowns.

Replacement:

The equity curve is split in several blocks (N), where each block contains a fixed amount of bars (Specified by user).

In each simulation, N blocks are taking randomly (with replacement) and these blocks are used to compute the new equity curve.

This means that a block can be used twice or more and this creates equity curves that have different returns and maximum drawdowns.

3. Simulation Settings

Number of simulations: This is the total number of simulations that must be created by the Monte Carlo plug-in.

Maximum number of graphs to display: This is the maximum number of graphs to display in the "Monte Carlo Simulation" graph. Keep this value low to use less computer resources.

Bars per sample: This is the number of bars that makes up a block. See "Simulation Types" for more information.

Seed value: This is the random seed value. Set to zero to generate a random seed otherwise set a fixed value to get repeatable results.

Example:

By specifying 150 in the seed value input, you will always get the same results, for a specific equity curve, when running a Monte Carlo Simulation.

4. Monte Carlo Graphs

Monte Carlo Simulation:

This chart displays the different equity curves that were generated by the Monte Carlo Simulation

Distributions:

This chart displays the distribution of several measures: Return, Annual Return, Maximum Drawdown and Sharpe Ratio.

Use the slider (right) to increase or decrease the distribution interval.

Confidence Level:

To display confidence level values, select the "Confidence Level" tab.

Example:

If you set the confidence level to 95% then the Monte Carlo plug-in will tell you the following:

95% of the simulation's tests have an equity curve with an annual return higher than X%. The higher the value of X, the more robust the trading system.

You will also get information for following measures: Return, Maximum drawdown and Sharpe ratio.


 Advanced Money Management

1. Introduction

The Money management plug-in let you take deep control over which instruments to buy, sell, short or cover, at which price and for which amount.
It will also let you you create advanced metrics to assess and evaluate any trading system.

Unlike many other products, QuantShare's money management tool is not applied after the simulation process. The different events are executed during the simulation; this allows you to use different portfolio metrics, such as the current equity or drawdown, and to control/manage new orders, existing positions, stops, number of positions, exposure...

You can also create variables within your advanced money management script and use the simulator optimizer to optimize these variables.

2. Create money management rules

In the 'Update trading system' or 'Create trading system' form, click on 'Advanced money management'; these money management rules you are about to create will be associated with the current trading system.

You can also create money management rules by selecting (Analysis -> Advanced Money Management)

3. Money management events

There are six money management events:

  • OnNewPosition: Called before the application opens a position
  • OnClosePosition: Called before the application exits a position
  • OnEndPeriod: Called at the end of a period (On historical back testing a period is a day, a week or a month, depending on the time frame)
  • OnStartSimulation: Called just before the simulator starts
  • OnEndSimulation: Called just after the simulator ends
  • Global: This part is used to initialize variables and functions to be used in other events. You should only declare variables and functions there.

Each event has also its own variables and functions; you can create a script for each event.

Example (OnEndPeriod Event):

We are going to create a script that will order the simulator not to take new positions for the next 30 bars if the portfolio drawdown is below -20 percent.

The Script:

if(Portfolio.Drawdown < -20)

{

// If portfolio drawdown is less than 20 percent, then we order the simulator

// not to take new positions for the next 30 bars

Functions.SkipPeriods(30);

}

Examples:

Reject an signal if the RSI value is lower than 50:

You can create directly this rule as a sell rule or you use the OnNewPosition event of the money management script.

TimeSeries t = Data.ParseFormula("a = rsi(14);").GetTimeSeries(NewPosition.Symbol ,"a");
if(t[0]
< 50)
{
Functions.RejectPosition();
}

Pair trading: In OnEndPeriod event

if(Your
rule)
{
MMPosition pos = Portfolio.GetPosition(symbol_1);
if(pos != null && !pos.IsLong)
{
//
Exit positions
Functions.CloseAllPositions(0);
}
// Buy
symbol_1 & Short symbol_2
Functions.AddLongPosition(symbol_1, 0, Orders.OpenMarketOrder());
Functions.AddShortPosition(symbol_2, 0, Orders.OpenMarketOrder());
}
else
{
MMPosition pos = Portfolio.GetPosition(symbol_1);
if(pos != null && pos.IsLong)
{
//
Exit positions
Functions.CloseAllPositions(0);
}
// Buy
symbol_2 & Short symbol_1
Functions.AddLongPosition(symbol_2, 0, Orders.OpenMarketOrder());
Functions.AddShortPosition(symbol_1, 0, Orders.OpenMarketOrder());
}

Using the Global Event:

Let us say that you want to calculate the number of times the "OnNewPosition" event was called.
To do this, simply create a variable in the "Global" event:

int ct = 0;

And increment that variable in the "OnNewPosition" event:

ct = ct + 1;

// No need to initialize the "ct" variable in the "OnNewPosition" event, because this variable was already initialized in the "Global" event.

4. Money management Categories

There are two default categories in QuantShare's money management tool: Long and Short categories.
The "Long" category deals with long trades while the "Short" category deals with short trades.

Each category has two main properties:
- Percentage to invest: The percentage of capital associated with a specific category
- Number of positions: The maximum number of positions to buy/short in a specific category

If you want to buy a stock based on the available cash and positions (You do not specify a number of shares to buy). The money management tool will calculate the number of shares to buy based on the number of positions and cash available in the "Long" category.
Example: (OnEndPeriod event)
Functions.AddLongPosition("GOOG", Orders.OpenMarketOrder());

5. Custom Categories

You can create a custom category by calling the "Portfolio.UpdateCategorySettings" function.

Example:
Create a long1 category. This allows us to create two strategies within the same trading system.
Each strategy could have its own buy and sell rules and we can easily modify the capital associated with each category using the "Portfolio.UpdateCategorySettings" function.

Example:
Portfolio.UpdateCategorySettings("long", 50, 10, null); // 50% and 10 maximum positions to "long" category
Portfolio.UpdateCategorySettings("long1", 50, 5, null); // 50% and 5 maximum positions to "long1" category

Article:
 http://www.quantshare.com/sa-308-how-to-combine-long-short-and-custom-portfolio-strategies-within-a-trading-system

Trading Object:
 http://www.quantshare.com/item-529-rebalance-combine-backtest-two-trading-strategies


Screener

1. Introduction

The screener plug-ins let you scan symbols quotes using defined criteria.

To open the screener tool, select "Analysis" then "Screener".

The "Screens" list displays all the available screens. You can download click on a screen to run it.

2. Create a Screen

Click on "Create a new screen".

1- Select whether to screen by date or bar. When bar (0) is set then the screener will check the criteria against the last bar of each asset.

2- Click on "Select Symbols" to select the symbols to include in this screen

3- Select a time frame (Daily, monthly, one-hour, one-minute...)

4- In the Formula Filter, type your formula (criteria) then click on "Start" to run the screen.

Example:

Close > 10

3. Edit a Screen

In "Screens" list, select a screen then click on "Edit Screen". Changes are automatically saved.

4. Stats

Stats grid takes each column and calculate the maximum, minimum and average values.

To display the "Stats" grid, click on "Show Stats" (at the bottom of the screener)

5. Columns

You can add columns to your screen by clicking on the "Add Column" link (Wizard view) or by using the "AddColumn" function.

Example: the following formula will add a column whose name is 'Perf 1D' and will show "the performance of the security for one day" on the screener report.

AddColumn ("Perf 1D", Perf (close, 1));

Another option would be to create a column set and reference it from the "Add Columns" tab.

(Analysis -> Columns Set)


Pivot tables

1. Introduction

A pivot table is a data summarization tool that counts, sums and averages data from one or several symbols and dates..

This tool allows you to create simple tables and pivot tables from your databases using quotes and/or technical/fundamental indicators data.

To create a pivot table, you must open a dashboard first.

- Select "Tools", "Dashboard" then "New Dashboard"

- Type the dashboard name then click on "Save Item"

- Right click on the dashboard then select "Create Pivot Table" (A black rectangle is added)

- Right click on that rectangle then select "Update Rows/Columns/Values"

For more information about dashboards or widget panels, please look at the "Widget Panel" topic.

2. Pivot Table Example

In this pivot table, we will display the RSI values of two stocks for the last 5 trading days.

- Click on "+" next to rows then select "Dates" tab

- Click on "+" next to columns then select "Symbols" tab. Click on "Add Symbols" then add two symbols (Example: GOOG;MSFT).

- Select the existing "Values" item then set the following formula: rsi(14). Type "RSI" under "Name" panel

- Under "Select Dates" panel, select "Last 5 Days" then click on OK

- Right click on the Pivot table then select "Perform Calculation"

You must have the latest EOD data in order to see Google and Microsoft RSI values for the last 5 trading days.

Additional Information:
http://www.quantshare.com/sa-141-pivot-tables-in-quantshare-trading-software


Portfolio

This tool allows you to create portfolios and manage your positions.
You can enter trades manually or automatically based on a trading system.

1. Portfolio View

To open the portfolio view: Click on "Portfolio" in the menu, then "Portfolio".
The Portfolio manager contains all your portfolios. When you select a portfolio, the right panel displays several metrics as well as current positions info and pending orders.

2. Create a portfolio

There are two types of portfolios: Simple portfolios and strategy-based portfolios.
The former allows you to enter manual orders and positions. The latter automatically create orders based on the trading strategy you have associated with it. You can also manually enter orders in a strategy-based portfolio.

To create a portfolio, click on "New" in the Portfolio View.
Click on "Click here to associate it with a strategy" to link the portfolio to a trading system.

Here is a description of the different portfolio settings:
Capital: The initial capital allocated to the portfolio.
Number of positions: The maximum number of positions in the portfolio (Applicable when a trading strategy is defined).
Past Days: Specify the number of past days to look for signals (Applicable when a trading strategy is defined). Default value is 0, which means that the portfolio will look for signals that occur on the rebalance day.

Example:
Rebalance date is today and past days is set to 0.
Stock "A" buy signal occurred yesterday. When you execute "Get Signals", you will get no signals.
If you set "Past days" to one, the portfolio will also look for yesterday' signals and you will then get one order to buy Stock "A".

3. Get Trading Signals

The rebalance day is the day that is used to check for new buy/sell/short/cover signals. Usually in End-of-day trading, the rebalance day is the last trading day.
In the "Pending Orders" tab, specify a date near the "Get Signals" button and then click on that button.
By default, the rebalance date is set to the last quote's date.

4. Pending Orders

Orders created manually or automatically after a rebalance are added to the "Pending Orders" View. It displays the Orders that should be executed.
To execute an order, simply on "Buy", "Sell", "Short" or "Cover", select the execution price, number of shares and commissions amount then click on "Confirm".

5. Add an order manually

- In "Pending Orders", click on "Add Order Manually".
- Select the symbol, number of shares, action and order type.
- Click on "Add Order"

6. Rejected Orders

The "Rejected Orders" tab contains the orders that were rejected from the "Pending Orders" grid (An order is rejected when you click on delete -X- icon).

You can then click on "Get Signals" again to get new orders or to replace the rejected orders.

To delete a rejected order, select the "Rejected Orders" tab then click on the "+" icon (Cells under the last column).

Once you delete the rejected order, you can get orders for the underlying symbol on the next rebalance.

7. Add Bulk Positions

There are two ways to add several positions from a file.

Solution 1: Add several positions to your portfolio
- Click on "Add Positions" at the bottom
- Select "Add Several Positions" tab

Solution 2: Create several historical trades/transactions then automatically execute them
- Select your portfolio
- Click on "Tools" then "Import Trades"

Choose the second solution if you want to import historical positions/trades.

8. Portfolio's positions

The "Positions" tab displays the current portfolio's positions.
Click on the (i) icon, to display more information regarding the position.
Click on the (x) icon to remove or close the position.

9. Update portfolio's categories

Categories are used to separate different strategies within a trading system. In a long/short trading system, positions that are entered long are associated with the "long" category, while positions that are entered short are associated with the "short" category.
Using the money management script, you can create as many categories as you want.

Click on "Categories" tab to display the available categories for the portfolio, as well as the remaining cash and positions for each one of them.
The "Adjust Cash" button automatically adjusts the available cash based on the current portfolio equity and the percent of equity to invest for the category.
You can change the amount of cash, the percent of capital to invest and the maximum number of positions for each category by updating the corresponding fields and then clicking on the "Update" button.

10. Update a portfolio

Select a portfolio then click on "Update".

11. Delete a portfolio

To remove a portfolio, click on "Remove" in the Portfolio View.

12. Deposit and Withdraw Money

To deposit or withdraw cash from a Portfolio, click on "Add//Withdraw Cash" button and then select the amount.

Here is how to update cash transactions:
- Select "Cash Activity" tab
- Double click on a cell under "Date" or "Amount"
- Type a new value

13. Stats

13.1 Portfolio History

This tab displays historical equity positions. For each day, you will see the portfolio equity, available cash, percent invest and the number of positions in the portfolio.

13.2 Summary

This tab displays some statistics: Portfolio value, cash, return, total gain, total loss, current drawdown, maximum drawdown, percent winning trades...

13.3 Advanced Report

To create an advanced report from a portfolio:

- Select your portfolio
- Select "Summary" tab
- Click on "Create Advanced Report"

14. Advanced Report

By right clicking on a portfolio then selecting "Create Advanced Report", you can create a report from your portfolio trades (as the one created after a simulation or backtest)

15. Combined Portfolios

The portfolio combination tool lets you create combinations from a number of portfolios and shows you how each combination performs.

Example:

Let us say you have three portfolios and you want to see the combined results.

- In the "Portfolio" manager, select "Tools" then "Report for combined portfolios".

- Click on "Add Portfolio" and add three portfolios

- Click on "Analyze" to create advanced reports for each combination

The tool will display the result of the following portfolios:

Portfolio 1
Portfolio 2
Portfolio 3
Portfolio 1 + Portfolio 2
Portfolio 1 + Portfolio 3
Portfolio 2 + Portfolio 3
Portfolio 1 + Portfolio 2 + Portfolio 3

For each combination, you can display the advanced report by clicking on the "Report" button.

16. Import Trades

It is possible to add several trades in a portfolio from different sources:

Another Portfolio:

- Right click on a portfolio
- Select "Import trades from another portfolio"
- Select a portfolio
- Click on "Load Selected Item"

File:

- Right click on a portfolio
- Select "Import trades from a file"
- Click on "Add File" then select the file that contains the list of trades
- Select the appropriate Symbol Field (default is Name)
- Click on "Import"

Sample File:
10/11/2011 12:52;EURUSD;Buy;1.43;1000;1
10/11/2011 13:52;EURUSD;Buy;1.45;1000;1
10/11/2011 14:52;EURUSD;Sell;1.41;500;1
10/11/2011 15:52;EURUSD;Sell;1.4;1000;1
10/11/2011 16:52;EURUSD;Sell;1.42;1000;1

Note1:
Symbol field is used when the file contains ticker symbol names that are different from the current symbol names in your database.
Example:
The file references the following symbol: A.P
You have the following symbol in your database: A (Both symbols references the same stock)
To successfully import trades from this symbol, you have to set "Name1" field to "A.P" and then use "Name1" as Symbol field in the "Import Trades" form.

Simulation Report:

- Open a simulation report
- Select "Trades tab
- Select "Realized trades" or "Orders flow" tabs
- Select one or several trades (use CONTROL to select multiple trades)
- Right click (Keep pressing on CONTROL if you have selected many trades)
- Click on "Add all trades to a portfolio" or "Add selected trades to a portfolio"
- Select a portfolio then click on "Load Selected Item"


Optimizer

1. Introduction

The optimizer is a plug-in that uses artificial intelligence algorithms to optimize rules, ranking systems, trading systems and prediction items.

2. Optimizer algorithms

The plug-in provides two algorithms:

  • Genetic algorithm
  • Population-based incremental learning

Example:

Take a list of rules with 1000 rules.
For these rules, we have more than billions of combination which will take years to back-test.
Optimization algorithms are used to find good solutions among all the combinations in a short period.

2.1. Genetic algorithm

These are the genetic algorithm parameters:

  • Number of generation
  • Population size
  • Selection method: Elite, Rank or Roulette
  • Crossover rate
  • Mutation rate
  • Random selection portion

http://en.wikipedia.org/wiki/Genetic_algorithm

2.2. PBIL algorithm

These are the PBIL algorithm parameters:

  • Number of generation
  • Population size
  • Learning rate
  • Number of best solutions to use in learning

  • Enable multithreading: Check this field to enable multithreading during the optimization (This will allow QuantShare to use all available CPUs instead of a single one)

http://en.wikipedia.org/wiki/Population-based_incremental_learning

3. Optimize items

3.1. Optimize list of rules

Search for the best combination of rules among a list of rules.

  • In the 'Optimizer' form, click on 'Create'
  • Select the optimization algorithm and 'List of Rules' in the 'What do you want to optimize?" list box
  • Click on 'Next'
  • Update the algorithm settings
  • Click on 'Next'
  • Select the number of rules
  • Select a list of rules, by clicking on 'Select rules'.
  • For list of rules, select whether to always include the current rule or not by checking or un-checking 'Always visible' checkbox
  • Select the output
  • Define a fitness formula
  • Click on 'Next'
  • Select the number of items to keep in the report
  • Select the symbols the optimizer will use
  • Click on 'Next'
  • The optimizer item will now appears in the optimize manager.

Example:
List of rules contains 100 rules, from rule1 to rule100.

The optimizer will try to find good combination of rules.
The result will look like this:

Formula | Fitness
Rule87 && rule3 | 0.9
Rule12 && rule2 | 0.76
Rule33 | 0.66
Rule67 && Rule32 && Rule2 | 0.5

Fitness could be the return of the symbol or something else; it depends on the 'Fitness' formula.

3.2. Optimize ranking system

Try to find which combination of nodes and nodes' weight gives the best fitness score for the ranking system.

  • In the 'Optimizer' form, click on 'Create'
  • Select the optimization algorithm and 'Ranking System' in the 'What do you want to optimize?" list box
  • Click on 'Next'
  • Update the algorithm settings
  • Click on 'Next'
  • Select a ranking system by clicking on 'Select a ranking system'
  • Select the number of buckets and the rebalance period
  • Choose whether to optimize nodes' weight by checking or un-checking 'Optimize node weights' checkbox
  • Type a fixed rule if you want to use a fixed rule in the ranking system evaluation
  • Select the output
  • Define a fitness formula
  • Click on 'Next'
  • Select the number of items to keep in the report
  • Select the symbols the optimizer will use
  • Click on 'Next'
  • The optimizer item will now appears in the optimize manager.

3.3. Optimize trading system

When optimizing a trading system, you can either optimize list of rules and then include these rules as buy, sell, short and cover rules or you can update directly a trading system formula.

Next to "How to optimize trading system?", choose:

Using optimize variables in a formula: To specify a trading system with optimizable variables (formula, settings and money management). This looks like the exhaustive optimization but instead of trying every combination, the optimizer will use the PBIL or Genetic Algorith to speed up the optimization process

Using buy & sell list of rules: To enter several list of rules and then having the optimizer try different combinations of rules and choosing the ones that maximum the fitness function.

  • In the 'Optimizer' form, click on 'Create'
  • Select the optimization algorithm and 'Trading System' in the 'What do you want to optimize?" list box
  • Click on 'Next'
  • Update the algorithm settings
  • Click on 'Next'
  • Select the number of buy and sell rules
  • For each buy and sell rule, select a list of rules by clicking on 'Select rules'
  • For each buy and sell rule, select whether to always include this rule or not by checking or un-checking 'Always visible' checkbox
  • Define a fitness formula
  • On the 'Settings' tab, type a fixed buy rule and a fixed sell rule if you want to include fixed rules in your trading system
  • Select 'Optimization', to include capital and stops optimizable variables
  • Click on 'Next'
  • Select the number of items to keep in the report
  • Select the symbols the optimizer will use
  • Click on 'Next'
  • The optimizer item will now appears in the optimize manager.

3.4. Optimize prediction item

Try to find which prediction item leads to a better prediction accuracy given a list of inputs.

  • In the 'Optimizer' form, click on 'Create'
  • Select the optimization algorithm and 'Prediction Model' in the 'What do you want to optimize?" list box
  • Click on 'Next'
  • Update the algorithm settings
  • Click on 'Next'
  • Select a prediction item then click on 'Load Inputs'
  • Update the prediction item if necessary by clicking on 'Update Item'
  • Select the input that will always be used in iterations by checking them (Fixed inputs)
  • Define a fitness formula
  • Click on 'Next'
  • Select the number of items to keep in the report
  • Select the symbols the optimizer will use
  • Click on 'Next'
  • The optimizer item will now appears in the optimize manager.

3.5. Notifications

On the last screen, click on "Define Notifications" to bring the notifications control.

There you can specify how you want to be notified when the AI optimizer completes its work.

Popup Message: Displays a popup message

Chart Message: Displays a message on the active chart

Play Sound: Plays a specific sound file

Speech: Translates text into spoken works

Send Email: Sends an email to a specific address

Execute Script: Executes a specific script

For more information about the different options, please check the "Alerts Tool" topic.

4. Optimize manager

The 'Optimize manager' list all optimize items (AI -> Optimizer)

To create an optimize item, click on 'Create'.
To remove an optimize item, click on 'Delete'.
To update an optimize item, click on 'Update'.

To load the optimizer report, click on 'Report'.
To start an optimize item, click either on 'Run' or on 'Run...'

Running an optimize item indefinitely, using 'Run...', means that when the optimizer reach the maximum number of generation or the fitness value converge, the software re-run the optimize item and increase the value of 'Turn' by one.

5. Turn

If you run an optimize item multiple times, you may end up each time with different results.
This is because the optimizer algorithms do not look for all combinations but instead try to find good solutions in a short period.
This is why we introduced the concept of 'Turn'.
The optimizer report includes the best items for all the turns (not only the last turn)..

6. In/Out of Sample Testing

In the right panel of the AI optimizer report, you can perform out-of-sample testing (If we consider that the analyzed period is the in-sample period).

- Click on "Settings"
- Select the securities to analyze in the out-of-sample testing
- Select the out-of-sample period
- Click on "Start" to begin the analysis

This will create three additional columns in the report table.
In-Sample Fitness: The original fitness value (measure) of each chromosome
Out-of-Sample Fitness: The new fitness value calculated based on the out-of-sample period and symbols
Gain: The difference between the in-sample and out-of-sample fitness values


Artificial Intelligence

Artificial intelligence is a plug-in that let you build prediction model using neural network and SVM (Support vector machine) systems.

1. Neural Networks

http://en.wikipedia.org/wiki/Neural_network

2. Create a prediction model

To create a prediction model, open the 'prediction model' form (Click on 'AI' then 'Prediction'), in the new form, click on 'Add'.
The prediction model has many settings; those settings will help you fine-tune your model.

3. Learning, validation and testing periods

Each prediction model must have three periods.

The first period or the learning period is used to train the model.
The second period or the validation period is used to choose the best model among all the generated models.
The third period or the testing period is used to test the model with new data. (Data on which the model was not trained)
Note that the model is trained only with data from the learning period.

To change the learning, validation and testing periods, click on the triangles and move them.

4. Learning and validation samples

There are two options:

Normal: The first bars (depending on the learning period) will be associated to the learning samples, and then the next bars will be associated with the validation samples.
Random: The learning and validation periods will be merged and the learning and validation samples will be chosen randomly.

5. Periodicity

This option let you choose the period that the prediction item will use.

6. Inputs

Inputs are time-series that will be used to train the prediction item.
This is probably the most important step in the creation of the prediction item.

Add a new input by clicking on 'Add'.

Columns:

  • Select: The select checkbox indicate whether to enable or disable the current input
  • Input Type: Select the input type you would like to use.
  • Input: Display information about the input time-series.

· Settings: Define settings related to the input you have selected

· WS: Let you create multiple inputs from this input.
Example: if you create 'close' as input and set WS to two, the system will create two time-series. The first one is 'close' and the second one is 'close one bar ago' or 'ref (close, 1)'.

· Lag: Let you specify the lag to include for the input.
Example: if you create 'close' as input and set Lag to 3, the system will create the following input 'close three bar ago' or 'ref(close, 3)'.

· Preprocessing: Let you select the pre-processing calculation that will be applied to the input.

· R: This button is used to remove the selected input.

Input Types:

  • Symbol Field: You can choose between open, high, low, close or volume times-series.
  • Symbol Return: This creates a formula that returns the performance of one of these time-series: open, high, low, close, volume.
  • Formula: This lets you build your own time-series using the formula editor.
  • Extern Symbol: This lets you create a time-series based on an external symbol data.
  • Database Field: This lets you create a time-series from a field database.

7. Output

The output is the time-series that will be predicted.
You can predict a symbol price, a symbol returns or any other time-series.

The output has the same settings as inputs.

The 'WS' column doesn't exists in the output settings.
You can create only one output.

8. Neural network model settings

A neural network model has different settings that can dramatically improve or reduce the performance of the prediction model.

9. Network

A neural network model is composed of one input layer, one output layer and zero, one or many hidden layers.
Click on the circles to select a layer.

Network settings:

  • Annealing Epoch: The epoch at which the learning rate increase or decrease is performed
  • Jitter Epoch: The epoch at which the Jitter is performed. Jitter is the process of adding small random noise to weights of all synapses at regular intervals in order to get the network out of a potential local minimum
  • Learning Rate Increase Factor: Let the network learn faster in order to improve the global error, value should lies between 1.00 and 1.03
  • Learning Rate Decrease Factor: Let the network learn slower in order to improve the global error, value should lies between 0.97 and 1.00

Input layer:
The input layer is the first layer of the neural network model.
The number of inputs determines the number of nodes for this layer.

Hidden layers:
Hidden layers are layers that are always between the input and the output layer.

Output layer:
The output layer is the last layer of the neural network model.
There is only one node in the output layer.
The value that leaves this layer is the predicted value.

Layer settings:

· Transfer function: Activation or transfer function in a back propagation network defines the way to obtain output of a neuron given the collective input from source synapses.

· Learning rate: Learning rate is one of the parameters that govern how fast a neural network learns and how effective the training is.

  • Momentum: Momentum term associated with each synapse represents its tendency to retain its previous weight change. This factor varies from zero to one.
  • Max Jitter: The maximum limit to the random noise added to weights while Jitter, Jitter is the process of adding small random noise to weights of all synapses at regular intervals in order to get the network out of a potential local minimum.
  • Weight Decay: Each time the neural network is trained, the weights of synapses are multiplied by this 'Weight Decay'. Weight decay value is usually between 0.9 and 1.

10. Filter

The filter lets you create a formula that will be used to reject certain bars from the learning process.
Example: If you want to reject bars where the volume was insignificant then type something like this: 'volume < 100'.

11. Symbols

Select the symbols that will be used in the learning process.

12. Stop training settings

Specify when to stop the training, there are three options:

  • By error value: Stop when the error value reaches a certain level.
  • By error change: Stop when the error change goes below a certain value for a determined number of iterations.
  • By iterations: Stop after a specific number of iterations.

13. Selecting the best model

Select the model that will be used in prediction among all the models created during the training.

Type: Select the model based on one of these values:

Network Error:

  • MSE (Root mean square error)
  • POCID (Directional accuracy)
  • POCD (Prediction sign accuracy)
  • UTHEIL (Coefficient U de Theil)

Track on set: Choose whether to select the best model among the training models or the validation models.

14. Train a model

In the 'Prediction' form, select an item then click on 'Train', the 'Prediction Progress' form appears.

The blue line refers to the iteration that produced the best prediction model depending on your settings.

15. Prediction

In the 'Prediction' form, select an item then click on the small arrow next to 'Predict'.
You have the choice to choose between 'Predict' and 'Predict a value'.

15.1. Predict

This option gives you the ability to predict values for a range of dates.

15.2. Predict a value

This option gives you the ability to predict a value for a specific date.

16. Re-Training

You have the possibility to re-train a prediction model on new data. To do so, click on 'Re-Train' button in the 'Prediction' form.

16.1. Re-Training Settings

Re-Training Settings lets you choose the range of dates and the learning and validation samples that will be used for the re-training.

17. Update a model

In the 'Prediction' form, select an item then click on 'Update'.
You will lose the data of the prediction model if you update the latter.

18. Re-initialize a model

Click on 'Reinitialize Model' in the 'Prediction' form to delete the date of the model.

19. Access a model from a formula

Two functions let you access a model data from a formula:

Predict("category name", "model name") ;

Returns a time-series that contains the prediction values.

PredictSymbol("category name", "model name") ;

Returns '1' if the prediction model was trained using the current symbol, otherwise returns '0'.


Portfolio123

1. Introduction

Portfolio123 is a service that lets you create ranking system models based on fundamental and technical items.
Porfolio123 database contains more than 4000 fundamental ratios for all US companies. For more info, visit their website on www.portfolio123.com.
This plug-in lets Portfolio123 subscribers import factors, formulas and ranking system data.

2. Import a ranking system

  • Open the Portfolio123 plug-in (Extern->Portfolio123)
  • Select 'Settings' tab, make sure you have inserted your portfolio123 login and password.
  • Select 'RS' tab
  • Click on 'Load' if no ranking systems appear
  • Select a ranking system
  • Type in a name in the 'Name' text box
  • Click on 'Create Item'
  • Switch to 'P123' tab, your newly created item appears there.

3. Create a factor

  • Open the Portfolio123 plug-in (Extern->Portfolio123)
  • Select 'F&F' tab
  • Check the radio box 'Factor'
  • Select a factor (select a category then a factor)
  • Set the factor settings (lower or higher, rank vs.)
  • Click on 'Create Item'
  • Switch to 'P123' tab, your newly create item appears there.

4. Create a function

  • Open the Portfolio123 plug-in (Extern->Portfolio123)
  • Select 'F&F' tab
  • Check the radio box 'Formula'
  • Type a formula then type the formula name
  • Set the formula settings (lower or higher, rank vs.)
  • Click on 'Create Item'
  • Switch to 'P123' tab, your newly create item appears there.

5. Download Portfolio123 data

  • Open the Portfolio123 plug-in (Extern->Portfolio123)
  • Select 'P123' tab
  • Check the items you want to download
  • Select the start date and the end date
  • Click on 'Start download'

If you want to start the download from the last update date, click on 'Download Missing Dates' instead of 'Start download'.


Function - NBGROUPS

NBGROUPS
 Number of groups

Application Info

SYNTAX | NbGroups()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of groups
ADDITIONAL INFO |
EXAMPLE | NbGroups()


Function - NBINDEXES

NBINDEXES
 Number of indices

Application Info

SYNTAX | NbIndexes()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of indexes
ADDITIONAL INFO |
EXAMPLE | NbIndexes()


Function - NBINDUSTRIES

NBINDUSTRIES
 Number of industries

Application Info

SYNTAX | NbIndustries()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of industries
ADDITIONAL INFO |
EXAMPLE | NbIndustries()


Function - NBINGROUP

NBINGROUP
 Number of symbols in the specified group

Application Info

SYNTAX | NbInGroup( ARRAY group name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of symbols that are included in the specified group
ADDITIONAL INFO |
EXAMPLE | NbInGroup("Stock")


Function - NBININDEX

NBININDEX
 Number of symbols in the specified index

Application Info

SYNTAX | NbInIndex( ARRAY index name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of symbols that are included in the specified index
ADDITIONAL INFO |
EXAMPLE | NbInIndex("SP500")


Function - NBININDUSTRY

NBININDUSTRY
 Number of symbols in the specified industry

Application Info

SYNTAX | NbInIndustry( ARRAY industry name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of symbols that are included in the specified industry
ADDITIONAL INFO |
EXAMPLE | NbInIndustry("Drug Stores")


Function - NBINMARKET

NBINMARKET
 Number of symbols in the specified market

Application Info

SYNTAX | NbInMarket( ARRAY market name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of symbols that are included in the specified market
ADDITIONAL INFO |
EXAMPLE | NbInMarket("NASDQ")


Function - NBINSECTOR

NBINSECTOR
 Number of symbols in the specified sector

Application Info

SYNTAX | NbInSector( ARRAY sector name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of symbols that are included in the specified sector
ADDITIONAL INFO |
EXAMPLE | NbInSector("Services")


Function - NBMARKETS

NBMARKETS
 Number of markets

Application Info

SYNTAX | NbMarkets()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of markets
ADDITIONAL INFO |
EXAMPLE | NbMarkets()


Function - NBSECTORS

NBSECTORS
 Number of sectors

Application Info

SYNTAX | NbSectors()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of sectors
ADDITIONAL INFO |
EXAMPLE | NbSectors()


Function - CDL2CROWS

CDL2CROWS
 Two Crows

Candlestick Pattern

SYNTAX | Cdl2crows()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Two Crows, The Two Crows Pattern is a 3-day pattern.
ADDITIONAL INFO | Signal: Bearish Pattern: Reversal Reliability: Medium During an uptrend we see the market closing lower after an opening gap. Then we see a black day that fills the gap creating the Bearish Two Crows Pattern. It suggests the erosion of the uptrend, and warns about a possible trend reversal.
EXAMPLE | Cdl2crows()


Function - CDL2CROWS

CDL2CROWS
 Two Crows

Candlestick Pattern

SYNTAX | Cdl2crows( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Two Crows, The Two Crows Pattern is a 3-day pattern.
ADDITIONAL INFO | Signal: Bearish Pattern: Reversal Reliability: Medium During an uptrend we see the market closing lower after an opening gap. Then we see a black day that fills the gap creating the Bearish Two Crows Pattern. It suggests the erosion of the uptrend, and warns about a possible trend reversal.
EXAMPLE | Cdl2crows(open, high, low, close)


Function - CDL3BLACKCROWS

CDL3BLACKCROWS
 Three Black Crows

Candlestick Pattern

SYNTAX | Cdl3blackcrows()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Black Crows, The Three Black Crows got their name from the resemblance of three crows looking down from their perch from a tree.
ADDITIONAL INFO | Signal: Bearish Pattern: reversal Reliability: high Three long black days with each successive open being within the body of the previous day and each successive close being below the previous day's and near the day's low.
EXAMPLE | Cdl3blackcrows()


Function - CDL3BLACKCROWS

CDL3BLACKCROWS
 Three Black Crows

Candlestick Pattern

SYNTAX | Cdl3blackcrows( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Black Crows, The Three Black Crows got their name from the resemblance of three crows looking down from their perch from a tree.
ADDITIONAL INFO | Signal: Bearish Pattern: reversal Reliability: high Three long black days with each successive open being within the body of the previous day and each successive close being below the previous day's and near the day's low.
EXAMPLE | Cdl3blackcrows(open, high, low, close)


Function - CDL3INSIDE

CDL3INSIDE
 Three Inside Up/Down

Candlestick Pattern

SYNTAX | Cdl3inside()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Inside Up/Down, Note that after the long candle day that is in the same direction of the trend that the Harami pattern occurs.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high A bullish Harami pattern is followed by a white day that has a higher close than the second day.
EXAMPLE | Cdl3inside()


Function - CDL3INSIDE

CDL3INSIDE
 Three Inside Up/Down

Candlestick Pattern

SYNTAX | Cdl3inside( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Inside Up/Down, Note that after the long candle day that is in the same direction of the trend that the Harami pattern occurs.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high A bullish Harami pattern is followed by a white day that has a higher close than the second day.
EXAMPLE | Cdl3inside(open, high, low, close)


Function - CDL3LINESTRIKE

CDL3LINESTRIKE
 Three-Line Strike

Candlestick Pattern

SYNTAX | Cdl3linestrike()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three-Line Strike : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Three Line Strike Bullish Signal: Bullish Pattern: continuation Reliability: low Identification Three long white days with consecutively higher closes are followed by a fourth day that gaps open in the direction of the trend and closes below the open of the first day. Three Line Strike Bearish Signal: Bearish Pattern: continuation Reliability: low Identification Three long black days with consecutively lower closes is followed by a fourth day that gaps in the direction of the trend and closes above the open of the first day.
EXAMPLE | Cdl3linestrike()


Function - CDL3LINESTRIKE

CDL3LINESTRIKE
 Three-Line Strike

Candlestick Pattern

SYNTAX | Cdl3linestrike( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three-Line Strike : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Three Line Strike Bullish Signal: Bullish Pattern: continuation Reliability: low Identification Three long white days with consecutively higher closes are followed by a fourth day that gaps open in the direction of the trend and closes below the open of the first day. Three Line Strike Bearish Signal: Bearish Pattern: continuation Reliability: low Identification Three long black days with consecutively lower closes is followed by a fourth day that gaps in the direction of the trend and closes above the open of the first day.
EXAMPLE | Cdl3linestrike(open, high, low, close)


Function - CDL3OUTSIDE

CDL3OUTSIDE
 Three Outside Up/Down

Candlestick Pattern

SYNTAX | Cdl3outside()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Outside Up/Down : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Three Outside Down Signal: Bearish Pattern: reversal Reliability: high Identification A bearish Engulfing pattern is followed by a black day whose close is lower than the second day. Three Outside Up Signal: Bullish Pattern: reversal Reliability: high Identification A bullish Engulfing pattern is followed by a white day whose close is higher than the second day.
EXAMPLE | Cdl3outside()


Function - CDL3OUTSIDE

CDL3OUTSIDE
 Three Outside Up/Down

Candlestick Pattern

SYNTAX | Cdl3outside( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Outside Up/Down : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Three Outside Down Signal: Bearish Pattern: reversal Reliability: high Identification A bearish Engulfing pattern is followed by a black day whose close is lower than the second day. Three Outside Up Signal: Bullish Pattern: reversal Reliability: high Identification A bullish Engulfing pattern is followed by a white day whose close is higher than the second day.
EXAMPLE | Cdl3outside(open, high, low, close)


Function - CDL3STARSINSOUTH

CDL3STARSINSOUTH
 Three Stars In The South

Candlestick Pattern

SYNTAX | Cdl3staRsinsouth()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Stars In The South, The slow down of the trend is visually obvious.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: moderate A long black day with a long lower shadow is followed by a similar but smaller black day whose lower shadow is shallower than the first day. The third day is a small Black Marubozu (open is the high of the day and the close is the low of the day) that lies within the second day�s trading range.
EXAMPLE | Cdl3staRsinsouth()


Function - CDL3STARSINSOUTH

CDL3STARSINSOUTH
 Three Stars In The South

Candlestick Pattern

SYNTAX | Cdl3staRsinsouth( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Stars In The South, The slow down of the trend is visually obvious.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: moderate A long black day with a long lower shadow is followed by a similar but smaller black day whose lower shadow is shallower than the first day. The third day is a small Black Marubozu (open is the high of the day and the close is the low of the day) that lies within the second day�s trading range.
EXAMPLE | Cdl3staRsinsouth(open, high, low, close)


Function - CDL3WHITESOLDIERS

CDL3WHITESOLDIERS
 Three Advancing White Soldiers

Candlestick Pattern

SYNTAX | Cdl3whitesoldiers()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Advancing White Soldiers, The Three White Soldiers (also known as The Advancing Three White Soldiers) is a healthy market reversal pattern.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high Three long white days with each successive open being within the body of the previous day and each successive close being higher than the previous day and near the day�s high.
EXAMPLE | Cdl3whitesoldiers()


Function - CDL3WHITESOLDIERS

CDL3WHITESOLDIERS
 Three Advancing White Soldiers

Candlestick Pattern

SYNTAX | Cdl3whitesoldiers( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Three Advancing White Soldiers, The Three White Soldiers (also known as The Advancing Three White Soldiers) is a healthy market reversal pattern.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high Three long white days with each successive open being within the body of the previous day and each successive close being higher than the previous day and near the day�s high.
EXAMPLE | Cdl3whitesoldiers(open, high, low, close)


Function - CDLABANDONEDBABY

CDLABANDONEDBABY
 Abandoned Baby

Candlestick Pattern

SYNTAX | CdlAbandonedbaby( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Abandoned Baby, A rare reversal pattern characterized by a gap followed by a Doji, which is then followed by another gap in the opposite direction.
ADDITIONAL INFO | Abandoned Baby Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a Doji that gaps in the direction of the trend. Then a black day occurs gapping in the opposite direction with no overlapping shadows. Abandoned Baby Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a Doji that gaps in the direction of the trend. Then a white day occurs gapping in the opposite direction with no overlapping shadows.
EXAMPLE | CdlAbandonedbaby(14)


Function - CDLABANDONEDBABY

CDLABANDONEDBABY
 Abandoned Baby

Candlestick Pattern

SYNTAX | CdlAbandonedbaby( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Abandoned Baby, A rare reversal pattern characterized by a gap followed by a Doji, which is then followed by another gap in the opposite direction.
ADDITIONAL INFO | Abandoned Baby Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a Doji that gaps in the direction of the trend. Then a black day occurs gapping in the opposite direction with no overlapping shadows. Abandoned Baby Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a Doji that gaps in the direction of the trend. Then a white day occurs gapping in the opposite direction with no overlapping shadows.
EXAMPLE | CdlAbandonedbaby(open, high, low, close, 14)


Function - CDLADVANCEBLOCK

CDLADVANCEBLOCK
 Advance Block

Candlestick Pattern

SYNTAX | CdlAdvanceblock()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Advance Block, The Advance Block is somewhat indicative as the Three White Soldiers but it is a bearish signal.
ADDITIONAL INFO | Signal: Bearish Pattern: reversal Reliability: moderate Three white days. Each successive day opens within the body of the previous day and closes above the previous day. The bodies of the candles get progressively smaller with the upper shadows of day 2 and 3 getting progressively longer.
EXAMPLE | CdlAdvanceblock()


Function - CDLADVANCEBLOCK

CDLADVANCEBLOCK
 Advance Block

Candlestick Pattern

SYNTAX | CdlAdvanceblock( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Advance Block, The Advance Block is somewhat indicative as the Three White Soldiers but it is a bearish signal.
ADDITIONAL INFO | Signal: Bearish Pattern: reversal Reliability: moderate Three white days. Each successive day opens within the body of the previous day and closes above the previous day. The bodies of the candles get progressively smaller with the upper shadows of day 2 and 3 getting progressively longer.
EXAMPLE | CdlAdvanceblock(open, high, low, close)


Function - CDLBELTHOLD

CDLBELTHOLD
 Belt-hold

Candlestick Pattern

SYNTAX | CdlBelthold()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Belt-hold, The Belt Hold lines are formed by single candlesticks.
ADDITIONAL INFO | Belt Hold Bearish Signal: Bearish Pattern: reversal Reliability: low Identification A black day occurs with no upper shadow and a close near the day's low. Belt Hold Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A white day occurs with no lower shadow and a close near the day�s high.
EXAMPLE | CdlBelthold()


Function - CDLBELTHOLD

CDLBELTHOLD
 Belt-hold

Candlestick Pattern

SYNTAX | CdlBelthold( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Belt-hold, The Belt Hold lines are formed by single candlesticks.
ADDITIONAL INFO | Belt Hold Bearish Signal: Bearish Pattern: reversal Reliability: low Identification A black day occurs with no upper shadow and a close near the day's low. Belt Hold Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A white day occurs with no lower shadow and a close near the day�s high.
EXAMPLE | CdlBelthold(open, high, low, close)


Function - CDLBREAKAWAY

CDLBREAKAWAY
 Breakaway

Candlestick Pattern

SYNTAX | CdlBreakaway()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Breakaway, If a trend has been evident, the breakaway pattern, whether bullish or bearish initially indicates the acceleration of that trend.
ADDITIONAL INFO | Bullish Breakaway Signal: Bullish Pattern: Reversal Reliability: Medium Identification There is a downtrend but we also see that the prices bottom out and level off now. The result is a long white candlestick that however does not close the initial downward gap of the first and second days. This suggests a short-term reversal. Bearish Breakaway Signal: Bearish Pattern: Reversal Reliability: Medium Identification We see this pattern during an uptrend marked with a bullish surge that eventually weakens. This weakening is illustrated by a long black candlestick that is unable to close the gap into the body of the first day. These events warn us about a short-term reversal.
EXAMPLE | CdlBreakaway()


Function - CDLBREAKAWAY

CDLBREAKAWAY
 Breakaway

Candlestick Pattern

SYNTAX | CdlBreakaway( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Breakaway, If a trend has been evident, the breakaway pattern, whether bullish or bearish initially indicates the acceleration of that trend.
ADDITIONAL INFO | Bullish Breakaway Signal: Bullish Pattern: Reversal Reliability: Medium Identification There is a downtrend but we also see that the prices bottom out and level off now. The result is a long white candlestick that however does not close the initial downward gap of the first and second days. This suggests a short-term reversal. Bearish Breakaway Signal: Bearish Pattern: Reversal Reliability: Medium Identification We see this pattern during an uptrend marked with a bullish surge that eventually weakens. This weakening is illustrated by a long black candlestick that is unable to close the gap into the body of the first day. These events warn us about a short-term reversal.
EXAMPLE | CdlBreakaway(open, high, low, close)


Function - CDLCLOSINGMARUBOZU

CDLCLOSINGMARUBOZU
 Closing Marubozu

Candlestick Pattern

SYNTAX | CdlClosingmarubozu()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Closing Marubozu, a Closing Marubozu has no shadow at it's closing end.
ADDITIONAL INFO | Black Closing marubozu Signal: Bearish Pattern: Reversal/Continuation Reliability: Low Identification: The Black Closing Marubozu is a single candlestick pattern characterized by its long black body. It does not have a lower shadow but it has an upper shadow. It is an extremely strong bearish candlestick pattern. White Closing Marubozu Signal: Bullish Pattern: Reversal/Continuation Reliability: Low Identification: The White Closing Marubozu is a single candlestick pattern characterized by a long white body with no upper shadow. This is an extremely strong bullish candlestick pattern.
EXAMPLE | CdlClosingmarubozu()


Function - CDLCLOSINGMARUBOZU

CDLCLOSINGMARUBOZU
 Closing Marubozu

Candlestick Pattern

SYNTAX | CdlClosingmarubozu( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Closing Marubozu, a Closing Marubozu has no shadow at it's closing end.
ADDITIONAL INFO | Black Closing marubozu Signal: Bearish Pattern: Reversal/Continuation Reliability: Low Identification: The Black Closing Marubozu is a single candlestick pattern characterized by its long black body. It does not have a lower shadow but it has an upper shadow. It is an extremely strong bearish candlestick pattern. White Closing Marubozu Signal: Bullish Pattern: Reversal/Continuation Reliability: Low Identification: The White Closing Marubozu is a single candlestick pattern characterized by a long white body with no upper shadow. This is an extremely strong bullish candlestick pattern.
EXAMPLE | CdlClosingmarubozu(open, high, low, close)


Function - CDLCONCEALBABYSWALL

CDLCONCEALBABYSWALL
 Concealing Baby Swallow

Candlestick Pattern

SYNTAX | CdlConcealbabyswall()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Concealing Baby Swallow, The first two days of the signal, two Black Marubozus, demonstrate the continuation of the downtrend.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high The first two days are Black Marubozu days (open is the high of the day and the close is the low of the day). The following day is a black day that gaps in the same direction but trades up into the body of the second day. The final day is a Black Marubozu that gaps up and sells off to engulf the third day.
EXAMPLE | CdlConcealbabyswall()


Function - CDLCONCEALBABYSWALL

CDLCONCEALBABYSWALL
 Concealing Baby Swallow

Candlestick Pattern

SYNTAX | CdlConcealbabyswall( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Concealing Baby Swallow, The first two days of the signal, two Black Marubozus, demonstrate the continuation of the downtrend.
ADDITIONAL INFO | Signal: Bullish Pattern: reversal Reliability: high The first two days are Black Marubozu days (open is the high of the day and the close is the low of the day). The following day is a black day that gaps in the same direction but trades up into the body of the second day. The final day is a Black Marubozu that gaps up and sells off to engulf the third day.
EXAMPLE | CdlConcealbabyswall(open, high, low, close)


Function - CDLCOUNTERATTACK

CDLCOUNTERATTACK
 Counterattack Lines

Candlestick Pattern

SYNTAX | CdlCounterattack()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Counterattack, Meeting Lines (or Counterattack Lines) are formed when opposite coloured bodies have the same closing price.
ADDITIONAL INFO | A counter attack pattern is formed when opposite colour candles share the same clse. This two candle pattern can be bullish or bearish depending where the pattern appears. The counter attack pattern warns that the tide is turning.
EXAMPLE | CdlCounterattack()


Function - CDLCOUNTERATTACK

CDLCOUNTERATTACK
 Counterattack Lines

Candlestick Pattern

SYNTAX | CdlCounterattack( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Counterattack, Meeting Lines (or Counterattack Lines) are formed when opposite coloured bodies have the same closing price.
ADDITIONAL INFO | A counter attack pattern is formed when opposite colour candles share the same clse. This two candle pattern can be bullish or bearish depending where the pattern appears. The counter attack pattern warns that the tide is turning.
EXAMPLE | CdlCounterattack(open, high, low, close)


Function - CDLDARKCLOUDCOVER

CDLDARKCLOUDCOVER
 Dark Cloud Cover

Candlestick Pattern

SYNTAX | CdlDarkcloudcover( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Dark Cloud Cover, The dark Cloud Cover is the bearish counterpart to the Piercing pattern.
ADDITIONAL INFO | Dark Cloud Cover Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a black day which gaps above the high of the white candle and then closes below the midpoint of the first day's body.
EXAMPLE | CdlDarkcloudcover(14)


Function - CDLDARKCLOUDCOVER

CDLDARKCLOUDCOVER
 Dark Cloud Cover

Candlestick Pattern

SYNTAX | CdlDarkcloudcover( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Dark Cloud Cover, The dark Cloud Cover is the bearish counterpart to the Piercing pattern.
ADDITIONAL INFO | Dark Cloud Cover Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a black day which gaps above the high of the white candle and then closes below the midpoint of the first day's body.
EXAMPLE | CdlDarkcloudcover(open, high, low, close, 14)


Function - CDLDOJI

CDLDOJI
 Doji

Candlestick Pattern

SYNTAX | CdlDoji()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Doji, the Doji is one of the most important signals in candlestick analysis.
ADDITIONAL INFO | Doji Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: If a security has virtually equal opening and closing prices, this leads to a Doji. The length of the upper and lower shadows of a Doji can vary and consequently the resulting candlestick may look like a cross, inverted cross or a plus sign. Doji, taken alone, is a neutral pattern.
EXAMPLE | CdlDoji()


Function - CDLDOJI

CDLDOJI
 Doji

Candlestick Pattern

SYNTAX | CdlDoji( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Doji, the Doji is one of the most important signals in candlestick analysis.
ADDITIONAL INFO | Doji Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: If a security has virtually equal opening and closing prices, this leads to a Doji. The length of the upper and lower shadows of a Doji can vary and consequently the resulting candlestick may look like a cross, inverted cross or a plus sign. Doji, taken alone, is a neutral pattern.
EXAMPLE | CdlDoji(open, high, low, close)


Function - CDLDOJISTAR

CDLDOJISTAR
 Doji Star

Candlestick Pattern

SYNTAX | CdlDojistar()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Doji Star, Upon seeing a Doji in an overbought or oversold condition, an extremely high probability reversal situation becomes evident.
ADDITIONAL INFO | Doji Star Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by a Doji that gaps in the direction of the trend. The shadows of the Doji should not be long. Doji Star Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A long white day is followed by a Doji that gaps in the direction of the trend. The shadows of the Doji should not be long.
EXAMPLE | CdlDojistar()


Function - CDLDOJISTAR

CDLDOJISTAR
 Doji Star

Candlestick Pattern

SYNTAX | CdlDojistar( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Doji Star, Upon seeing a Doji in an overbought or oversold condition, an extremely high probability reversal situation becomes evident.
ADDITIONAL INFO | Doji Star Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by a Doji that gaps in the direction of the trend. The shadows of the Doji should not be long. Doji Star Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A long white day is followed by a Doji that gaps in the direction of the trend. The shadows of the Doji should not be long.
EXAMPLE | CdlDojistar(open, high, low, close)


Function - CDLDRAGONFLYDOJI

CDLDRAGONFLYDOJI
 Dragonfly Doji

Candlestick Pattern

SYNTAX | CdlDragonflydoji()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Dragonfly Doji, The Dragonfly Doji occurs when trading opens, trades lower, then closes at the open price which is the high of the day.
ADDITIONAL INFO | Dragonfly Doji Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the upper end of a trading range with a long lower shadow (the longer the more bearish) with no, or almost no upper shadow. Dragonfly Doji Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the upper end of the trading range with a long lower shadow (the longer the more bullish).
EXAMPLE | CdlDragonflydoji()


Function - CDLDRAGONFLYDOJI

CDLDRAGONFLYDOJI
 Dragonfly Doji

Candlestick Pattern

SYNTAX | CdlDragonflydoji( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Dragonfly Doji, The Dragonfly Doji occurs when trading opens, trades lower, then closes at the open price which is the high of the day.
ADDITIONAL INFO | Dragonfly Doji Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the upper end of a trading range with a long lower shadow (the longer the more bearish) with no, or almost no upper shadow. Dragonfly Doji Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the upper end of the trading range with a long lower shadow (the longer the more bullish).
EXAMPLE | CdlDragonflydoji(open, high, low, close)


Function - CDLENGULFING

CDLENGULFING
 Engulfing Pattern

Candlestick Pattern

SYNTAX | CdlEngulfing()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Engulfing Pattern, Two of the most compelling candlestick signals are the Bullish Engulfing Pattern and Bearish Engulfing Pattern.
ADDITIONAL INFO | Engulfing Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A black day is completely �engulfed� by a large white day that gaps below the black day�s low and rallies to close above its high. Engulfing Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A white day is then completely �engulfed� by a large black day which gaps above the white day's high and closes below its low.
EXAMPLE | CdlEngulfing()


Function - CDLENGULFING

CDLENGULFING
 Engulfing Pattern

Candlestick Pattern

SYNTAX | CdlEngulfing( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Engulfing Pattern, Two of the most compelling candlestick signals are the Bullish Engulfing Pattern and Bearish Engulfing Pattern.
ADDITIONAL INFO | Engulfing Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A black day is completely �engulfed� by a large white day that gaps below the black day�s low and rallies to close above its high. Engulfing Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A white day is then completely �engulfed� by a large black day which gaps above the white day's high and closes below its low.
EXAMPLE | CdlEngulfing(open, high, low, close)


Function - CDLEVENINGDOJISTAR

CDLEVENINGDOJISTAR
 Evening Doji Star

Candlestick Pattern

SYNTAX | CdlEveningdojistar( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Evening Doji Star, A three day bearish reversal pattern similar to the Evening Star.
ADDITIONAL INFO | Evening Doji Star Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a Doji that gaps in the direction of the trend. The third day is a black day that closes in the bottom half of the white candle.
EXAMPLE | CdlEveningdojistar(14)


Function - CDLEVENINGDOJISTAR

CDLEVENINGDOJISTAR
 Evening Doji Star

Candlestick Pattern

SYNTAX | CdlEveningdojistar( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Evening Doji Star, A three day bearish reversal pattern similar to the Evening Star.
ADDITIONAL INFO | Evening Doji Star Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a Doji that gaps in the direction of the trend. The third day is a black day that closes in the bottom half of the white candle.
EXAMPLE | CdlEveningdojistar(open, high, low, close, 14)


Function - CDLEVENINGSTAR

CDLEVENINGSTAR
 Evening Star

Candlestick Pattern

SYNTAX | CdlEveningstar( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Evening Star, The Evening Star pattern is a top reversal signal.
ADDITIONAL INFO | Evening Star Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a small body that gaps in the direction of the trend. The third day is a black day that closes in the bottom half of the white candle.
EXAMPLE | CdlEveningstar(14)


Function - CDLEVENINGSTAR

CDLEVENINGSTAR
 Evening Star

Candlestick Pattern

SYNTAX | CdlEveningstar( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Evening Star, The Evening Star pattern is a top reversal signal.
ADDITIONAL INFO | Evening Star Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a small body that gaps in the direction of the trend. The third day is a black day that closes in the bottom half of the white candle.
EXAMPLE | CdlEveningstar(open, high, low, close, 14)


Function - CDLGAPSIDESIDEWHITE

CDLGAPSIDESIDEWHITE
 Up/Down-gap side-by-side white lines

Candlestick Pattern

SYNTAX | CdlGapsidesidewhite()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Up/Down-gap side-by-side white lines, The Up Side By Side White Lines Pattern appears in a bullish market.
ADDITIONAL INFO | Side By Side White Lines Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A black day is followed by a white day that gaps in the direction of the trend. The third candle is also white and is almost identical to the previous day. Side by Side White Lines Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A white day is followed by another white day that gaps in the direction of the trend. The third candle is also white and is almost identical to the previous day.
EXAMPLE | CdlGapsidesidewhite()


Function - CDLGAPSIDESIDEWHITE

CDLGAPSIDESIDEWHITE
 p Side By Side White Lines

Candlestick Pattern

SYNTAX | CdlGapsidesidewhite( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Up/Down-gap side-by-side white lines, The Up Side By Side White Lines Pattern appears in a bullish market.
ADDITIONAL INFO | Side By Side White Lines Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A black day is followed by a white day that gaps in the direction of the trend. The third candle is also white and is almost identical to the previous day. Side by Side White Lines Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A white day is followed by another white day that gaps in the direction of the trend. The third candle is also white and is almost identical to the previous day.
EXAMPLE | CdlGapsidesidewhite(open, high, low, close)


Function - CDLGRAVESTONEDOJI

CDLGRAVESTONEDOJI
 Gravestone Doji

Candlestick Pattern

SYNTAX | CdlGravestonedoji()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Gravestone Doji, The Gravestone Doji is formed when the open and the close occur at the low end of the trading range.
ADDITIONAL INFO | Gravestone Doji Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent. Gravestone Doji Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent.
EXAMPLE | CdlGravestonedoji()


Function - CDLGRAVESTONEDOJI

CDLGRAVESTONEDOJI
 Gravestone Doji

Candlestick Pattern

SYNTAX | CdlGravestonedoji( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Gravestone Doji, The Gravestone Doji is formed when the open and the close occur at the low end of the trading range.
ADDITIONAL INFO | Gravestone Doji Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent. Gravestone Doji Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A Doji forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent.
EXAMPLE | CdlGravestonedoji(open, high, low, close)


Function - CDLHAMMER

CDLHAMMER
 Hammer

Candlestick Pattern

SYNTAX | CdlHammer()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hammer, The Hammer is comprised of one candle.
ADDITIONAL INFO | Hammer Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the upper end of a trading range with a long lower shadow (the longer the more bullish) with no, or almost no upper shadow.
EXAMPLE | CdlHammer()


Function - CDLHAMMER

CDLHAMMER
 Hammer

Candlestick Pattern

SYNTAX | CdlHammer( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hammer, The Hammer is comprised of one candle.
ADDITIONAL INFO | Hammer Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the upper end of a trading range with a long lower shadow (the longer the more bullish) with no, or almost no upper shadow.
EXAMPLE | CdlHammer(open, high, low, close)


Function - CDLHANGINGMAN

CDLHANGINGMAN
 Hanging Man

Candlestick Pattern

SYNTAX | CdlHangingman()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hanging Man, The Hanging Man is also comprised of one candle.
ADDITIONAL INFO | Hanging Man Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the upper end of the trading range with a long lower shadow (the longer the more bearish) with no, or almost no upper shadow.
EXAMPLE | CdlHangingman()


Function - CDLHANGINGMAN

CDLHANGINGMAN
 Hanging Man

Candlestick Pattern

SYNTAX | CdlHangingman( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hanging Man, The Hanging Man is also comprised of one candle.
ADDITIONAL INFO | Hanging Man Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the upper end of the trading range with a long lower shadow (the longer the more bearish) with no, or almost no upper shadow.
EXAMPLE | CdlHangingman(open, high, low, close)


Function - CDLHARAMI

CDLHARAMI
 Harami Pattern

Candlestick Pattern

SYNTAX | CdlHarami()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Harami Pattern, The Harami is an often seen formation.
ADDITIONAL INFO | Harami Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A long black day is followed by a white day which gaps opposite the trend and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHarami()


Function - CDLHARAMI

CDLHARAMI
 Harami Pattern

Candlestick Pattern

SYNTAX | CdlHarami( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Harami Pattern, The Harami is an often seen formation.
ADDITIONAL INFO | Harami Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A long black day is followed by a white day which gaps opposite the trend and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHarami(open, high, low, close)


Function - CDLHARAMICROSS

CDLHARAMICROSS
 Harami Cross Pattern

Candlestick Pattern

SYNTAX | CdlHaramicross()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Harami Cross Pattern, A two day pattern similar to the Harami (see CDLHARAMI() ), the difference is that the last day is a Doji.
ADDITIONAL INFO | Harami Cross Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A long black day is followed by a Doji which gaps opposite the trend and is completely engulfed by the real body of the first day. Harami Cross Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A long white day is followed by a Doji that gaps down and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHaramicross()


Function - CDLHARAMICROSS

CDLHARAMICROSS
 Harami Cross Pattern

Candlestick Pattern

SYNTAX | CdlHaramicross( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Harami Cross Pattern, A two day pattern similar to the Harami (see CDLHARAMI() ), the difference is that the last day is a Doji.
ADDITIONAL INFO | Harami Cross Bullish Signal: Bullish Pattern: reversal Reliability: low Identification A long black day is followed by a Doji which gaps opposite the trend and is completely engulfed by the real body of the first day. Harami Cross Bearish Signal: Bearish Pattern: reversal Reliability: moderate Identification A long white day is followed by a Doji that gaps down and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHaramicross(open, high, low, close)


Function - CDLHIGHWAVE

CDLHIGHWAVE
 High-Wave Candle

Candlestick Pattern

SYNTAX | CdlHighwave()
RETURNS | NUMERIC ARRAY
DESCRIPTION | High-Wave Candle : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | High Wave Signal: Indecision Pattern: Reversal Reliability: Medium Identification: High Wave is a type of candlestick characterized with either a very long upper or a lower shadow. It has only a short real body. A group of these patterns may signal a market turn.
EXAMPLE | CdlHighwave()


Function - CDLHIGHWAVE

CDLHIGHWAVE
 High-Wave Candle

Candlestick Pattern

SYNTAX | CdlHighwave( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | High-Wave Candle : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | High Wave Signal: Indecision Pattern: Reversal Reliability: Medium Identification: High Wave is a type of candlestick characterized with either a very long upper or a lower shadow. It has only a short real body. A group of these patterns may signal a market turn.
EXAMPLE | CdlHighwave(open, high, low, close)


Function - CDLHIKKAKE

CDLHIKKAKE
 Hikkake Pattern

Candlestick Pattern

SYNTAX | CdlHikkake()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hikkake Pattern
ADDITIONAL INFO |
EXAMPLE | CdlHikkake()


Function - CDLHIKKAKE

CDLHIKKAKE
 Hikkake Pattern

Candlestick Pattern

SYNTAX | CdlHikkake( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hikkake Pattern
ADDITIONAL INFO |
EXAMPLE | CdlHikkake(open, high, low, close)


Function - CDLHIKKAKEMOD

CDLHIKKAKEMOD
 Modified Hikkake Pattern

Candlestick Pattern

SYNTAX | CdlHikkakemod()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Modified Hikkake Pattern
ADDITIONAL INFO |
EXAMPLE | CdlHikkakemod()


Function - CDLHIKKAKEMOD

CDLHIKKAKEMOD
 Modified Hikkake Pattern

Candlestick Pattern

SYNTAX | CdlHikkakemod( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Modified Hikkake Pattern
ADDITIONAL INFO |
EXAMPLE | CdlHikkakemod(open, high, low, close)


Function - CDLHOMINGPIGEON

CDLHOMINGPIGEON
 Homing Pigeon

Candlestick Pattern

SYNTAX | CdlHomingpigeon()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Homing Pigeon, The Homing Pigeon is the same as the Harami, except for the colour of the second day's body.
ADDITIONAL INFO | Homing Pigeon bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by another black day which gaps opposite the trend and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHomingpigeon()


Function - CDLHOMINGPIGEON

CDLHOMINGPIGEON
 Homing Pigeon

Candlestick Pattern

SYNTAX | CdlHomingpigeon( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Homing Pigeon, The Homing Pigeon is the same as the Harami, except for the colour of the second day's body.
ADDITIONAL INFO | Homing Pigeon bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by another black day which gaps opposite the trend and is completely engulfed by the real body of the first day.
EXAMPLE | CdlHomingpigeon(open, high, low, close)


Function - CDLIDENTICAL3CROWS

CDLIDENTICAL3CROWS
 Identical Three Crows

Candlestick Pattern

SYNTAX | CdlIdentical3crows()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Identical Three Crows, The Three Identical Crows have the same criteria as the Three Black Crows.
ADDITIONAL INFO | Identical Three Crows Bearish Signal: Bearish Pattern: reversal Reliability: high Identification Three black days with each day opening where the previous day closed.
EXAMPLE | CdlIdentical3crows()


Function - CDLIDENTICAL3CROWS

CDLIDENTICAL3CROWS
 Identical Three Crows

Candlestick Pattern

SYNTAX | CdlIdentical3crows( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Identical Three Crows, The Three Identical Crows have the same criteria as the Three Black Crows.
ADDITIONAL INFO | Identical Three Crows Bearish Signal: Bearish Pattern: reversal Reliability: high Identification Three black days with each day opening where the previous day closed.
EXAMPLE | CdlIdentical3crows(open, high, low, close)


Function - CDLINNECK

CDLINNECK
 In-Neck Pattern

Candlestick Pattern

SYNTAX | CdlInneck()
RETURNS | NUMERIC ARRAY
DESCRIPTION | In-Neck Pattern, The In Neck pattern is almost a Meeting Line pattern.
ADDITIONAL INFO | In Neck Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a long white day that gaps down at the open and closes at the same price as the black day.
EXAMPLE | CdlInneck()


Function - CDLINNECK

CDLINNECK
 In-Neck Pattern

Candlestick Pattern

SYNTAX | CdlInneck( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | In-Neck Pattern, The In Neck pattern is almost a Meeting Line pattern.
ADDITIONAL INFO | In Neck Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a long white day that gaps down at the open and closes at the same price as the black day.
EXAMPLE | CdlInneck(open, high, low, close)


Function - CDLINVERTEDHAMMER

CDLINVERTEDHAMMER
 Inverted Hammer

Candlestick Pattern

SYNTAX | CdlInvertedhammer()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Inverted Hammer, The Inverted Hammer is comprised of one candle.
ADDITIONAL INFO | Inverted Hammer Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the lower end of the trading range. The upper shadow is usually no more than twice as long as the real body and there is no or almost no lower shadow.
EXAMPLE | CdlInvertedhammer()


Function - CDLINVERTEDHAMMER

CDLINVERTEDHAMMER
 Inverted Hammer

Candlestick Pattern

SYNTAX | CdlInvertedhammer( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Inverted Hammer, The Inverted Hammer is comprised of one candle.
ADDITIONAL INFO | Inverted Hammer Bullish Signal: Bullish Pattern: reversal Reliability: low/moderate Identification A small real body forms at the lower end of the trading range. The upper shadow is usually no more than twice as long as the real body and there is no or almost no lower shadow.
EXAMPLE | CdlInvertedhammer(open, high, low, close)


Function - CDLKICKING

CDLKICKING
 Kicking

Candlestick Pattern

SYNTAX | CdlKicking()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kicking, The Kicker signal is the most powerful signal of all.
ADDITIONAL INFO | Kicking Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A White Marubuzo (opens at low and closes at high) is followed by a Black Marubuzo (opens at high and closes at low) that gaps down. Kicking Bullish Signal: Bullish Pattern: reversal Reliability: high Identification: A Black Marubuzo (open is the high of the day and the close is the low of the day) day is followed by a White Marubuzo (open is the low of the day and the close is the high of the day) day that gaps in the opposite direction.
EXAMPLE | CdlKicking()


Function - CDLKICKING

CDLKICKING
 Kicking

Candlestick Pattern

SYNTAX | CdlKicking( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kicking, The Kicker signal is the most powerful signal of all.
ADDITIONAL INFO | Kicking Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A White Marubuzo (opens at low and closes at high) is followed by a Black Marubuzo (opens at high and closes at low) that gaps down. Kicking Bullish Signal: Bullish Pattern: reversal Reliability: high Identification: A Black Marubuzo (open is the high of the day and the close is the low of the day) day is followed by a White Marubuzo (open is the low of the day and the close is the high of the day) day that gaps in the opposite direction.
EXAMPLE | CdlKicking(open, high, low, close)


Function - CDLKICKINGBYLENGTH

CDLKICKINGBYLENGTH
 Kicking - bull/bear

Candlestick Pattern

SYNTAX | CdlKickingbylength()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kicking - bull/bear determined by the longer marubozu, The Kicker signal is the most powerful signal of all.
ADDITIONAL INFO |
EXAMPLE | CdlKickingbylength()


Function - CDLKICKINGBYLENGTH

CDLKICKINGBYLENGTH
 Kicking - bull/bear

Candlestick Pattern

SYNTAX | CdlKickingbylength( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kicking - bull/bear determined by the longer marubozu, The Kicker signal is the most powerful signal of all.
ADDITIONAL INFO |
EXAMPLE | CdlKickingbylength(open, high, low, close)


Function - CDLLADDERBOTTOM

CDLLADDERBOTTOM
 Ladder Bottom

Candlestick Pattern

SYNTAX | CdlLadderbottom()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Ladder Bottom, The downtrend is finishing with four consecutive black candles, each closing lower than the previous day.
ADDITIONAL INFO | Ladder Bottom Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification Three black days with successive lower opens and lower closes. Then a black day forms with some noticeably upper shadow. The final day is a white day that gaps against the trend and opens above the body of the fourth day.
EXAMPLE | CdlLadderbottom()


Function - CDLLADDERBOTTOM

CDLLADDERBOTTOM
 Ladder Bottom

Candlestick Pattern

SYNTAX | CdlLadderbottom( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Ladder Bottom, The downtrend is finishing with four consecutive black candles, each closing lower than the previous day.
ADDITIONAL INFO | Ladder Bottom Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification Three black days with successive lower opens and lower closes. Then a black day forms with some noticeably upper shadow. The final day is a white day that gaps against the trend and opens above the body of the fourth day.
EXAMPLE | CdlLadderbottom(open, high, low, close)


Function - CDLLONGLEGGEDDOJI

CDLLONGLEGGEDDOJI
 Long Legged Doji

Candlestick Pattern

SYNTAX | CdlLongleggeddoji()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Long Legged Doji, The Long-legged Doji is composed of long upper and lower shadows.
ADDITIONAL INFO | Long Legged Doji Signal: Indecision Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is characterized by very long shadows. It is an important reversal signal. Bullish Long Legged Doji Signal: Bullish Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is a doji characterized with very long shadows. It shows the indecision of the buyers and sellers. It is one of the important reversal signals. Bearish Long Legged Doji Signal: Bearish Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is a doji characterized by very long shadows. It shows the indecision of the buyers and sellers and it is an important reversal signal.
EXAMPLE | CdlLongleggeddoji()


Function - CDLLONGLEGGEDDOJI

CDLLONGLEGGEDDOJI
 Long Legged Doji

Candlestick Pattern

SYNTAX | CdlLongleggeddoji( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Long Legged Doji, The Long-legged Doji is composed of long upper and lower shadows.
ADDITIONAL INFO | Long Legged Doji Signal: Indecision Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is characterized by very long shadows. It is an important reversal signal. Bullish Long Legged Doji Signal: Bullish Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is a doji characterized with very long shadows. It shows the indecision of the buyers and sellers. It is one of the important reversal signals. Bearish Long Legged Doji Signal: Bearish Pattern: Reversal Reliability: Medium Identification: Long Legged Doji is a doji characterized by very long shadows. It shows the indecision of the buyers and sellers and it is an important reversal signal.
EXAMPLE | CdlLongleggeddoji(open, high, low, close)


Function - CDLLONGLINE

CDLLONGLINE
 Long Line Candle

Candlestick Pattern

SYNTAX | CdlLongline()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Long Line Candle, A long day (LONGLINE) represents a large price move from open to close.
ADDITIONAL INFO | Long Line Candle Signal: Indecision Pattern: Reversal Reliability: Low Identification: A long day (Long Line Candle) represents a large price move from open to close.
EXAMPLE | CdlLongline()


Function - CDLLONGLINE

CDLLONGLINE
 Long Line Candle

Candlestick Pattern

SYNTAX | CdlLongline( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Long Line Candle, A long day (LONGLINE) represents a large price move from open to close.
ADDITIONAL INFO | Long Line Candle Signal: Indecision Pattern: Reversal Reliability: Low Identification: A long day (Long Line Candle) represents a large price move from open to close.
EXAMPLE | CdlLongline(open, high, low, close)


Function - CDLMARUBOZU

CDLMARUBOZU
 Marubozu

Candlestick Pattern

SYNTAX | CdlMarubozu()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Marubozu, in Japanese, Marubozu means close cropped or close-cut.
ADDITIONAL INFO | Black Marubozu Signal: Bearish Pattern: Reversal/Continuation Reliability: Low Identification: The Black Marubozu is a single candlestick pattern characterized by a long black body. It does not have any shadows on either end. It is an extremely strong bearish candlestick pattern. White Marubozu Signal: Bullish Pattern: Reversal/Continuation Reliability: Low Identification: The White Marubozu is a single candlestick pattern characterized with a long white body having no shadows on either end. It is an extremely strong bullish candlestick pattern.
EXAMPLE | CdlMarubozu()


Function - CDLMARUBOZU

CDLMARUBOZU
 Marubozu

Candlestick Pattern

SYNTAX | CdlMarubozu( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Marubozu, in Japanese, Marubozu means close cropped or close-cut.
ADDITIONAL INFO | Black Marubozu Signal: Bearish Pattern: Reversal/Continuation Reliability: Low Identification: The Black Marubozu is a single candlestick pattern characterized by a long black body. It does not have any shadows on either end. It is an extremely strong bearish candlestick pattern. White Marubozu Signal: Bullish Pattern: Reversal/Continuation Reliability: Low Identification: The White Marubozu is a single candlestick pattern characterized with a long white body having no shadows on either end. It is an extremely strong bullish candlestick pattern.
EXAMPLE | CdlMarubozu(open, high, low, close)


Function - CDLMATCHINGLOW

CDLMATCHINGLOW
 Matching Low

Candlestick Pattern

SYNTAX | CdlMatchinglow()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Matching Low, The Matching Low pattern is similar to the Homing Pigeon patter, the exception being that the two days of the pattern close on their lows, at the same level.
ADDITIONAL INFO | Matching Low Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by another black day with equivalent closes both days.
EXAMPLE | CdlMatchinglow()


Function - CDLMATCHINGLOW

CDLMATCHINGLOW
 Matching Low

Candlestick Pattern

SYNTAX | CdlMatchinglow( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Matching Low, The Matching Low pattern is similar to the Homing Pigeon patter, the exception being that the two days of the pattern close on their lows, at the same level.
ADDITIONAL INFO | Matching Low Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by another black day with equivalent closes both days.
EXAMPLE | CdlMatchinglow(open, high, low, close)


Function - CDLMATHOLD

CDLMATHOLD
 Mat Hold

Candlestick Pattern

SYNTAX | CdlMathold( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Mat Hold, The pattern appears during an uptrend, which is further confirmed by the first long white candlestick.
ADDITIONAL INFO | Mat Hold Bullish Signal: Bullish Pattern: continuation Reliability: high Identification A long white day in an uptrend is followed by a relatively small black day that gaps in the direction of the trend. The next two days continue the brief pullback and are small days that stay within the range of the first day. The fifth day is a long white day that closes above the close of the first day and continues the uptrend.
EXAMPLE | CdlMathold(14)


Function - CDLMATHOLD

CDLMATHOLD
 Mat Hold

Candlestick Pattern

SYNTAX | CdlMathold( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Mat Hold, The pattern appears during an uptrend, which is further confirmed by the first long white candlestick.
ADDITIONAL INFO | Mat Hold Bullish Signal: Bullish Pattern: continuation Reliability: high Identification A long white day in an uptrend is followed by a relatively small black day that gaps in the direction of the trend. The next two days continue the brief pullback and are small days that stay within the range of the first day. The fifth day is a long white day that closes above the close of the first day and continues the uptrend.
EXAMPLE | CdlMathold(open, high, low, close, 14)


Function - CDLMORNINGDOJISTAR

CDLMORNINGDOJISTAR
 Morning Doji Star

Candlestick Pattern

SYNTAX | CdlMorningdojistar( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Morning Doji Star, A three day bullish reversal pattern that is very similar to the Morning Star.
ADDITIONAL INFO | Morning Doji Star Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a Doji that gaps in the direction of the trend. The third day is a white day which closes in the top half of the black day.
EXAMPLE | CdlMorningdojistar(14)


Function - CDLMORNINGDOJISTAR

CDLMORNINGDOJISTAR
 Morning Doji Star

Candlestick Pattern

SYNTAX | CdlMorningdojistar( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Morning Doji Star, A three day bullish reversal pattern that is very similar to the Morning Star.
ADDITIONAL INFO | Morning Doji Star Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a Doji that gaps in the direction of the trend. The third day is a white day which closes in the top half of the black day.
EXAMPLE | CdlMorningdojistar(open, high, low, close, 14)


Function - CDLMORNINGSTAR

CDLMORNINGSTAR
 Morning Star

Candlestick Pattern

SYNTAX | CdlMorningstar( ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Morning Star, The Morning Star is a bottom reversal signal.
ADDITIONAL INFO | Morning Star Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a small day that gaps in the direction of the trend. The third day is a white day which closes in the top half of the black day.
EXAMPLE | CdlMorningstar(14)


Function - CDLMORNINGSTAR

CDLMORNINGSTAR
 Morning Star

Candlestick Pattern

SYNTAX | CdlMorningstar( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY penetration)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Morning Star, The Morning Star is a bottom reversal signal.
ADDITIONAL INFO | Morning Star Bullish Signal: Bullish Pattern: reversal Reliability: high Identification A long black day is followed by a small day that gaps in the direction of the trend. The third day is a white day which closes in the top half of the black day.
EXAMPLE | CdlMorningstar(open, high, low, close, 14)


Function - CDLONNECK

CDLONNECK
 On-Neck Pattern

Candlestick Pattern

SYNTAX | CdlOnneck()
RETURNS | NUMERIC ARRAY
DESCRIPTION | On-Neck Pattern, The On Neck Line pattern is almost a 'meeting line pattern', but the critical term is 'almost'.
ADDITIONAL INFO | On Neck Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a long white day that gaps down at the open and closes below the close of the black day.
EXAMPLE | CdlOnneck()


Function - CDLONNECK

CDLONNECK
 On-Neck Pattern

Candlestick Pattern

SYNTAX | CdlOnneck( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | On-Neck Pattern, The On Neck Line pattern is almost a 'meeting line pattern', but the critical term is 'almost'.
ADDITIONAL INFO | On Neck Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a long white day that gaps down at the open and closes below the close of the black day.
EXAMPLE | CdlOnneck(open, high, low, close)


Function - CDLPIERCING

CDLPIERCING
 Piercing Pattern

Candlestick Pattern

SYNTAX | CdlPiercing()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Piercing Pattern, The Piercing Pattern is composed of a two-candle formation in a down trending market.
ADDITIONAL INFO | Piercing Line Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by a white day that gaps below the black day�s low and closes within and above the midpoint of the black day�s body.
EXAMPLE | CdlPiercing()


Function - CDLPIERCING

CDLPIERCING
 Piercing Pattern

Candlestick Pattern

SYNTAX | CdlPiercing( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Piercing Pattern, The Piercing Pattern is composed of a two-candle formation in a down trending market.
ADDITIONAL INFO | Piercing Line Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification A long black day is followed by a white day that gaps below the black day�s low and closes within and above the midpoint of the black day�s body.
EXAMPLE | CdlPiercing(open, high, low, close)


Function - CDLRICKSHAWMAN

CDLRICKSHAWMAN
 Rickshaw Man

Candlestick Pattern

SYNTAX | CdlRickshawman()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rickshaw Man, Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
ADDITIONAL INFO | Rickshaw Man Signal: Indecision Pattern: Reversal Reliability: Medium Identification: Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
EXAMPLE | CdlRickshawman()


Function - CDLRICKSHAWMAN

CDLRICKSHAWMAN
 Rickshaw Man

Candlestick Pattern

SYNTAX | CdlRickshawman( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rickshaw Man, Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
ADDITIONAL INFO | Rickshaw Man Signal: Indecision Pattern: Reversal Reliability: Medium Identification: Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
EXAMPLE | CdlRickshawman(open, high, low, close)


Function - CDLRISEFALL3METHODS

CDLRISEFALL3METHODS
 Rising/Falling Three Methods

Candlestick Pattern

SYNTAX | CdlRisefall3methods()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rising/Falling Three Methods, The Falling Three Method is basically the opposite of the Rising Three Method, The market has been in a downtrend.
ADDITIONAL INFO | Rising Three Methods Bullish Signal: Bullish Pattern: continuation Reliability: high Identification A long white day in an uptrend is followed by three relatively small candles that move opposite the overall trend but stay within the range of the first day. The fifth day is a long white day that closes above the close of the first day and continues the uptrend. Fallling Three Methods Bearish Signal: Bearish Pattern: continuation Reliability: high Identification A long black day in a downtrend is followed by three relatively small candles that move opposite the overall trend but stay within the range of the first day. The fifth day is a long black day that closes below the close of the first day and continues the downtrend.
EXAMPLE | CdlRisefall3methods()


Function - CDLRISEFALL3METHODS

CDLRISEFALL3METHODS
 Rising/Falling Three Methods

Candlestick Pattern

SYNTAX | CdlRisefall3methods( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rising/Falling Three Methods, The Falling Three Method is basically the opposite of the Rising Three Method, The market has been in a downtrend.
ADDITIONAL INFO | Rising Three Methods Bullish Signal: Bullish Pattern: continuation Reliability: high Identification A long white day in an uptrend is followed by three relatively small candles that move opposite the overall trend but stay within the range of the first day. The fifth day is a long white day that closes above the close of the first day and continues the uptrend. Fallling Three Methods Bearish Signal: Bearish Pattern: continuation Reliability: high Identification A long black day in a downtrend is followed by three relatively small candles that move opposite the overall trend but stay within the range of the first day. The fifth day is a long black day that closes below the close of the first day and continues the downtrend.
EXAMPLE | CdlRisefall3methods(open, high, low, close)


Function - CDLSEPARATINGLINES

CDLSEPARATINGLINES
 Separating Lines

Candlestick Pattern

SYNTAX | CdlSeparatinglines()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Separating Lines, You can identify it from the following points: The first day is a long white candle.
ADDITIONAL INFO | Separating Lines Bullish Signal: Bullish Pattern: continuation Reliability: low Identification A black day is followed by a white day that has the same opening price. Separating Lines Bearish Signal: Bearish Pattern: continuation Reliability: low Identification A white day is followed by a black day that has the same opening price.
EXAMPLE | CdlSeparatinglines()


Function - CDLSEPARATINGLINES

CDLSEPARATINGLINES
 Separating Lines

Candlestick Pattern

SYNTAX | CdlSeparatinglines( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Separating Lines, You can identify it from the following points: The first day is a long white candle.
ADDITIONAL INFO | Separating Lines Bullish Signal: Bullish Pattern: continuation Reliability: low Identification A black day is followed by a white day that has the same opening price. Separating Lines Bearish Signal: Bearish Pattern: continuation Reliability: low Identification A white day is followed by a black day that has the same opening price.
EXAMPLE | CdlSeparatinglines(open, high, low, close)


Function - CDLSHOOTINGSTAR

CDLSHOOTINGSTAR
 Shooting Star

Candlestick Pattern

SYNTAX | CdlShootingstar()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Shooting Star, The Shooting Star is comprised of one candle.
ADDITIONAL INFO | Shooting Star Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A small body forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent.
EXAMPLE | CdlShootingstar()


Function - CDLSHOOTINGSTAR

CDLSHOOTINGSTAR
 Shooting Star

Candlestick Pattern

SYNTAX | CdlShootingstar( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Shooting Star, The Shooting Star is comprised of one candle.
ADDITIONAL INFO | Shooting Star Bearish Signal: Bearish Pattern: reversal Reliability: low/moderate Identification A small body forms at the lower end of the trading range. The upper shadow is usually long while the lower shadow is small or almost nonexistent.
EXAMPLE | CdlShootingstar(open, high, low, close)


Function - CDLSHORTLINE

CDLSHORTLINE
 Short Line Candle

Candlestick Pattern

SYNTAX | CdlShortline()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Short Line Candle, Short days (SHORTLINES) can be interpreted by the same analytical process of the long candles.
ADDITIONAL INFO | Short Line Candle Signal: Indecision Pattern: Reversal Reliability: Low Identification: Short days (Short Line Candle) represents a small price move from open to close.
EXAMPLE | CdlShortline()


Function - CDLSHORTLINE

CDLSHORTLINE
 Short Line Candle

Candlestick Pattern

SYNTAX | CdlShortline( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Short Line Candle, Short days (SHORTLINES) can be interpreted by the same analytical process of the long candles.
ADDITIONAL INFO | Short Line Candle Signal: Indecision Pattern: Reversal Reliability: Low Identification: Short days (Short Line Candle) represents a small price move from open to close.
EXAMPLE | CdlShortline(open, high, low, close)


Function - CDLSPINNINGTOP

CDLSPINNINGTOP
 Spinning Top

Candlestick Pattern

SYNTAX | CdlSpinningtop()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Spinning Top, spinning Tops are depicted with small bodies relative to the shadows.
ADDITIONAL INFO | White Spinning Top Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: The White Spinning Top is a single candlestick pattern. Its shape is a small white body with upper and lower shadows that have a greater length than the body's length. Black Spinning Top Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: The Black Spinning Top is a single candlestick pattern. Its shape is a small black body with upper and lower shadows having a greater length than the body's length.
EXAMPLE | CdlSpinningtop()


Function - CDLSPINNINGTOP

CDLSPINNINGTOP
 Spinning Top

Candlestick Pattern

SYNTAX | CdlSpinningtop( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Spinning Top, spinning Tops are depicted with small bodies relative to the shadows.
ADDITIONAL INFO | White Spinning Top Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: The White Spinning Top is a single candlestick pattern. Its shape is a small white body with upper and lower shadows that have a greater length than the body's length. Black Spinning Top Signal: Indecision Pattern: Reversal/Continuation Reliability: Low Identification: The Black Spinning Top is a single candlestick pattern. Its shape is a small black body with upper and lower shadows having a greater length than the body's length.
EXAMPLE | CdlSpinningtop(open, high, low, close)


Function - CDLSTALLEDPATTERN

CDLSTALLEDPATTERN
 Stalled Pattern

Candlestick Pattern

SYNTAX | CdlStalledpattern()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stalled Pattern, Another pattern close to the Three White Soldiers pattern is the Stalled Pattern (commonly known as the Deliberation pattern).
ADDITIONAL INFO | Stalled Pattern or Deliberation pattern Signal: Bearish Pattern: Reversal Reliability: Medium Identification: The Bearish Deliberation Pattern is a derivative of the Bearish Three White Soldiers Pattern. This pattern also shows a weakness similar to the Bearish Advance Block Pattern since it becomes weaker in a short period of time. However here the weakness occurs all at once on the third day. The small third body of the pattern shows that the rally is losing strength and a reversal is possible.
EXAMPLE | CdlStalledpattern()


Function - CDLSTALLEDPATTERN

CDLSTALLEDPATTERN
 Stalled Pattern

Candlestick Pattern

SYNTAX | CdlStalledpattern( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stalled Pattern, Another pattern close to the Three White Soldiers pattern is the Stalled Pattern (commonly known as the Deliberation pattern).
ADDITIONAL INFO | Stalled Pattern or Deliberation pattern Signal: Bearish Pattern: Reversal Reliability: Medium Identification: The Bearish Deliberation Pattern is a derivative of the Bearish Three White Soldiers Pattern. This pattern also shows a weakness similar to the Bearish Advance Block Pattern since it becomes weaker in a short period of time. However here the weakness occurs all at once on the third day. The small third body of the pattern shows that the rally is losing strength and a reversal is possible.
EXAMPLE | CdlStalledpattern(open, high, low, close)


Function - CDLSTICKSANDWICH

CDLSTICKSANDWICH
 Stick Sandwich

Candlestick Pattern

SYNTAX | CdlSticksandwich()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stick Sandwich, The Stick Sandwich looks somewhat like an ice cream sandwich.
ADDITIONAL INFO | Bullish Stick Sandwich Signal: Bullish Pattern: Reversal Reliability: Medium Identification: The Bullish Stick Sandwich Pattern is characterized by consecutive higher opens for three days, but results in an eventual close equal to the first day's close. It may warn that prices are now finding a support price. We may then see a reversal from this support level.
EXAMPLE | CdlSticksandwich()


Function - CDLSTICKSANDWICH

CDLSTICKSANDWICH
 Stick Sandwich

Candlestick Pattern

SYNTAX | CdlSticksandwich( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stick Sandwich, The Stick Sandwich looks somewhat like an ice cream sandwich.
ADDITIONAL INFO | Bullish Stick Sandwich Signal: Bullish Pattern: Reversal Reliability: Medium Identification: The Bullish Stick Sandwich Pattern is characterized by consecutive higher opens for three days, but results in an eventual close equal to the first day's close. It may warn that prices are now finding a support price. We may then see a reversal from this support level.
EXAMPLE | CdlSticksandwich(open, high, low, close)


Function - CDLTAKURI

CDLTAKURI
 Takuri

Candlestick Pattern

SYNTAX | CdlTakuri()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Takuri (Dragonfly Doji with very long lower shadow) : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Dragonfly Doji with very long lower shadow
EXAMPLE | CdlTakuri()


Function - CDLTAKURI

CDLTAKURI
 Takuri

Candlestick Pattern

SYNTAX | CdlTakuri( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Takuri (Dragonfly Doji with very long lower shadow) : This function is contained within the Pattern Recognition set of indicators.
ADDITIONAL INFO | Dragonfly Doji with very long lower shadow
EXAMPLE | CdlTakuri(open, high, low, close)


Function - CDLTASUKIGAP

CDLTASUKIGAP
 Tasuki Gap

Candlestick Pattern

SYNTAX | CdlTasukigap()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Tasuki Gap, The Upside Tasuki Gap is found in a rising trend.
ADDITIONAL INFO | Downside Tasuki Gap Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a second long black day that gaps in the direction of the trend. The third day is white and opens within the body of the second day and closes within the gap. Upside Tasuki Gap Bullish Signal: Bullish Pattern: continuation Reliability: moderate Identification A long white day is followed by a second long white day that gaps in the direction of the trend. The third day is black and opens within the body of the second day and closes within the gap.
EXAMPLE | CdlTasukigap()


Function - CDLTASUKIGAP

CDLTASUKIGAP
 Tasuki Gap

Candlestick Pattern

SYNTAX | CdlTasukigap( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Tasuki Gap, The Upside Tasuki Gap is found in a rising trend.
ADDITIONAL INFO | Downside Tasuki Gap Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a second long black day that gaps in the direction of the trend. The third day is white and opens within the body of the second day and closes within the gap. Upside Tasuki Gap Bullish Signal: Bullish Pattern: continuation Reliability: moderate Identification A long white day is followed by a second long white day that gaps in the direction of the trend. The third day is black and opens within the body of the second day and closes within the gap.
EXAMPLE | CdlTasukigap(open, high, low, close)


Function - CDLTHRUSTING

CDLTHRUSTING
 Thrusting Pattern

Candlestick Pattern

SYNTAX | CdlThrusting()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Thrusting Pattern, The Thrusting pattern is almost an 'On Neck' or an 'In Neck' pattern and resembles the Meeting Line pattern, also.
ADDITIONAL INFO | Thrusting Bearish Signal: Bearish Pattern: continuation Reliability: low Identification A black day is followed by a white day which gaps in the direction of the trend and closes below the midpoint of the black day.
EXAMPLE | CdlThrusting()


Function - CDLTHRUSTING

CDLTHRUSTING
 Thrusting Pattern

Candlestick Pattern

SYNTAX | CdlThrusting( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Thrusting Pattern, The Thrusting pattern is almost an 'On Neck' or an 'In Neck' pattern and resembles the Meeting Line pattern, also.
ADDITIONAL INFO | Thrusting Bearish Signal: Bearish Pattern: continuation Reliability: low Identification A black day is followed by a white day which gaps in the direction of the trend and closes below the midpoint of the black day.
EXAMPLE | CdlThrusting(open, high, low, close)


Function - CDLTRISTAR

CDLTRISTAR
 Tristar Pattern

Candlestick Pattern

SYNTAX | CdlTristar()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Tristar Pattern, The Tri Star pattern is relatively rare.
ADDITIONAL INFO |
EXAMPLE | CdlTristar()


Function - CDLTRISTAR

CDLTRISTAR
 Tristar Pattern

Candlestick Pattern

SYNTAX | CdlTristar( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Tristar Pattern, The Tri Star pattern is relatively rare.
ADDITIONAL INFO |
EXAMPLE | CdlTristar(open, high, low, close)


Function - CDLUNIQUE3RIVER

CDLUNIQUE3RIVER
 Unique 3 River

Candlestick Pattern

SYNTAX | CdlUnique3river()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Unique 3 River, The Unique Three River Bottom is a bullish pattern, somewhat characteristic of the Morning Star Pattern.
ADDITIONAL INFO | Unique Three River Bottom Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification The first day is a long black day, followed by a Homing Pigeon whose lower shadow makes a new low. The last day is small and white, and closes below the second day�s close.
EXAMPLE | CdlUnique3river()


Function - CDLUNIQUE3RIVER

CDLUNIQUE3RIVER
 Unique 3 River

Candlestick Pattern

SYNTAX | CdlUnique3river( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Unique 3 River, The Unique Three River Bottom is a bullish pattern, somewhat characteristic of the Morning Star Pattern.
ADDITIONAL INFO | Unique Three River Bottom Bullish Signal: Bullish Pattern: reversal Reliability: moderate Identification The first day is a long black day, followed by a Homing Pigeon whose lower shadow makes a new low. The last day is small and white, and closes below the second day�s close.
EXAMPLE | CdlUnique3river(open, high, low, close)


Function - CDLUPSIDEGAP2CROWS

CDLUPSIDEGAP2CROWS
 Upside Gap Two Crows

Candlestick Pattern

SYNTAX | CdlUpsidegap2crows()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Upside Gap Two Crows, The Upside Gap Two Crows is a three-day pattern.
ADDITIONAL INFO | Upside Gap Two Crows Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a black candle which gaps in the direction of the trend. The final day engulfs the small black day and closes within the gap of the first two days.
EXAMPLE | CdlUpsidegap2crows()


Function - CDLUPSIDEGAP2CROWS

CDLUPSIDEGAP2CROWS
 Upside Gap Two Crows

Candlestick Pattern

SYNTAX | CdlUpsidegap2crows( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Upside Gap Two Crows, The Upside Gap Two Crows is a three-day pattern.
ADDITIONAL INFO | Upside Gap Two Crows Bearish Signal: Bearish Pattern: reversal Reliability: high Identification A long white day is followed by a black candle which gaps in the direction of the trend. The final day engulfs the small black day and closes within the gap of the first two days.
EXAMPLE | CdlUpsidegap2crows(open, high, low, close)


Function - CDLXSIDEGAP3METHODS

CDLXSIDEGAP3METHODS
 Upside/Downside Gap Three Methods

Candlestick Pattern

SYNTAX | CdlXsidegap3methods()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Upside/Downside Gap Three Methods, the Bullish Upside Gap Three Methods Pattern, the market is in a strong bullish mood.
ADDITIONAL INFO | Upside Gap Three Methods Bullish Signal: Bullish Pattern: continuation Reliability: moderate Identification A long white day is followed by a second long white day that gaps in the direction of the trend. The third day is black and fills the gap between the first two days. Downside Gap Three Methods Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a second long black day that gaps in the direction of the trend. The third day is white and fills the gap between the first two days.
EXAMPLE | CdlXsidegap3methods()


Function - CDLXSIDEGAP3METHODS

CDLXSIDEGAP3METHODS
 Upside/Downside Gap Three Methods

Candlestick Pattern

SYNTAX | CdlXsidegap3methods( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Upside/Downside Gap Three Methods, the Bullish Upside Gap Three Methods Pattern, the market is in a strong bullish mood.
ADDITIONAL INFO | Upside Gap Three Methods Bullish Signal: Bullish Pattern: continuation Reliability: moderate Identification A long white day is followed by a second long white day that gaps in the direction of the trend. The third day is black and fills the gap between the first two days. Downside Gap Three Methods Bearish Signal: Bearish Pattern: continuation Reliability: moderate Identification A long black day is followed by a second long black day that gaps in the direction of the trend. The third day is white and fills the gap between the first two days.
EXAMPLE | CdlXsidegap3methods(open, high, low, close)


PLOT1
Plot

Charting

SYNTAX | Plot1( ARRAY array one, ARRAY array two, ARRAY description1, ARRAY description2, ENUM fillcolor, ENUM graphonecolor, ENUM graphtwocolor, ENUM chart type, ENUM style)
RETURNS |
DESCRIPTION | Plots two time-series
ADDITIONAL INFO |
EXAMPLE | Plot1(BbandsUpper(14, 2, 2, _MaSma), BbandSlower(14, 2, 2, _MaSma), "BB UP", "BB LOW", colorRed|20|colorRed|20|0, colorTransparent, colorTransparent, chartLine, StyleSymbolNone)


Plot (0)

PLOT
Plot

Charting

SYNTAX | Plot( ARRAY array, ARRAY description, ENUM color, ENUM chart type, ENUM style)
RETURNS |
DESCRIPTION | Plots a time-series
ADDITIONAL INFO |
EXAMPLE | Plot(rsi(14), "RSI", colorBlack, chartLine, styleOwnScale)


Plot (1)

PLOT
Plot

Charting

SYNTAX | Plot( ARRAY array, ARRAY description, ENUM color, ENUM chart type)
RETURNS |
DESCRIPTION | Plots a time-series
ADDITIONAL INFO |
EXAMPLE | Plot(rsi(14), "RSI", colorBlack, chartLine)


Plot (2)

PLOT
Plot

Charting

SYNTAX | Plot( ARRAY array, ARRAY description, ENUM color)
RETURNS |
DESCRIPTION | Plots a time-series
ADDITIONAL INFO |
EXAMPLE | Plot(rsi(14), "RSI", colorBlack)


Function - PLOT

PLOT
 Plot

Charting

SYNTAX | Plot( ARRAY array, ARRAY description)
RETURNS |
DESCRIPTION | Plot a time-series
ADDITIONAL INFO |
EXAMPLE | Plot(rsi(14), "RSI")


Function - PLOTARROW

PLOTARROW
 Plot Arrow

Charting

SYNTAX | PlotArrow( ARRAY array, ARRAY information, ENUM topbottom, ENUM color)
RETURNS |
DESCRIPTION | Draw an arrow when the value of an element of the ARRAY is different from 0
ADDITIONAL INFO |
EXAMPLE | PlotArrow(volume > 2 * sma(volume, 20), "B", AboveHigh, colorRed)


Function - PLOTCANDLESTICK1

PLOTCANDLESTICK1
 Plot CandleStick

Charting

SYNTAX | PlotCandleStick1( ARRAY open, ARRAY high, ARRAY low, ARRAY close, ARRAY description, ENUM color, ENUM style)
RETURNS |
DESCRIPTION | Plot a symbol quotes
ADDITIONAL INFO |
EXAMPLE | PlotCandleStick1(open, high, low, close, "CandleStick", colorBlack, StyleSymbolNone)


Function - PLOTCANDLESTICK

PLOTCANDLESTICK
 Plot CandleStick

Charting

SYNTAX | PlotCandleStick( ARRAY description, ENUM color, ENUM style)
RETURNS |
DESCRIPTION | Plot a symbol quotes
ADDITIONAL INFO |
EXAMPLE | PlotCandleStick("CandleStick", colorBlack, StyleSymbolNone)


Function - PLOTFIXED

PLOTFIXED
 Plot Fixed Graph

Charting

SYNTAX | PlotFixed( ARRAY xaxisdata, ARRAY yaxisdata, ARRAY yaxislabel, ENUM function, ARRAY description, ENUM color, ENUM chart type, ENUM style)
RETURNS |
DESCRIPTION | Draw a fixed graph (see tutorial)
ADDITIONAL INFO |
EXAMPLE | PlotFixed(iff(GapUp(), 1, iff(GapDown(), 2, 0)), 1, "", iCount, "Number of No Gaps - Gap Up - Gap Down", colorBlack, ChartBar, StyleSymbolNone)


Function - PLOTSYMBOL

PLOTSYMBOL
 Plot Symbol

Charting

SYNTAX | PlotSymbol( ARRAY array, ARRAY information, ARRAY factor, ARRAY margin, ENUM topbottom, ENUM border color, ENUM back color, ENUM plot symbol)
RETURNS |
DESCRIPTION | Draw a symbol when the value of an element of the ARRAY is different from 0
ADDITIONAL INFO |
EXAMPLE | PlotSymbol(volume > 2 * sma(volume, 20), "B", 1, 1, AboveHigh, colorBlack, colorBlack, PlotSymbolCircle)


Function - PRINT

PRINT
 Print To Output

Charting

SYNTAX | Print( ARRAY text)
RETURNS |
DESCRIPTION | Set the outpout window so it display text depending on the selected date
ADDITIONAL INFO |
EXAMPLE | Print("Hello")


Function - PRINTCHART

PRINTCHART
 Print Chart

Charting

SYNTAX | PrintChart( ARRAY string to print, ARRAY description, ENUM coordinate, ENUM color, ENUM border color, ENUM back color, ARRAY alpha)
RETURNS |
DESCRIPTION | Draw a string
ADDITIONAL INFO |
EXAMPLE | PrintChart("Close", "Close Price", TopLeft, colorRed, colorBlack, colorBlack, 255)


Function - SETHATCHBRUSH

SETHATCHBRUSH
 Set Hatch Brush

Charting

SYNTAX | SetHatchBrush( STRING hatch brush style, ENUM color)
RETURNS |
DESCRIPTION | Set a hatch brush for the last graph
ADDITIONAL INFO |
EXAMPLE | SetHatchBrush("BackwardDiagonal", colorRed)


Function - SETMAXSCALE

SETMAXSCALE
 Set the maximum chart scale

Charting

SYNTAX | SetMaxScale( ARRAY max)
RETURNS |
DESCRIPTION | Set maximum chart scale
ADDITIONAL INFO |
EXAMPLE | SetMaxScale(100)


Function - SETMINSCALE

SETMINSCALE
 Set the minimum chart scale

Charting

SYNTAX | SetMinScale( ARRAY min)
RETURNS |
DESCRIPTION | Set minimum chart scale
ADDITIONAL INFO |
EXAMPLE | SetMinScale(0)


Function - SETPERCENTSCALE

SETPERCENTSCALE
 Update chart scale by a percentage

Charting

SYNTAX | SetPercentScale( ARRAY decrease mininum by, ARRAY increase maximum by)
RETURNS |
DESCRIPTION | Set chart scale
ADDITIONAL INFO |
EXAMPLE | SetPercentScale(0, 0)


Function - SETSCALE

SETSCALE
 Set the chart scale

Charting

SYNTAX | SetScale( ARRAY min, ARRAY max)
RETURNS |
DESCRIPTION | Set chart scale
ADDITIONAL INFO |
EXAMPLE | SetScale(0, 100)


Function - UPDATECOLOR

UPDATECOLOR
 Update Last Graph Color

Charting

SYNTAX | UpdateColor( ARRAY condition, ENUM color)
RETURNS |
DESCRIPTION | Set a different color to each bar or line
ADDITIONAL INFO |
EXAMPLE | UpdateColor(volume > 0, colorGreen)


Function - UPDATEPRINTSETTINGS

UPDATEPRINTSETTINGS
 Update Print Settings

Charting

SYNTAX | UpdatePrintSettings( STRING printchart settings, ARRAY rule, ARRAY value)
RETURNS |
DESCRIPTION | Update the last PrintChart function
ADDITIONAL INFO |
EXAMPLE | UpdatePrintSettings("PositionX", 1, 0)


Function - UPDATESETTINGS

UPDATESETTINGS
 Update Pane Settings

Charting

SYNTAX | UpdateSettings( STRING pane settings, ARRAY value)
RETURNS |
DESCRIPTION | Update the current pane settings
ADDITIONAL INFO |
EXAMPLE | UpdateSettings("Full Pane", 0)


Function - ADDCOLUMN

ADDCOLUMN
 Add column

Columns

SYNTAX | AddColumn( ARRAY column name, ARRAY variable)
RETURNS |
DESCRIPTION | Creates a numeric column for the screener or the watch-list
ADDITIONAL INFO |
EXAMPLE | AddColumn("Column1", rsi(14))


Function - ADDCOLUMN

ADDCOLUMN
 Add column

Columns

SYNTAX | AddColumn( ARRAY column name, ARRAY variable)
RETURNS |
DESCRIPTION | Creates a text column for the screener or the watch-list
ADDITIONAL INFO |
EXAMPLE | AddColumn("Column1", Market())


Function - SETCOLUMNCOLOR

SETCOLUMNCOLOR
 Update column color

Columns

SYNTAX | SetColumnColor( ARRAY condition, STRING color)
RETURNS |
DESCRIPTION | Updates the color of the last column depending on the specified condition
ADDITIONAL INFO |
EXAMPLE | SetColumnColor(close > open, "colorRed")


Function - ADDCOMPOSITE

ADDCOMPOSITE
 Add composite

Composite

SYNTAX | AddComposite( ARRAY composite name, ARRAY variable, ENUM composite calculation type)
RETURNS |
DESCRIPTION | Calculates a composite and stores it. This composite value can be used with the Composite Script tool.
ADDITIONAL INFO |
EXAMPLE | AddComposite("composite1", close > ref(close, 1), _CompAverage)


Function - COMP

COMP
 Create a composite

Composite

SYNTAX | Comp( ARRAY array, ENUM calculation method)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Creates a composite and returns the composite vector
ADDITIONAL INFO |
EXAMPLE | Comp(close, "avg")


Function - COMP

COMP
 Create a composite

Composite

SYNTAX | Comp( ARRAY array, ENUM calculation method, ARRAY group)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Creates a composite for each group defined by the rule in the 'group' parameter.
ADDITIONAL INFO |
EXAMPLE | Comp(close, "avg", states(close, 30|20|10))


Function - COMP

COMP
 Create a composite

Composite

SYNTAX | Comp( ARRAY array, ENUM calculation method, ARRAY group, ARRAY filter)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Creates a composite for each group defined by the rule in the 'group' parameter. Use the 'filter' parameter to filter symbols included in the composite calculation.
ADDITIONAL INFO |
EXAMPLE | Comp(close, "avg", states(close, 30|20|10), close > 2)


Function - COMP

COMP
 Create a composite

Composite

SYNTAX | Comp( ARRAY array, ENUM calculation method, ARRAY group, ARRAY filter, ARRAY symbols filter)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Creates a composite for each group defined by the rule in the 'group' parameter. Use the 'filter' parameter to filter symbols included in the composite calculation. Add a 'symbols filter' to specify which symbols to include in the calculation of the composite.
ADDITIONAL INFO |
EXAMPLE | Comp(close, "avg", states(close, 30|20|10), close > 2, "symbols filter name")


Function - GETDATA

GETDATA
 Database Field

Database

SYNTAX | GetData( STRING database name, STRING field name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a database field data
ADDITIONAL INFO |
EXAMPLE | GetData("'database name'", "'field name'")


Function - GETDATA

GETDATA
 Database Field

Database

SYNTAX | GetData( STRING database name, STRING field name, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a database field data
ADDITIONAL INFO |
EXAMPLE | GetData("'database name'", "'field name'", LastData)


Function - GETDATA

GETDATA
 Database Field

Database

SYNTAX | GetData( STRING database name, STRING field name, ENUM type, ARRAY symbol)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a database field data for an external symbol
ADDITIONAL INFO |
EXAMPLE | GetData("'database name'", "'field name'", LastData, "GOOG")


Function - GETDATACOUNT

GETDATACOUNT
 Database Field Count

Database

SYNTAX | GetDataCount( STRING database name, STRING field name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database elements data for each bar
ADDITIONAL INFO |
EXAMPLE | GetDataCount("'database name'", "'field name'")


Function - GETDATACOUNT

GETDATACOUNT
 Database Field Count

Database

SYNTAX | GetDataCount( STRING database name, STRING field name, ARRAY symbol)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database elements data for each bar for an external symbol
ADDITIONAL INFO |
EXAMPLE | GetDataCount("'database name'", "'field name'", "GOOG")


Function - GETDATACOUNTINSIDE

GETDATACOUNTINSIDE
 Database Field Index Count Inside

Database

SYNTAX | GetDataCountInside( STRING database name, STRING field name, ARRAY low, ARRAY high, ENUM periodtype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database field elements for each bar and for the specified limits
ADDITIONAL INFO |
EXAMPLE | GetDataCountInside("'database name'", "'field name'", 0, 10, P_Hour)


Function - GETDATAEXTERN

GETDATAEXTERN
 Database field for a specified symbol

Database

SYNTAX | GetDataExtern( STRING database name, STRING field name, ARRAY type: 0 for lastdata; 1 for zero; and 2 for na, ARRAY symbol)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a database field data for a specified symbol
ADDITIONAL INFO |
EXAMPLE | GetDataExtern("Fundamental", "Mktcap", 0, "A")


Function - GETDATAINDEX

GETDATAINDEX
 Database Field Index

Database

SYNTAX | GetDataIndex( STRING database name, STRING field name, ARRAY index, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get an array from a database field, index parameter specify the index of the data (When using for example intraday database with an historical timeframe)
ADDITIONAL INFO |
EXAMPLE | GetDataIndex("'database_name'", "'field name'", 0, LastData)


Function - GETDATAINDEXDP

GETDATAINDEXDP
 Database Field Index Time

Database

SYNTAX | GetDataIndexDP( STRING database name, STRING field name, ARRAY index, ENUM periodtype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get an array representing Year or month or day or hour... for each database field item, index parameter specify the index of the data (When using for example intraday database with an historical timeframe)
ADDITIONAL INFO |
EXAMPLE | GetDataIndexDP("'database name'", "'field name'", 0, P_Hour)


Function - GETDATAINSIDE

GETDATAINSIDE
 Database Field Index Inside

Database

SYNTAX | GetDataInside( STRING database name, STRING field name, ARRAY low, ARRAY high, ENUM periodtype, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get an array from a database field (Accept only values which date are inside the specified limits)
ADDITIONAL INFO |
EXAMPLE | GetDataInside("'database name'", "'field name'", 0, 10, P_Hour, LastData)


Function - GETDATASTRINGCOUNT

GETDATASTRINGCOUNT
 Database Field Count

Database

SYNTAX | GetDataStringCount( STRING database name, STRING field name, ARRAY regular expression)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database field elements for each bar and using the provided pattern
ADDITIONAL INFO |
EXAMPLE | GetDataStringCount("'database name'", "'field name'", "buy")


Function - GETDATASTRINGCOUNT

GETDATASTRINGCOUNT
 Database Field Count

Database

SYNTAX | GetDataStringCount( STRING database name, STRING field name, ARRAY regular expression, ARRAY symbol)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database field elements for each bar, using the provided pattern and for an external symbol
ADDITIONAL INFO |
EXAMPLE | GetDataStringCount("'database name'", "'field name'", "buy", "GOOG")


Function - GETDATASTRINGCOUNTINSIDE

GETDATASTRINGCOUNTINSIDE
 Database Field Index Count Inside

Database

SYNTAX | GetDataStringCountInside( STRING database name, STRING field name, ARRAY low, ARRAY high, ENUM periodtype, ARRAY regular expression)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get the number of database field elements for each bar, for the specified limits and using the provided pattern
ADDITIONAL INFO |
EXAMPLE | GetDataStringCountInside("'database name'", "'field name'", 0, 10, P_Hour, "buy")


Function - ISDATAEXISTS

ISDATAEXISTS
 Is Database Field Exists

Database

SYNTAX | IsDataExists( STRING database name, STRING field name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the provided database field name exists, returns 0 otherwise
ADDITIONAL INFO |
EXAMPLE | IsDataExists("'database_name'", "'field name'")


Function - YEAR

YEAR
 Year

Date-time

SYNTAX | Year()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's year
ADDITIONAL INFO |
EXAMPLE | Year()


Function - DATE

DATE
 Date

Date-time

SYNTAX | Date()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the bar's Date
ADDITIONAL INFO |
EXAMPLE | Date()


Function - DATETICKS

DATETICKS
 Date Ticks

Date-time

SYNTAX | DateTicks()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of ticks that represent the current date and time
ADDITIONAL INFO |
EXAMPLE | DateTicks()


Function - DAY

DAY
 Day

Date-time

SYNTAX | Day()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's day of the month
ADDITIONAL INFO |
EXAMPLE | Day()


Function - DAYOFWEEK

DAYOFWEEK
 Day of Week

Date-time

SYNTAX | DayOfWeek()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's day of week (1 for Monday, 2 for Tuesday, 3 for Wednesday...)
ADDITIONAL INFO |
EXAMPLE | DayOfWeek()


Function - DAYOFYEAR

DAYOFYEAR
 Day of Year

Date-time

SYNTAX | DayOfYear()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's day of the year
ADDITIONAL INFO |
EXAMPLE | DayOfYear()


Function - HOUR

HOUR
 Hour

Date-time

SYNTAX | Hour()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's hour
ADDITIONAL INFO |
EXAMPLE | Hour()


Function - INTERVAL

INTERVAL
 Interval in ticks

Date-time

SYNTAX | Interval()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of ticks between the current and previous bar date
ADDITIONAL INFO |
EXAMPLE | Interval()


Function - MINUTE

MINUTE
 Minute

Date-time

SYNTAX | Minute()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's minute
ADDITIONAL INFO |
EXAMPLE | Minute()


Function - MONTH

MONTH
 Month

Date-time

SYNTAX | Month()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's month
ADDITIONAL INFO |
EXAMPLE | Month()


Function - NBDAYS

NBDAYS
 Number of days

Date-time

SYNTAX | NbDays( ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of days between the current bar and the bar referenced by the period value
ADDITIONAL INFO |
EXAMPLE | NbDays(5)


Function - NOW

NOW
 Now

Date-time

SYNTAX | Now()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the current Date
ADDITIONAL INFO |
EXAMPLE | Now()


Function - SECOND

SECOND
 Second

Date-time

SYNTAX | Second()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's second
ADDITIONAL INFO |
EXAMPLE | Second()


Function - TIMETICKS

TIMETICKS
 Time Ticks

Date-time

SYNTAX | TimeTicks()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of ticks that represent the current time
ADDITIONAL INFO |
EXAMPLE | TimeTicks()


Function - WEEK

WEEK
 Week

Date-time

SYNTAX | Week()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the current bar's week
ADDITIONAL INFO |
EXAMPLE | Week()


Function - GETSERIES

GETSERIES
 Get another symbol data

Divers

SYNTAX | GetSeries( ARRAY symbol, ENUM arrayname, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol
ADDITIONAL INFO |
EXAMPLE | GetSeries("A", close, LastData)


Function - GETSERIES

GETSERIES
 Get another symbol data

Divers

SYNTAX | GetSeries( ARRAY symbol, ENUM arrayname)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol
ADDITIONAL INFO |
EXAMPLE | GetSeries("A", close)


Function - OUTPUT

OUTPUT
 Output text

Divers

SYNTAX | Output( ARRAY text)
RETURNS |
DESCRIPTION | Set outpout window text
ADDITIONAL INFO |
EXAMPLE | Output("Hello")


Function - OUTPUTLIST

OUTPUTLIST
 Output list

Divers

SYNTAX | OutputList( ARRAY text)
RETURNS |
DESCRIPTION | Add a text to the outpout list window
ADDITIONAL INFO |
EXAMPLE | OutputList("Hello")


Function - STATES

STATES
 States

Divers

SYNTAX | States( ARRAY array, ARRAY states (ex : 70|50|30))
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array containing different states. Example: States(perf(close, 20), 10|0|-10) Returns 0 if the array element value is lower then -10, returns 1 if the array element value is between -10 and 0 and returns 2 if the array element value is higher than 10
ADDITIONAL INFO |
EXAMPLE | States(rsi(14), 70|50|30)


Function - TICKER

TICKER
 Get another symbol data

Divers

SYNTAX | Ticker( ARRAY symbol, ENUM arrayname, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol
ADDITIONAL INFO |
EXAMPLE | Ticker("A", close, LastData)


Function - TICKER1

TICKER1
 Get time-series for a different time-frame

Divers

SYNTAX | Ticker1( ARRAY symbol, ARRAY timeframe, ENUM arrayname, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol and for the specified time-frame
ADDITIONAL INFO |
EXAMPLE | Ticker1("A", 1, close, LastData)


Function - AD

AD
 Chaikin A/D Line

Indicators

SYNTAX | Ad()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chaikin A/D Line
ADDITIONAL INFO | The Accumulation/Distribution Line was developed by Marc Chaikin to assess the cumulative flow of money into and out of a security. A bullish signal is given when the Accumulation/Distribution Line forms a positive divergence (for more than a month of data). The opposite for a bearish signal.
EXAMPLE | Ad()


Function - AD

AD
 Chaikin A/D Line

Indicators

SYNTAX | Ad( ARRAY high, ARRAY low, ARRAY close, ARRAY volume)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chaikin A/D Line
ADDITIONAL INFO | The Accumulation/Distribution Line was developed by Marc Chaikin to assess the cumulative flow of money into and out of a security. A bullish signal is given when the Accumulation/Distribution Line forms a positive divergence (for more than a month of data). The opposite for a bearish signal.
EXAMPLE | Ad(high, low, close, volume)


Function - ADOSC

ADOSC
 Chaikin A/D Oscillator

Indicators

SYNTAX | AdOsc( ARRAY fastperiod, ARRAY slowperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chaikin A/D Oscillator
ADDITIONAL INFO | The Chaikin Oscillator is the Moving Average Convergence Divergence indicator (MACD) applied to the Accumulation/Distribution Line. A bullish signal happen when the price action develops a lower low into oversold zones and the oscillator diverges with a higher low and begins to rise. A bearish signal happen when the price action develops a higher high into overbought zones and the oscillator diverges with a lower high and begins to fall.
EXAMPLE | AdOsc(3, 10)


Function - ADOSC

ADOSC
 Chaikin A/D Oscillator

Indicators

SYNTAX | AdOsc( ARRAY high, ARRAY low, ARRAY close, ARRAY volume, ARRAY fastperiod, ARRAY slowperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chaikin A/D Oscillator
ADDITIONAL INFO | The Chaikin Oscillator is the Moving Average Convergence Divergence indicator (MACD) applied to the Accumulation/Distribution Line. A bullish signal happen when the price action develops a lower low into oversold zones and the oscillator diverges with a higher low and begins to rise. A bearish signal happen when the price action develops a higher high into overbought zones and the oscillator diverges with a lower high and begins to fall.
EXAMPLE | AdOsc(high, low, close, volume, 3, 10)


Function - ADX

ADX
 Average Directional Movement Index

Indicators

SYNTAX | Adx( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Directional Movement Index
ADDITIONAL INFO | The ADX is a Welles Wilder style moving average of the Directional Movement Index (DX). To interpret the ADX, consider a high number to be a strong trend, and a low number, a weak trend.
EXAMPLE | Adx(14)


Function - ADX

ADX
 Average Directional Movement Index

Indicators

SYNTAX | Adx( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Directional Movement Index
ADDITIONAL INFO | The ADX is a Welles Wilder style moving average of the Directional Movement Index (DX). To interpret the ADX, consider a high number to be a strong trend, and a low number, a weak trend.
EXAMPLE | Adx(high, low, close, 14)


Function - ADXR

ADXR
 Average Directional Movement Index Rating

Indicators

SYNTAX | Adxr( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Directional Movement Index Rating
ADDITIONAL INFO | The ADXR is the average of the two ADX values. The ADXR smoothes the ADX, and is therefore less responsive, however, the ADXR filters out excessive tops and bottoms. High ADXR value is bullish while low values is bearish.
EXAMPLE | Adxr(14)


Function - ADXR

ADXR
 Average Directional Movement Index Rating

Indicators

SYNTAX | Adxr( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Directional Movement Index Rating
ADDITIONAL INFO | The ADXR is the average of the two ADX values. The ADXR smoothes the ADX, and is therefore less responsive, however, the ADXR filters out excessive tops and bottoms. High ADXR value is bullish while low values is bearish.
EXAMPLE | Adxr(high, low, close, 14)


Function - APO

APO
 Absolute Price Oscillator

Indicators

SYNTAX | Apo( ARRAY fastperiod, ARRAY slowperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Absolute Price Oscillator
ADDITIONAL INFO | The Price Oscillator shows the difference between two moving averages. The Price Oscillator can use any time periods, unlike MACD indicator. A buy signal is generate when the Price Oscillator rises above zero, and a sell signal when the it falls below zero.
EXAMPLE | Apo(3, 10, _MaSma)


Function - APO

APO
 Absolute Price Oscillator

Indicators

SYNTAX | Apo( ARRAY high, ARRAY fastperiod, ARRAY slowperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Absolute Price Oscillator
ADDITIONAL INFO | The Price Oscillator shows the difference between two moving averages. The Price Oscillator can use any time periods, unlike MACD indicator. A buy signal is generate when the Price Oscillator rises above zero, and a sell signal when the it falls below zero.
EXAMPLE | Apo(high, 3, 10, _MaSma)


Function - AROONDOWN

AROONDOWN
 Aroon Down

Indicators

SYNTAX | AroonDown( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Down
ADDITIONAL INFO |
EXAMPLE | AroonDown(14)


Function - AROONDOWN

AROONDOWN
 Aroon Down

Indicators

SYNTAX | AroonDown( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Down
ADDITIONAL INFO |
EXAMPLE | AroonDown(high, low, 14)


Function - AROONOSC

AROONOSC
 Aroon Oscillator

Indicators

SYNTAX | AroonOsc( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Oscillator
ADDITIONAL INFO |
EXAMPLE | AroonOsc(14)


Function - AROONOSC

AROONOSC
 Aroon Oscillator

Indicators

SYNTAX | AroonOsc( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Oscillator
ADDITIONAL INFO |
EXAMPLE | AroonOsc(high, low, 14)


Function - AROONUP

AROONUP
 Aroon Up

Indicators

SYNTAX | AroonUp( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Up
ADDITIONAL INFO |
EXAMPLE | AroonUp(14)


Function - AROONUP

AROONUP
 Aroon Up

Indicators

SYNTAX | AroonUp( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Aroon Up
ADDITIONAL INFO |
EXAMPLE | AroonUp(high, low, 14)


Function - ATR

ATR
 Average True Range

Indicators

SYNTAX | Atr( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average True Range
ADDITIONAL INFO | The ATR is a measure of volatility. High ATR values indicate high volatility, and low values indicate low volatility.
EXAMPLE | Atr(14)


Function - ATR

ATR
 Average True Range

Indicators

SYNTAX | Atr( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average True Range
ADDITIONAL INFO | The ATR is a measure of volatility. High ATR values indicate high volatility, and low values indicate low volatility.
EXAMPLE | Atr(high, low, close, 14)


Function - AVGPRICE

AVGPRICE
 Average Price

Indicators

SYNTAX | AvgPrice()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Price
ADDITIONAL INFO |
EXAMPLE | AvgPrice()


Function - AVGPRICE

AVGPRICE
 Average Price

Indicators

SYNTAX | AvgPrice( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Average Price
ADDITIONAL INFO |
EXAMPLE | AvgPrice(open, high, low, close)


Function - BBANDSLOWER

BBANDSLOWER
 Bollinger Bands (Lower band)

Indicators

SYNTAX | BbandsLower( ARRAY timeperiod, ARRAY nbdevdown, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Lower band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsLower(14, 2, _MaSma)


Function - BBANDSLOWER

BBANDSLOWER
 Bollinger Bands (Lower band)

Indicators

SYNTAX | BbandsLower( ARRAY close, ARRAY timeperiod, ARRAY nbdevdown, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Lower band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsLower(close, 15, 2, _MaSma)


Function - BBANDSMIDDLE

BBANDSMIDDLE
 Bollinger Bands (Middle band)

Indicators

SYNTAX | BbandsMiddle( ARRAY timeperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Middle band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsMiddle(14, _MaSma)


Function - BBANDSMIDDLE

BBANDSMIDDLE
 Bollinger Bands (Middle band)

Indicators

SYNTAX | BbandsMiddle( ARRAY close, ARRAY timeperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Middle band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsMiddle(close, 15, _MaSma)


Function - BBANDSUPPER

BBANDSUPPER
 Bollinger Bands (Upper band)

Indicators

SYNTAX | BbandsUpper( ARRAY timeperiod, ARRAY nbdevup, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Upper band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsUpper(14, 2, _MaSma)


Function - BBANDSUPPER

BBANDSUPPER
 Bollinger Bands (Upper band)

Indicators

SYNTAX | BbandsUpper( ARRAY close, ARRAY timeperiod, ARRAY nbdevup, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Upper band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | BbandsUpper(close, 15, 2, _MaSma)


Function - BOP

BOP
 Balance Of Power

Indicators

SYNTAX | Bop()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Balance Of Power
ADDITIONAL INFO | The Balance of Market Power is an oscillator and supports price divergence, trends, and overbought-oversold levels. It can also help to determine market trends. This indicator measures the velocity of the price trend.
EXAMPLE | Bop()


Function - BOP

BOP
 Balance Of Power

Indicators

SYNTAX | Bop( ARRAY open, ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Balance Of Power
ADDITIONAL INFO | The Balance of Market Power is an oscillator and supports price divergence, trends, and overbought-oversold levels. It can also help to determine market trends. This indicator measures the velocity of the price trend.
EXAMPLE | Bop(open, high, low, close)


Function - CCI

CCI
 Commodity Channel Index

Indicators

SYNTAX | Cci( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Commodity Channel Index
ADDITIONAL INFO | The CCI is designed to detect beginning and ending market trends. A price correction is expected when CCI is above +100 (overbought) and a rally when it is below -100 (oversold). You can also look for price divergence in the CCI.
EXAMPLE | Cci(14)


Function - CCI

CCI
 Commodity Channel Index

Indicators

SYNTAX | Cci( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Commodity Channel Index
ADDITIONAL INFO | The CCI is designed to detect beginning and ending market trends. A price correction is expected when CCI is above +100 (overbought) and a rally when it is below -100 (oversold). You can also look for price divergence in the CCI.
EXAMPLE | Cci(high, low, close, 14)


Function - CMO

CMO
 Chande Momentum Oscillator

Indicators

SYNTAX | Cmo( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chande Momentum Oscillator
ADDITIONAL INFO | The Chande Momentum Indicator is a momentum indicator which use information from both up and down days. Bullish when this indicator is below level -50 and bearish when it is above level +50.
EXAMPLE | Cmo(14)


Function - CMO

CMO
 Chande Momentum Oscillator

Indicators

SYNTAX | Cmo( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Chande Momentum Oscillator
ADDITIONAL INFO | The Chande Momentum Indicator is a momentum indicator which use information from both up and down days. Bullish when this indicator is below level -50 and bearish when it is above level +50.
EXAMPLE | Cmo(close, 14)


Function - CORREL

CORREL
 Correlation Analysis

Indicators

SYNTAX | Correl( ARRAY array, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Correlation Analysis
ADDITIONAL INFO | Correlation Analysis compares two array or two samples of data to show you if one sample of data can predict the other. You can analyse coorelation between a stock against another stock or a stock against an indicator... Coorrelation between an indicator and a stock. A value above +0.7 tell you that a change in the indicator will usually predict a change in the security's price. A value below -0.7 tell you that a change in the indicator will usually predict a move of the stock price in the opposite direction. A value near 0 tell you that there is no relationship between the security's price and the indicator.
EXAMPLE | Correl(close, 100)


Function - CORREL

CORREL
 Correlation Analysis

Indicators

SYNTAX | Correl( ARRAY array, ARRAY array, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Correlation Analysis
ADDITIONAL INFO | Correlation Analysis compares two array or two samples of data to show you if one sample of data can predict the other. You can analyse coorelation between a stock against another stock or a stock against an indicator... Coorrelation between an indicator and a stock. A value above +0.7 tell you that a change in the indicator will usually predict a change in the security's price. A value below -0.7 tell you that a change in the indicator will usually predict a move of the stock price in the opposite direction. A value near 0 tell you that there is no relationship between the security's price and the indicator.
EXAMPLE | Correl(close, 0, 100)


Function - DEMA

DEMA
 Double Exponential Moving Average

Indicators

SYNTAX | Dema( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Double Exponential Moving Average
ADDITIONAL INFO | The DEMA is a smoothing indicator with less lag than a straight exponential moving average. DEMA is an acronym for Double Exponential Moving Average, but the calculation is more complex than just a moving average of a moving average.
EXAMPLE | Dema(14)


Function - DEMA

DEMA
 Double Exponential Moving Average

Indicators

SYNTAX | Dema( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Double Exponential Moving Average
ADDITIONAL INFO | The DEMA is a smoothing indicator with less lag than a straight exponential moving average. DEMA is an acronym for Double Exponential Moving Average, but the calculation is more complex than just a moving average of a moving average.
EXAMPLE | Dema(close, 14)


Function - DX

DX
 Directional Movement Index

Indicators

SYNTAX | Dx( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Directional Movement Index
ADDITIONAL INFO | Directional Movement can be used either as a system on its own or as a filter on a trend-following system. It help trader find if a particular stock is trending or not. Two lines are generated in a DMI study, +DI and -DI. The first line measures positive (upward) movement and the second number measures negative (downward) movement. A buy signal is given when the +DI line crosses over the - DI line while a sell signal is generated when the +DI line crosses below the - DI line. A low ADX value (generally less than 20) can indicate a non-trending market with low volumes whereas a cross above 20 may indicate the start of a trend (either up or down). If the ADX is over 40 and begins to fall, it can indicate the slowdown of a current trend. This indicator can also be used to identify non-trending markets, or a deterioration of an ongoing trend. Directional Movement Index was developed by Welles Wilder and explained in his book, New Concepts in Technical Trading Systems.
EXAMPLE | Dx(14)


Function - DX

DX
 Directional Movement Index

Indicators

SYNTAX | Dx( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Directional Movement Index
ADDITIONAL INFO | Directional Movement can be used either as a system on its own or as a filter on a trend-following system. It help trader find if a particular stock is trending or not. Two lines are generated in a DMI study, +DI and -DI. The first line measures positive (upward) movement and the second number measures negative (downward) movement. A buy signal is given when the +DI line crosses over the - DI line while a sell signal is generated when the +DI line crosses below the - DI line. A low ADX value (generally less than 20) can indicate a non-trending market with low volumes whereas a cross above 20 may indicate the start of a trend (either up or down). If the ADX is over 40 and begins to fall, it can indicate the slowdown of a current trend. This indicator can also be used to identify non-trending markets, or a deterioration of an ongoing trend. Directional Movement Index was developed by Welles Wilder and explained in his book, New Concepts in Technical Trading Systems.
EXAMPLE | Dx(high, low, close, 14)


Function - EMA

EMA
 Exponential Moving Average

Indicators

SYNTAX | Ema( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Exponential Moving Average
ADDITIONAL INFO | In a Simple Moving Average, each value in the time period carries equal weight, and values outside of the time period are not included in the average. However, the Exponential Moving Average is a cumulative calculation, including all data. Past values have a diminishing contribution to the average, while more recent values have a greater contribution. This method allows the moving average to be more responsive to changes in the data.
EXAMPLE | Ema(14)


Function - EMA

EMA
 Exponential Moving Average

Indicators

SYNTAX | Ema( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Exponential Moving Average
ADDITIONAL INFO | In a Simple Moving Average, each value in the time period carries equal weight, and values outside of the time period are not included in the average. However, the Exponential Moving Average is a cumulative calculation, including all data. Past values have a diminishing contribution to the average, while more recent values have a greater contribution. This method allows the moving average to be more responsive to changes in the data.
EXAMPLE | Ema(close, 14)


Function - FAMA

FAMA
 Following Adaptive Moving Average

Indicators

SYNTAX | Fama( ARRAY fastlimit, ARRAY slowlimit)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Following Adaptive Moving Average
ADDITIONAL INFO | FAMA stands for Following Adaptive Moving Average, and is a complimentary indicator to MAMA.
EXAMPLE | Fama(0.2, 0.5)


Function - FAMA

FAMA
 Following Adaptive Moving Average

Indicators

SYNTAX | Fama( ARRAY array, ARRAY fastlimit, ARRAY slowlimit)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Following Adaptive Moving Average
ADDITIONAL INFO | FAMA stands for Following Adaptive Moving Average, and is a complimentary indicator to MAMA.
EXAMPLE | Fama((high + low) / 2, 0.2, 0.5)


Function - GAPDOWN

GAPDOWN
 Gap Down

Indicators

SYNTAX | GapDown()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1, when a down gap happen
ADDITIONAL INFO |
EXAMPLE | GapDown()


Function - GAPUP

GAPUP
 Gap Up

Indicators

SYNTAX | GapUp()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1, when an up gap happen
ADDITIONAL INFO |
EXAMPLE | GapUp()


Function - HHV

HHV
 Highest

Indicators

SYNTAX | Hhv( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Highest value over a specified period
ADDITIONAL INFO |
EXAMPLE | Hhv(14)


Function - HHV

HHV
 Highest

Indicators

SYNTAX | Hhv( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Highest value over a specified period
ADDITIONAL INFO |
EXAMPLE | Hhv(close, 14)


Function - HT_DCPERIOD

HT_DCPERIOD
 Hilbert Transform - Dominant Cycle Period

Indicators

SYNTAX | Ht_Dcperiod()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Dominant Cycle Period
ADDITIONAL INFO |
EXAMPLE | Ht_Dcperiod()


Function - HT_DCPERIOD

HT_DCPERIOD
 Hilbert Transform - Dominant Cycle Period

Indicators

SYNTAX | Ht_Dcperiod( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Dominant Cycle Period
ADDITIONAL INFO |
EXAMPLE | Ht_Dcperiod(close)


Function - HT_DCPHASE

HT_DCPHASE
 Hilbert Transform - Dominant Cycle Phase

Indicators

SYNTAX | Ht_Dcphase()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Dominant Cycle Phase
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. It is meaningful only during a cyclic period of the analytic signal waveform (price series) being measured. Its transition from 360 degrees to 0 degrees can be used to designate the start of a new cycle. It can also be utilized to signal the start or end of trending or cyclic periods. Departure from a constant rate change of phase is a sensitive way to detect the end of a cycle mode. See the examples.
EXAMPLE | Ht_Dcphase()


Function - HT_DCPHASE

HT_DCPHASE
 Hilbert Transform - Dominant Cycle Phase

Indicators

SYNTAX | Ht_Dcphase( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Dominant Cycle Phase
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. It is meaningful only during a cyclic period of the analytic signal waveform (price series) being measured. Its transition from 360 degrees to 0 degrees can be used to designate the start of a new cycle. It can also be utilized to signal the start or end of trending or cyclic periods. Departure from a constant rate change of phase is a sensitive way to detect the end of a cycle mode. See the examples.
EXAMPLE | Ht_Dcphase(close)


Function - HT_LEADSINE

HT_LEADSINE
 Hilbert Transform - SineWave

Indicators

SYNTAX | Ht_Leadsine()
RETURNS | NUMERIC ARRAY
DESCRIPTION Hilbert Transform - SineWave
ADDITIONAL INFO The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The Hilbert Transform Lead Sine is just the sine of the DC Phase advanced by 45 degrees.
The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. The HTLeadSin is the sine of the DC Phase at a specific bar. It is most often used in conjunction with the HTSin indicator to identify cyclic turning points. Quoting from Market Mode Strategies.doc by John Ehlers from MESA Software, "A clear, unequivocal cycle mode indicator can be generated by plotting the Sine of the measured phase angle advanced by 45 degrees. This leading signal crosses the sinewave 1/8th of a cycle BEFORE the peaks and valleys of the cyclic turning points, enabling you to make your trading decision in time to profit from the entire amplitude swing of the cycle. A significant additional advantage is that the two indicator lines don't cross except at cyclic turning points, avoiding the false whipsaw signals of most "oscillators" when the market is in a Trend Mode. The two lines don't cross because the phase rate of change is nearly zero in a trend mode. Since the phase is not changing, the two lines separated by 45 degrees in phase never get the opportunity to cross." See the examples.
EXAMPLE | Ht_Leadsine()


Function - HT_LEADSINE

HT_LEADSINE
 Hilbert Transform - SineWave

Indicators

SYNTAX | Ht_Leadsine( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION Hilbert Transform - SineWave
ADDITIONAL INFO The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The Hilbert Transform Lead Sine is just the sine of the DC Phase advanced by 45 degrees.
The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. The HTLeadSin is the sine of the DC Phase at a specific bar. It is most often used in conjunction with the HTSin indicator to identify cyclic turning points. Quoting from Market Mode Strategies.doc by John Ehlers from MESA Software, "A clear, unequivocal cycle mode indicator can be generated by plotting the Sine of the measured phase angle advanced by 45 degrees. This leading signal crosses the sinewave 1/8th of a cycle BEFORE the peaks and valleys of the cyclic turning points, enabling you to make your trading decision in time to profit from the entire amplitude swing of the cycle. A significant additional advantage is that the two indicator lines don't cross except at cyclic turning points, avoiding the false whipsaw signals of most "oscillators" when the market is in a Trend Mode. The two lines don't cross because the phase rate of change is nearly zero in a trend mode. Since the phase is not changing, the two lines separated by 45 degrees in phase never get the opportunity to cross." See the examples.
EXAMPLE | Ht_Leadsine(close)


Function - HT_PHASORPHASE

HT_PHASORPHASE
 Hilbert Transform - Instantaneous Trendline

Indicators

SYNTAX | Ht_Phasorphase()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Instantaneous Trendline
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTInPhase returns the Hilbert Transform generated InPhase component of the input Price Series. The InPhase component is used in conjunction with the Quadrature component to generate the phase of the analytic signal (using the ArcTan function) at a specific bar or for the entire Price Series.
EXAMPLE | Ht_Phasorphase()


Function - HT_PHASORPHASE

HT_PHASORPHASE
 Hilbert Transform - Instantaneous Trendline

Indicators

SYNTAX | Ht_Phasorphase( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Instantaneous Trendline
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTInPhase returns the Hilbert Transform generated InPhase component of the input Price Series. The InPhase component is used in conjunction with the Quadrature component to generate the phase of the analytic signal (using the ArcTan function) at a specific bar or for the entire Price Series.
EXAMPLE | Ht_Phasorphase(close)


Function - HT_PHASORQUADRATURE

HT_PHASORQUADRATURE
 Hilbert Transform - Trend vs Cycle Mode

Indicators

SYNTAX | Ht_Phasorquadrature()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Trend vs Cycle Mode
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTQuadrature returns the Hilbert Transform generated Quadrature component of the input Price Series. The Quadrature component is used in conjunction with the InPhase component to generate the phase of the analytic signal (using the ArcTan function) at a specific bar or for the entire Price Series.
EXAMPLE | Ht_Phasorquadrature()


Function - HT_PHASORQUADRATURE

HT_PHASORQUADRATURE
 Hilbert Transform - Trend vs Cycle Mode

Indicators

SYNTAX | Ht_Phasorquadrature( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Trend vs Cycle Mode
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTQuadrature returns the Hilbert Transform generated Quadrature component of the input Price Series. The Quadrature component is used in conjunction with the InPhase component to generate the phase of the analytic signal (using the ArcTan function) at a specific bar or for the entire Price Series.
EXAMPLE | Ht_Phasorquadrature(close)


Function - HT_SINE

HT_SINE
 Hilbert Transform - SineWave

Indicators

SYNTAX | Ht_Sine()
RETURNS | NUMERIC ARRAY
DESCRIPTION Hilbert Transform - SineWave
ADDITIONAL INFO The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The Hilbert Transform Sine is just the sine of the DC Phase.
The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. The HTSin is the sine of the DC Phase at a specific bar. It is most often used in conjunction with the HTLeadSin indicator to identify cyclic turning points. Quoting from Market Mode Strategies.doc by John Ehlers from MESA Software, "A clear, unequivocal cycle mode indicator can be generated by plotting the Sine of the measured phase angle advanced by 45 degrees. This leading signal crosses the sinewave 1/8th of a cycle BEFORE the peaks and valleys of the cyclic turning points, enabling you to make your trading decision in time to profit from the entire amplitude swing of the cycle. A significant additional advantage is that the two indicator lines don't cross except at cyclic turning points, avoiding the false whipsaw signals of most "oscillators" when the market is in a Trend Mode. The two lines don't cross because the phase rate of change is nearly zero in a trend mode. Since the phase is not changing, the two lines separated by 45 degrees in phase never get the opportunity to cross."
EXAMPLE | Ht_Sine()


Function - HT_SINE

HT_SINE
 Hilbert Transform - SineWave

Indicators

SYNTAX | Ht_Sine( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION Hilbert Transform - SineWave
ADDITIONAL INFO The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude.. HTDCPhase returns the Hilbert Transform Phase of the Dominant Cycle. The Dominant Cycle Phase lies in the range of 0 to 360 degrees. The Hilbert Transform Sine is just the sine of the DC Phase.
The DC Phase at a specific bar gives the phase position from 0 to 360 degrees within the current Hilbert Transform Period instantaneously measured at that bar. The HTSin is the sine of the DC Phase at a specific bar. It is most often used in conjunction with the HTLeadSin indicator to identify cyclic turning points. Quoting from Market Mode Strategies.doc by John Ehlers from MESA Software, "A clear, unequivocal cycle mode indicator can be generated by plotting the Sine of the measured phase angle advanced by 45 degrees. This leading signal crosses the sinewave 1/8th of a cycle BEFORE the peaks and valleys of the cyclic turning points, enabling you to make your trading decision in time to profit from the entire amplitude swing of the cycle. A significant additional advantage is that the two indicator lines don't cross except at cyclic turning points, avoiding the false whipsaw signals of most "oscillators" when the market is in a Trend Mode. The two lines don't cross because the phase rate of change is nearly zero in a trend mode. Since the phase is not changing, the two lines separated by 45 degrees in phase never get the opportunity to cross."
EXAMPLE | Ht_Sine(close)


Function - HT_TRENDLINE

HT_TRENDLINE
 Hilbert Transform - Phasor Components

Indicators

SYNTAX | Ht_Trendline()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Phasor Components
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTTrendline (or MESA Instantaneous Trendline) returns the Price Series value after the Dominant Cycle of the analytic signal as generated by the Hilbert Transform has been removed. The Dominant Cycle can be thought of as being the "most likely" period (in the range of 10 to 40) of a sine function of the Price Series. The HTTrendline at a specific bar gives the current Hilbert Transform Trendline as instantaneously measured at that bar. In its Series form, the Instantaneous Trendline appears much like a Moving Average, but with minimal lag compared with the lag normally associated with such averages for equivalent periods. The HTTrendline is formed by removing the Dominant Cycle from the Price Series. See the examples.
EXAMPLE | Ht_Trendline()


Function - HT_TRENDLINE

HT_TRENDLINE
 Hilbert Transform - Phasor Components

Indicators

SYNTAX | Ht_Trendline( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Phasor Components
ADDITIONAL INFO | The Hilbert Transform is a technique used to generate inphase and quadrature components of a de-trended real-valued "analytic-like" signal (such as a Price Series) in order to analyze variations of the instantaneous phase and amplitude. HTTrendline (or MESA Instantaneous Trendline) returns the Price Series value after the Dominant Cycle of the analytic signal as generated by the Hilbert Transform has been removed. The Dominant Cycle can be thought of as being the "most likely" period (in the range of 10 to 40) of a sine function of the Price Series. The HTTrendline at a specific bar gives the current Hilbert Transform Trendline as instantaneously measured at that bar. In its Series form, the Instantaneous Trendline appears much like a Moving Average, but with minimal lag compared with the lag normally associated with such averages for equivalent periods. The HTTrendline is formed by removing the Dominant Cycle from the Price Series. See the examples.
EXAMPLE | Ht_Trendline(close)


Function - HT_TRENDMODE

HT_TRENDMODE
 Hilbert Transform - Phasor Components

Indicators

SYNTAX | Ht_Trendmode()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Phasor Components
ADDITIONAL INFO |
EXAMPLE | Ht_Trendmode()


Function - HT_TRENDMODE

HT_TRENDMODE
 Hilbert Transform - Phasor Components

Indicators

SYNTAX | Ht_Trendmode( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Hilbert Transform - Phasor Components
ADDITIONAL INFO |
EXAMPLE | Ht_Trendmode(close)


Function - INSIDE

INSIDE
 Inside

Indicators

SYNTAX | Inside()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1, when an inside day occurs
ADDITIONAL INFO |
EXAMPLE | Inside()


Function - KAMA

KAMA
 Kaufman Adaptive Moving Average

Indicators

SYNTAX | Kama( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kaufman Adaptive Moving Average
ADDITIONAL INFO | KAMA is an adaptive moving average, and uses the noise level of the market to determine the length of the trend required to calculate the average.
EXAMPLE | Kama(14)


Function - KAMA

KAMA
 Kaufman Adaptive Moving Average

Indicators

SYNTAX | Kama( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Kaufman Adaptive Moving Average
ADDITIONAL INFO | KAMA is an adaptive moving average, and uses the noise level of the market to determine the length of the trend required to calculate the average.
EXAMPLE | Kama(close, 14)


Function - LINEARREG

LINEARREG
 Linear Regression

Indicators

SYNTAX | LinearReg( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression
ADDITIONAL INFO | In statistics, linear regression is a regression method of modeling the conditional expected value of one variable y given the values of some other variable or variables x.
EXAMPLE | LinearReg(14)


Function - LINEARREG

LINEARREG
 Linear Regression

Indicators

SYNTAX | LinearReg( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression
ADDITIONAL INFO | In statistics, linear regression is a regression method of modeling the conditional expected value of one variable y given the values of some other variable or variables x.
EXAMPLE | LinearReg(close, 14)


Function - LINEARREG_ANGLE

LINEARREG_ANGLE
 Linear Regression Angle

Indicators

SYNTAX | LinearReg_Angle( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Angle
ADDITIONAL INFO |
EXAMPLE | LinearReg_Angle(14)


Function - LINEARREG_ANGLE

LINEARREG_ANGLE
 Linear Regression Angle

Indicators

SYNTAX | LinearReg_Angle( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Angle
ADDITIONAL INFO |
EXAMPLE | LinearReg_Angle(close, 14)


Function - LINEARREG_INTERCEPT

LINEARREG_INTERCEPT
 Linear Regression Intercept

Indicators

SYNTAX | LinearReg_Intercept( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Intercept
ADDITIONAL INFO |
EXAMPLE | LinearReg_Intercept(14)


Function - LINEARREG_INTERCEPT

LINEARREG_INTERCEPT
 Linear Regression Intercept

Indicators

SYNTAX | LinearReg_Intercept( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Intercept
ADDITIONAL INFO |
EXAMPLE | LinearReg_Intercept(close, 14)


Function - LINEARREG_SLOPE

LINEARREG_SLOPE
 Linear Regression Slope

Indicators

SYNTAX | LinearReg_Slope( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Slope
ADDITIONAL INFO | Linear Regression Slope returns the slope of the Linear Regression line of the specified period. It return the slope of a line that best fits the stock price over the specified period. Linear Regression Slope indicator is a statistical indicator. An up sloping Linear Regression line indicates that prices have been rising while a down sloping line indicates that prices have been falling.
EXAMPLE | LinearReg_Slope(14)


Function - LINEARREG_SLOPE

LINEARREG_SLOPE
 Linear Regression Slope

Indicators

SYNTAX | LinearReg_Slope( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Linear Regression Slope
ADDITIONAL INFO | Linear Regression Slope returns the slope of the Linear Regression line of the specified period. It return the slope of a line that best fits the stock price over the specified period. Linear Regression Slope indicator is a statistical indicator. An up sloping Linear Regression line indicates that prices have been rising while a down sloping line indicates that prices have been falling.
EXAMPLE | LinearReg_Slope(close, 14)


Function - LLV

LLV
 Lowest

Indicators

SYNTAX | Llv( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Lowest value over a specified period
ADDITIONAL INFO |
EXAMPLE | Llv(14)


Function - LLV

LLV
 Lowest

Indicators

SYNTAX | Llv( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Lowest value over a specified period
ADDITIONAL INFO |
EXAMPLE | Llv(close, 14)


Function - MA

MA
 Moving Average

Indicators

SYNTAX | Ma( ARRAY timeperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Moving Average
ADDITIONAL INFO | Differents type of moving average : Double Exponential Moving Average Exponential Moving Average Kaufman Adaptive Moving Average MESA Adaptive Moving Average Simple Moving Average T3 Triple Exponential Moving Average Triangular Moving Average Weighted Moving Average
EXAMPLE | Ma(15, _MaSma)


Function - MA

MA
 Moving Average

Indicators

SYNTAX | Ma( ARRAY close, ARRAY timeperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | All Moving Average
ADDITIONAL INFO | Differents type of moving average : Double Exponential Moving Average Exponential Moving Average Kaufman Adaptive Moving Average MESA Adaptive Moving Average Simple Moving Average T3 Triple Exponential Moving Average Triangular Moving Average Weighted Moving Average
EXAMPLE | Ma(close, 14, _MaSma)


Function - MACD

MACD
 Moving Average Convergence/Divergence

Indicators

SYNTAX | Macd()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Moving Average Convergence/Divergence
ADDITIONAL INFO | MACD returns the Moving Average Convergence Divergence indicator. MACD is a momentum oscillator, yet its primary use is to trade trends. MACD has two lines, one called MACD line or fast line and the other MACD signal or slow line. Differents interpretation can be made using MACD.
EXAMPLE | Macd()


Function - MACD

MACD
 Moving Average Convergence/Divergence

Indicators

SYNTAX | Macd( ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Moving Average Convergence/Divergence
ADDITIONAL INFO | MACD returns the Moving Average Convergence Divergence indicator. MACD is a momentum oscillator, yet its primary use is to trade trends. MACD has two lines, one called MACD line or fast line and the other MACD signal or slow line. Differents interpretation can be made using MACD.
EXAMPLE | Macd(close)


Function - MACDEXT

MACDEXT
 MACD with controllable MA type

Indicators

SYNTAX | MacdExt( ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD with controllable MA type
ADDITIONAL INFO | MACD returns the Moving Average Convergence Divergence indicator. MACD is a momentum oscillator, yet its primary use is to trade trends. MACD has two lines, one called MACD line or fast line and the other MACD signal or slow line. Moving Average Convergence/Divergence with controllable MA type let you choose the Moving average type to use in MACD calculations.
EXAMPLE | MacdExt(5, _MaSma, 3, _MaSma)


Function - MACDEXT

MACDEXT
 MACD with controllable MA type

Indicators

SYNTAX | MacdExt( ARRAY close, ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD with controllable MA type
ADDITIONAL INFO | MACD returns the Moving Average Convergence Divergence indicator. MACD is a momentum oscillator, yet its primary use is to trade trends. MACD has two lines, one called MACD line or fast line and the other MACD signal or slow line. Moving Average Convergence/Divergence with controllable MA type let you choose the Moving average type to use in MACD calculations.
EXAMPLE | MacdExt(close, 5, _MaSma, 3, _MaSma)


Function - MACDEXTHIST

MACDEXTHIST
 MACD Historigramme with controllable MA type

Indicators

SYNTAX | MacdExtHist( ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype, ARRAY signalperiod, ENUM signalmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Historigramme with controllable MA type
ADDITIONAL INFO | The MACD Histogram show the divergence between the MACD and its reference line (the 9-day Exponential Moving Average). The MACD Histogram with controllable MA type let you choose the Moving average type to use in MACD Histogram calculations.
EXAMPLE | MacdExtHist(5, _MaSma, 3, _MaSma, 15, _MaSma)


Function - MACDEXTHIST

MACDEXTHIST
 MACD Historigramme with controllable MA type

Indicators

SYNTAX | MacdExtHist( ARRAY close, ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype, ARRAY signalperiod, ENUM signalmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Historigramme with controllable MA type
ADDITIONAL INFO | The MACD Histogram show the divergence between the MACD and its reference line (the 9-day Exponential Moving Average). The MACD Histogram with controllable MA type let you choose the Moving average type to use in MACD Histogram calculations.
EXAMPLE | MacdExtHist(close, 5, _MaSma, 3, _MaSma, 15, _MaSma)


Function - MACDEXTSIGNAL

MACDEXTSIGNAL
 MACD Signal with controllable MA type

Indicators

SYNTAX | MacdExtSignal( ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype, ARRAY signalperiod, ENUM signalmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Signal with controllable MA type
ADDITIONAL INFO |
EXAMPLE | MacdExtSignal(5, _MaSma, 3, _MaSma, 15, _MaSma)


Function - MACDEXTSIGNAL

MACDEXTSIGNAL
 MACD Signal with controllable MA type

Indicators

SYNTAX | MacdExtSignal( ARRAY close, ARRAY fastperiod, ENUM fastmovingaveragetype, ARRAY slowperiod, ENUM slowmovingaveragetype, ARRAY signalperiod, ENUM signalmovingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Signal with controllable MA type
ADDITIONAL INFO |
EXAMPLE | MacdExtSignal(close, 5, _MaSma, 3, _MaSma, 15, _MaSma)


Function - MACDHIST

MACDHIST
 MACD Historigramme

Indicators

SYNTAX | MacdHist( ARRAY signalperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Historigramme
ADDITIONAL INFO | The MACD Histogram show the divergence between the MACD and its reference line (the 9-day Exponential Moving Average).
EXAMPLE | MacdHist(15)


Function - MACDHIST

MACDHIST
 MACD Historigramme

Indicators

SYNTAX | MacdHist( ARRAY close, ARRAY signalperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Historigramme
ADDITIONAL INFO | The MACD Histogram show the divergence between the MACD and its reference line (the 9-day Exponential Moving Average).
EXAMPLE | MacdHist(close, 15)


Function - MACDSIGNAL

MACDSIGNAL
 MACD Signal

Indicators

SYNTAX | MacdSignal( ARRAY signalperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Signal
ADDITIONAL INFO |
EXAMPLE | MacdSignal(15)


Function - MACDSIGNAL

MACDSIGNAL
 MACD Signal

Indicators

SYNTAX | MacdSignal( ARRAY close, ARRAY signalperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MACD Signal
ADDITIONAL INFO |
EXAMPLE | MacdSignal(close, 15)


Function - MAMA

MAMA
 MESA Adaptive Moving Average

Indicators

SYNTAX | Mama( ARRAY fastlimit, ARRAY slowlimit)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MESA Adaptive Moving Average
ADDITIONAL INFO | MAMA stands for MESA Adaptive Moving Average.
EXAMPLE | Mama(0.2, 0.5)


Function - MAMA

MAMA
 MESA Adaptive Moving Average

Indicators

SYNTAX | Mama( ARRAY array, ARRAY fastlimit, ARRAY slowlimit)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MESA Adaptive Moving Average
ADDITIONAL INFO | MAMA stands for MESA Adaptive Moving Average.
EXAMPLE | Mama((high + low) / 2, 0.2, 0.5)


Function - MEDPRICE

MEDPRICE
 Median Price

Indicators

SYNTAX | MedPrice()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Median Price
ADDITIONAL INFO | The Median Price function calculates the midpoint between the high and low prices for the day. The median price (called also mean or average price) provides a simplified view of the trading prices for the day.
EXAMPLE | MedPrice()


Function - MEDPRICE

MEDPRICE
 Median Price

Indicators

SYNTAX | MedPrice( ARRAY high, ARRAY low)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Median Price
ADDITIONAL INFO | The Median Price function calculates the midpoint between the high and low prices for the day. The median price (called also mean or average price) provides a simplified view of the trading prices for the day.
EXAMPLE | MedPrice(high, low)


Function - MFI

MFI
 Money Flow Index

Indicators

SYNTAX | Mfi( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Money Flow Index
ADDITIONAL INFO | The Money Flow Index is another momentum indicator illustrating the strength of money flowing into and out of a security. The essentiel difference between the Money Flow and others momentum indicator is that the money flow incorporates volume in addition to pricing information.
EXAMPLE | Mfi(14)


Function - MFI

MFI
 Money Flow Index

Indicators

SYNTAX | Mfi( ARRAY high, ARRAY low, ARRAY close, ARRAY volume, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Money Flow Index
ADDITIONAL INFO | The Money Flow Index is another momentum indicator illustrating the strength of money flowing into and out of a security. The essentiel difference between the Money Flow and others momentum indicator is that the money flow incorporates volume in addition to pricing information.
EXAMPLE | Mfi(high, low, close, volume, 14)


Function - MIDPOINT

MIDPOINT
 MidPoint

Indicators

SYNTAX | MidPoint( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MidPoint over period
ADDITIONAL INFO | Simply (highest value + lowest value)/2.
EXAMPLE | MidPoint(14)


Function - MIDPOINT

MIDPOINT
 MidPoint

Indicators

SYNTAX | MidPoint( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MidPoint over period
ADDITIONAL INFO | Simply (highest value + lowest value)/2.
EXAMPLE | MidPoint(close, 14)


Function - MIDPRICE

MIDPRICE
 MidPoint Price

Indicators

SYNTAX | MidPrice( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MidPoint Price over period
ADDITIONAL INFO | Midpoint Price over period Simply (highest high + lowest low)/2
EXAMPLE | MidPrice(14)


Function - MIDPRICE

MIDPRICE
 MidPoint Price

Indicators

SYNTAX | MidPrice( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | MidPoint Price over period
ADDITIONAL INFO | Midpoint Price over period Simply (highest high + lowest low)/2
EXAMPLE | MidPrice(high, low, 14)


Function - MINUS_DI

MINUS_DI
 Minus Directional Indicator

Indicators

SYNTAX | Minus_Di( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Minus Directional Indicator
ADDITIONAL INFO |
EXAMPLE | Minus_Di(14)


Function - MINUS_DI

MINUS_DI
 Minus Directional Indicator

Indicators

SYNTAX | Minus_Di( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Minus Directional Indicator
ADDITIONAL INFO |
EXAMPLE | Minus_Di(high, low, close, 14)


Function - MINUS_DM

MINUS_DM
 Minus Directional Movement

Indicators

SYNTAX | Minus_Dm( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Minus Directional Movement
ADDITIONAL INFO |
EXAMPLE | Minus_Dm(14)


Function - MINUS_DM

MINUS_DM
 Minus Directional Movement

Indicators

SYNTAX | Minus_Dm( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Minus Directional Movement
ADDITIONAL INFO |
EXAMPLE | Minus_Dm(high, low, 14)


Function - MOM

MOM
 Momentum

Indicators

SYNTAX | Mom( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Momentum
ADDITIONAL INFO | The Momentum indicator provides an indication of a market's velocity The Momentum indicator is used as a trend-following oscillator similar to the MACD This indicator is bullish when it bottoms and turns up and bearish when it peaks and turns down.
EXAMPLE | Mom(14)


Function - MOM

MOM
 Momentum

Indicators

SYNTAX | Mom( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Momentum
ADDITIONAL INFO | The Momentum indicator provides an indication of a market's velocity The Momentum indicator is used as a trend-following oscillator similar to the MACD This indicator is bullish when it bottoms and turns up and bearish when it peaks and turns down.
EXAMPLE | Mom(close, 14)


Function - NATR

NATR
 Normalized Average True Range

Indicators

SYNTAX | Natr( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Normalized Average True Range
ADDITIONAL INFO |
EXAMPLE | Natr(14)


Function - NATR

NATR
 Normalized Average True Range

Indicators

SYNTAX | Natr( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Normalized Average True Range
ADDITIONAL INFO |
EXAMPLE | Natr(high, low, close, 14)


Function - OBV

OBV
 On Balance Volume

Indicators

SYNTAX | Obv()
RETURNS | NUMERIC ARRAY
DESCRIPTION | On Balance Volume
ADDITIONAL INFO | On Balance Volume is a momentum indicator that relates volume to price change. On Balance Volume keeps a running total of volume flowing into or out of a security. When the security closes higher than the previous close, all of the day's volume is considered up-volume. A close lower than the previous day's results in all of the day's volume considered down-volume. Rising trends is considered bullish, while falling trends is bearish.
EXAMPLE | Obv()


Function - OBV

OBV
 On Balance Volume

Indicators

SYNTAX | Obv( ARRAY close, ARRAY volume)
RETURNS | NUMERIC ARRAY
DESCRIPTION | On Balance Volume
ADDITIONAL INFO | On Balance Volume is a momentum indicator that relates volume to price change. On Balance Volume keeps a running total of volume flowing into or out of a security. When the security closes higher than the previous close, all of the day's volume is considered up-volume. A close lower than the previous day's results in all of the day's volume considered down-volume. Rising trends is considered bullish, while falling trends is bearish.
EXAMPLE | Obv(close, volume)


Function - OUTSIDE

OUTSIDE
 Outside

Indicators

SYNTAX | Outside()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1, when an outside day occurs
ADDITIONAL INFO |
EXAMPLE | Outside()


Function - PLUS_DI

PLUS_DI
 Plus Directional Indicator

Indicators

SYNTAX | Plus_Di( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Plus Directional Indicator
ADDITIONAL INFO |
EXAMPLE | Plus_Di(14)


Function - PLUS_DI

PLUS_DI
 Plus Directional Indicator

Indicators

SYNTAX | Plus_Di( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Plus Directional Indicator
ADDITIONAL INFO |
EXAMPLE | Plus_Di(high, low, close, 14)


Function - PLUS_DM

PLUS_DM
 Plus Directional Movement

Indicators

SYNTAX | Plus_Dm( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Plus Directional Movement
ADDITIONAL INFO |
EXAMPLE | Plus_Dm(14)


Function - PLUS_DM

PLUS_DM
 Plus Directional Movement

Indicators

SYNTAX | Plus_Dm( ARRAY high, ARRAY low, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Plus Directional Movement
ADDITIONAL INFO |
EXAMPLE | Plus_Dm(high, low, 14)


Function - PPO

PPO
 Percentage Price Oscillator

Indicators

SYNTAX | Ppo( ARRAY fastperiod, ARRAY slowperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Percentage Price Oscillator
ADDITIONAL INFO | The Percentage Price Oscillator indicator shows the variation in percentage among two moving averages for the price of a security. When the short-term moving average or price rises above the longer-term moving average it is considered bullish. Bearish for the opposite (Short-term moving average or price drop below the longer-term moving average).
EXAMPLE | Ppo(3, 10, _MaSma)


Function - PPO

PPO
 Percentage Price Oscillator

Indicators

SYNTAX | Ppo( ARRAY close, ARRAY fastperiod, ARRAY slowperiod, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Percentage Price Oscillator
ADDITIONAL INFO | The Percentage Price Oscillator indicator shows the variation in percentage among two moving averages for the price of a security. When the short-term moving average or price rises above the longer-term moving average it is considered bullish. Bearish for the opposite (Short-term moving average or price drop below the longer-term moving average).
EXAMPLE | Ppo(close, 3, 10, _MaSma)


Function - ROC

ROC
 Rate of change

Indicators

SYNTAX | Roc( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change
ADDITIONAL INFO | The Rate of Change is an oscillator that displays the difference between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : ((price/prevPrice)-1)*100
EXAMPLE | Roc(14)


Function - ROC

ROC
 Rate of change

Indicators

SYNTAX | Roc( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change
ADDITIONAL INFO | The Rate of Change is an oscillator that displays the difference between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : ((price/prevPrice)-1)*100
EXAMPLE | Roc(close, 14)


Function - ROCP

ROCP
 Rate of change Percentage

Indicators

SYNTAX | Rocp( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change Percentage
ADDITIONAL INFO | The Rate of Change Percentage is an oscillator that displays the difference in percentage between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price-prevPrice)/prevPrice
EXAMPLE | Rocp(14)


Function - ROCP

ROCP
 Rate of change Percentage

Indicators

SYNTAX | Rocp( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change Percentage
ADDITIONAL INFO | The Rate of Change Percentage is an oscillator that displays the difference in percentage between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price-prevPrice)/prevPrice
EXAMPLE | Rocp(close, 14)


Function - ROCR100

ROCR100
 Rate of change ratio (scale 100)

Indicators

SYNTAX | Rocr100( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change ratio (scale 100)
ADDITIONAL INFO | The Rate of Change ratio 100 scale is an oscillator that displays the difference (in a scale of 100) between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price/prevPrice)*100
EXAMPLE | Rocr100(14)


Function - ROCR100

ROCR100
 Rate of change ratio (scale 100)

Indicators

SYNTAX | Rocr100( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change ratio (scale 100)
ADDITIONAL INFO | The Rate of Change ratio 100 scale is an oscillator that displays the difference (in a scale of 100) between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price/prevPrice)*100
EXAMPLE | Rocr100(close, 14)


Function - ROCR

ROCR
 Rate of change ratio

Indicators

SYNTAX | Rocr( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change ratio
ADDITIONAL INFO | The Rate of Change ratio is an oscillator that displays the difference (ratio) between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price/prevPrice)
EXAMPLE | Rocr(14)


Function - ROCR

ROCR
 Rate of change ratio

Indicators

SYNTAX | Rocr( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Rate of change ratio
ADDITIONAL INFO | The Rate of Change ratio is an oscillator that displays the difference (ratio) between the current price and the price x-time periods ago. The Rate of change indicator show overbought/oversold areas like many others indicators. Overbought means that the stock price is expected to fall while oversold means that the stock price is expected to fall. But, often extremely overbought/oversold readings usually imply a continuation of the current trend. Formula : (price/prevPrice)
EXAMPLE | Rocr(close, 14)


Function - RSI

RSI
 Relative Strength Index

Indicators

SYNTAX | Rsi( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Relative Strength Index
ADDITIONAL INFO | The Wilder's Relative Strength Index is a rate of change oscillator. Relative Strength Index does not compare the relative performance of one stock to another, instead it compares the price of a stock to itself. A reading of 70% or higher is generally an overbought position. Conversely, values near the 30% level should be considered an indication the situation has become oversold. When the stock price is trending, use Relative Strength Index to trade strictly with the trend. The Wilder's Relative Strength Index was developed by J. Welles Wilder, Jr.
EXAMPLE | Rsi(14)


Function - RSI

RSI
 Relative Strength Index

Indicators

SYNTAX | Rsi( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Relative Strength Index
ADDITIONAL INFO | The Wilder's Relative Strength Index is a rate of change oscillator. Relative Strength Index does not compare the relative performance of one stock to another, instead it compares the price of a stock to itself. A reading of 70% or higher is generally an overbought position. Conversely, values near the 30% level should be considered an indication the situation has become oversold. When the stock price is trending, use Relative Strength Index to trade strictly with the trend. The Wilder's Relative Strength Index was developed by J. Welles Wilder, Jr.
EXAMPLE | Rsi(close, 14)


Function - SAR

SAR
 Parabolic SAR

Indicators

SYNTAX | Sar( ARRAY acceleration, ARRAY maximum)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | Sar(0.02, 0.2)


Function - SAR

SAR
 Parabolic SAR

Indicators

SYNTAX | Sar( ARRAY high, ARRAY low, ARRAY acceleration, ARRAY maximum)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | Sar(high, low, 0.02, 0.2)


Function - SAREXT

SAREXT
 Parabolic SAR - Extended

Indicators

SYNTAX | SarExt( ARRAY startvalue, ARRAY offsetonreverse, ARRAY accelerationinitlong, ARRAY accelerationlong, ARRAY accelerationmaxlong, ARRAY accelerationinitshort, ARRAY accelerationshort, ARRAY accelerationmaxshort)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR - Extended
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | SarExt(0, 0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)


Function - SAREXT

SAREXT
 Parabolic SAR - Extended

Indicators

SYNTAX | SarExt( ARRAY high, ARRAY low, ARRAY startvalue, ARRAY offsetonreverse, ARRAY accelerationinitlong, ARRAY accelerationlong, ARRAY accelerationmaxlong, ARRAY accelerationinitshort, ARRAY accelerationshort, ARRAY accelerationmaxshort)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR - Extended
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | SarExt(high, low, 0, 0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)


Function - SMA

SMA
 Simple Moving Average

Indicators

SYNTAX | Sma( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Simple Moving Average
ADDITIONAL INFO | The Simple Moving Average is calculated by summing the closing prices of the security for a period of time and then dividing this total by the number of time periods. the SMA is basically the average stock price over time. One of the moving average use is to show the trend direction of a security price.
EXAMPLE | Sma(14)


Function - SMA

SMA
 Simple Moving Average

Indicators

SYNTAX | Sma( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Simple Moving Average
ADDITIONAL INFO | The Simple Moving Average is calculated by summing the closing prices of the security for a period of time and then dividing this total by the number of time periods. the SMA is basically the average stock price over time. One of the moving average use is to show the trend direction of a security price.
EXAMPLE | Sma(close, 14)


Function - STDDEV

STDDEV
 Standard Deviation

Indicators

SYNTAX | Stddev( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Standard Deviation
ADDITIONAL INFO | Standard Deviation is a statistical measurement of volatility. It measures how widely values range from the average value. High standard deviation means high volatility and large difference between the closing prices and the average closing price.
EXAMPLE | Stddev(100)


Function - STDDEV

STDDEV
 Standard Deviation

Indicators

SYNTAX | Stddev( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Standard Deviation
ADDITIONAL INFO | Standard Deviation is a statistical measurement of volatility. It measures how widely values range from the average value. High standard deviation means high volatility and large difference between the closing prices and the average closing price.
EXAMPLE | Stddev(close, 100)


Function - STOCHFASTD

STOCHFASTD
 Stochastic Fast D

Indicators

SYNTAX | StochFastd( ARRAY fastk_period, ARRAY fastd_period, ENUM fastd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Fast D
ADDITIONAL INFO |
EXAMPLE | StochFastd(5, 5, _MaSma)


Function - STOCHFASTD

STOCHFASTD
 Stochastic Fast D

Indicators

SYNTAX | StochFastd( ARRAY high, ARRAY low, ARRAY close, ARRAY fastk_period, ARRAY fastd_period, ENUM fastd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Fast D
ADDITIONAL INFO |
EXAMPLE | StochFastd(high, low, close, 5, 5, _MaSma)


Function - STOCHFASTK

STOCHFASTK
 Stochastic Fast K

Indicators

SYNTAX | StochFastk( ARRAY fastk_period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Fast K
ADDITIONAL INFO |
EXAMPLE | StochFastk(5)


Function - STOCHFASTK

STOCHFASTK
 Stochastic Fast K

Indicators

SYNTAX | StochFastk( ARRAY high, ARRAY low, ARRAY close, ARRAY fastk_period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Fast K
ADDITIONAL INFO |
EXAMPLE | StochFastk(high, low, close, 5)


Function - STOCHRSIFASTD

STOCHRSIFASTD
 Stochastic Relative Strength Index Fast D

Indicators

SYNTAX | StochRsiFastd( ARRAY timeperiod, ARRAY fastk_period, ARRAY fastd_period, ENUM fastd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Relative Strength Index Fast D
ADDITIONAL INFO |
EXAMPLE | StochRsiFastd(15, 5, 5, _MaSma)


Function - STOCHRSIFASTD

STOCHRSIFASTD
 Stochastic Relative Strength Index Fast D

Indicators

SYNTAX | StochRsiFastd( ARRAY close, ARRAY timeperiod, ARRAY fastk_period, ARRAY fastd_period, ENUM fastd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Relative Strength Index Fast D
ADDITIONAL INFO |
EXAMPLE | StochRsiFastd(close, 15, 5, 5, _MaSma)


Function - STOCHRSIFASTK

STOCHRSIFASTK
 Stochastic Relative Strength Index Fast K

Indicators

SYNTAX | StochRsiFastk( ARRAY timeperiod, ARRAY fastk_period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Relative Strength Index Fast K
ADDITIONAL INFO |
EXAMPLE | StochRsiFastk(15, 5)


Function - STOCHRSIFASTK

STOCHRSIFASTK
 Stochastic Relative Strength Index Fast K

Indicators

SYNTAX | StochRsiFastk( ARRAY close, ARRAY timeperiod, ARRAY fastk_period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Relative Strength Index Fast K
ADDITIONAL INFO |
EXAMPLE | StochRsiFastk(close, 15, 5)


Function - STOCHSLOWD

STOCHSLOWD
 Stochastic Slow D

Indicators

SYNTAX | StochSlowd( ARRAY fastk_period, ARRAY slowk_period, ENUM slowk_movingaveragetype, ARRAY slowd_period, ENUM slowd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Slow D
ADDITIONAL INFO |
EXAMPLE | StochSlowd(5, 3, _MaSma, 3, _MaSma)


Function - STOCHSLOWD

STOCHSLOWD
 Stochastic Slow D

Indicators

SYNTAX | StochSlowd( ARRAY high, ARRAY low, ARRAY close, ARRAY volume, ARRAY fastk_period, ARRAY slowk_period, ENUM slowk_movingaveragetype, ARRAY slowd_period, ENUM slowd_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Slow D
ADDITIONAL INFO |
EXAMPLE | StochSlowd(high, low, close, volume, 5, 3, _MaSma, 3, _MaSma)


Function - STOCHSLOWK

STOCHSLOWK
 Stochastic Slow K

Indicators

SYNTAX | StochSlowk( ARRAY fastk_period, ARRAY slowk_period, ENUM slowk_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Slow K
ADDITIONAL INFO |
EXAMPLE | StochSlowk(5, 3, _MaSma)


Function - STOCHSLOWK

STOCHSLOWK
 Stochastic Slow K

Indicators

SYNTAX | StochSlowk( ARRAY high, ARRAY low, ARRAY close, ARRAY volume, ARRAY fastk_period, ARRAY slowk_period, ENUM slowk_movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Stochastic Slow K
ADDITIONAL INFO |
EXAMPLE | StochSlowk(high, low, close, volume, 5, 3, _MaSma)


Function - T3

T3
 Triple Exponential Moving Average (T3)

Indicators

SYNTAX | T3( ARRAY timeperiod, ARRAY vfactor)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triple Exponential Moving Average (T3)
ADDITIONAL INFO | The T3 is a type of moving average, or smoothing function. It use the DEMA in its calculations; the DEMA which use the MA in its proper calculations.
EXAMPLE | T3(14, 1)


Function - T3

T3
 Triple Exponential Moving Average (T3)

Indicators

SYNTAX | T3( ARRAY close, ARRAY timeperiod, ARRAY vfactor)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triple Exponential Moving Average (T3)
ADDITIONAL INFO | The T3 is a type of moving average, or smoothing function. It use the DEMA in its calculations; the DEMA which use the MA in its proper calculations.
EXAMPLE | T3(close, 14, 1)


Function - TEMA

TEMA
 Triple Exponential Moving Average

Indicators

SYNTAX | Tema( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triple Exponential Moving Average
ADDITIONAL INFO | The TEMA is a smoothing indicator with less lag than a straight exponential moving average.
EXAMPLE | Tema(14)


Function - TEMA

TEMA
 Triple Exponential Moving Average

Indicators

SYNTAX | Tema( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triple Exponential Moving Average
ADDITIONAL INFO | The TEMA is a smoothing indicator with less lag than a straight exponential moving average.
EXAMPLE | Tema(close, 14)


Function - TRANGE

TRANGE
 True Range

Indicators

SYNTAX | Trange()
RETURNS | NUMERIC ARRAY
DESCRIPTION | True Range
ADDITIONAL INFO | The True Range function is used to determine the normal trading range of a stock or commodity.
EXAMPLE | Trange()


Function - TRANGE

TRANGE
 True Range

Indicators

SYNTAX | Trange( ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | True Range
ADDITIONAL INFO | The True Range function is used to determine the normal trading range of a stock or commodity.
EXAMPLE | Trange(high, low, close)


Function - TRIMA

TRIMA
 Triangular Moving Average

Indicators

SYNTAX | Trima( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triangular Moving Average
ADDITIONAL INFO | The Triangular Moving Average is equivalent to a Simple Moving Average of a Simple Moving Average.
EXAMPLE | Trima(14)


Function - TRIMA

TRIMA
 Triangular Moving Average

Indicators

SYNTAX | Trima( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Triangular Moving Average
ADDITIONAL INFO | The Triangular Moving Average is equivalent to a Simple Moving Average of a Simple Moving Average.
EXAMPLE | Trima(close, 14)


Function - TRIX

TRIX
 Trix

Indicators

SYNTAX | Trix( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
ADDITIONAL INFO | TRIX is an indicator that correspond to a percent rate-of-change of a triple-smoothed exponential moving average of a closing price. It is a momentum indicator which moves up over and under a zero line. A movement above is bullish, while a movement below is bearish.
EXAMPLE | Trix(14)


Function - TRIX

TRIX
 Trix

Indicators

SYNTAX | Trix( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
ADDITIONAL INFO | TRIX is an indicator that correspond to a percent rate-of-change of a triple-smoothed exponential moving average of a closing price. It is a momentum indicator which moves up over and under a zero line. A movement above is bullish, while a movement below is bearish.
EXAMPLE | Trix(close, 14)


Function - TSF

TSF
 Time Series Forecast

Indicators

SYNTAX | Tsf( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Time Series Forecast
ADDITIONAL INFO | The Time Series Forecast function displays the statistical trend of a security's price over a specified time period based on linear regression analysis.
EXAMPLE | Tsf(14)


Function - TSF

TSF
 Time Series Forecast

Indicators

SYNTAX | Tsf( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Time Series Forecast
ADDITIONAL INFO | The Time Series Forecast function displays the statistical trend of a security's price over a specified time period based on linear regression analysis.
EXAMPLE | Tsf(close, 14)


Function - TYPPRICE

TYPPRICE
 Typical Price

Indicators

SYNTAX | TypPrice( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Typical Price
ADDITIONAL INFO | The Typical Price function calculates the average of the high, low, and closing prices for the day. Its an interesting function as it incluse in one line information for the entire trading day. You can also compare this line to its moving average to determine if a security is trending.
EXAMPLE | TypPrice(14)


Function - TYPPRICE

TYPPRICE
 Typical Price

Indicators

SYNTAX | TypPrice( ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Typical Price
ADDITIONAL INFO | The Typical Price function calculates the average of the high, low, and closing prices for the day. Its an interesting function as it incluse in one line information for the entire trading day. You can also compare this line to its moving average to determine if a security is trending.
EXAMPLE | TypPrice(high, low, close)


Function - ULTOSC

ULTOSC
 Ultimate Oscillator

Indicators

SYNTAX | UltOsc( ARRAY timeperiod1, ARRAY timeperiod2, ARRAY timeperiod3)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Ultimate Oscillator
ADDITIONAL INFO | The Ultimate Oscillator combines a stock's price action during three different time frames into one oscillator. Oversold territory is below 30 while overbought territory is above 70. The Ultimate Oscillator was developed by Larry Williams.
EXAMPLE | UltOsc(7, 14, 28)


Function - ULTOSC

ULTOSC
 Ultimate Oscillator

Indicators

SYNTAX | UltOsc( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod1, ARRAY timeperiod2, ARRAY timeperiod3)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Ultimate Oscillator
ADDITIONAL INFO | The Ultimate Oscillator combines a stock's price action during three different time frames into one oscillator. Oversold territory is below 30 while overbought territory is above 70. The Ultimate Oscillator was developed by Larry Williams.
EXAMPLE | UltOsc(high, low, close, 7, 14, 28)


Function - VAR

VAR
 Variance

Indicators

SYNTAX | Var( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Variance
ADDITIONAL INFO | The variance is a statistical measure of the dispersion of values arount the expected value. The standard deviation is the square root of the variance.
EXAMPLE | Var(100)


Function - VAR

VAR
 Variance

Indicators

SYNTAX | Var( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Variance
ADDITIONAL INFO | The variance is a statistical measure of the dispersion of values arount the expected value. The standard deviation is the square root of the variance.
EXAMPLE | Var(close, 100)


Function - WCLPRICE

WCLPRICE
 Weighted Close Price

Indicators

SYNTAX | WclPrice()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Weighted Close Price
ADDITIONAL INFO | The Weighted Close indicator calculates an average of each day's price. the Weighted Close provides a simplified view of the day.
EXAMPLE | WclPrice()


Function - WCLPRICE

WCLPRICE
 Weighted Close Price

Indicators

SYNTAX | WclPrice( ARRAY high, ARRAY low, ARRAY close)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Weighted Close Price
ADDITIONAL INFO | The Weighted Close indicator calculates an average of each day's price. the Weighted Close provides a simplified view of the day.
EXAMPLE | WclPrice(high, low, close)


Function - WILLR

WILLR
 Williams' %R

Indicators

SYNTAX | Willr( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Williams' %R
ADDITIONAL INFO | Williams %R is a momentum indicator that is designed to identify overbought and oversold areas in a nontrending market. A bullish signal happen when the indicator is in an oversold area and the price change direction to the upward. The opposite for the bearish signal. Williams %R was developed by Larry Williams.
EXAMPLE | Willr(14)


Function - WILLR

WILLR
 Williams' %R

Indicators

SYNTAX | Willr( ARRAY high, ARRAY low, ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Williams' %R
ADDITIONAL INFO | Williams %R is a momentum indicator that is designed to identify overbought and oversold areas in a nontrending market. A bullish signal happen when the indicator is in an oversold area and the price change direction to the upward. The opposite for the bearish signal. Williams %R was developed by Larry Williams.
EXAMPLE | Willr(high, low, close, 14)


Function - WMA

WMA
 Weighted Moving Average

Indicators

SYNTAX | Wma( ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Weighted Moving Average
ADDITIONAL INFO | A Weighted Moving Average is a Moving Average indicator that shows the average value of a security's price over a period of time with special emphasis on the more recent portions of the time period under analysis.
EXAMPLE | Wma(14)


Function - WMA

WMA
 Weighted Moving Average

Indicators

SYNTAX | Wma( ARRAY close, ARRAY timeperiod)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Weighted Moving Average
ADDITIONAL INFO | A Weighted Moving Average is a Moving Average indicator that shows the average value of a security's price over a period of time with special emphasis on the more recent portions of the time period under analysis.
EXAMPLE | Wma(close, 14)


Function - ABSOLUTE

ABSOLUTE
 Absolute Value

Math

SYNTAX | Absolute( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the absolute value of each element in the array
ADDITIONAL INFO |
EXAMPLE | Absolute(-1)


Function - ATAN

ATAN
 Atan

Math

SYNTAX | Atan( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the arc tangent of each element in the array
ADDITIONAL INFO |
EXAMPLE | Atan(1)


Function - AVG

AVG
 Average

Math

SYNTAX | Avg( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the average of the ARRAY for all the lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | Avg(close)


Function - AVG

AVG
 Average

Math

SYNTAX | Avg( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the average of the ARRAY for the specified number of lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | Avg(close, 10)


Function - CEIL

CEIL
 Ceiling

Math

SYNTAX | Ceil( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, calculate the lowest integer greater than or equal to the element value
ADDITIONAL INFO |
EXAMPLE | Ceil(1.2)


Function - COS

COS
 Cos

Math

SYNTAX | Cos( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the cosinus of each element in the array
ADDITIONAL INFO |
EXAMPLE | Cos(1)


Function - COSH

COSH
 Cosh

Math

SYNTAX | Cosh( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the hyperbolic cosine of each element in the array
ADDITIONAL INFO |
EXAMPLE | Cosh(1)


Function - DIVREM

DIVREM
 DivRem

Math

SYNTAX | DivRem( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, calculate the quotion
ADDITIONAL INFO |
EXAMPLE | DivRem(1, 1)


Function - EXP

EXP
 Exp

Math

SYNTAX | Exp( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, calculate 'e' raised to the element value
ADDITIONAL INFO |
EXAMPLE | Exp(1)


Function - FLOOR

FLOOR
 Floor

Math

SYNTAX | Floor( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, calculate the largest integer less than or equal to the element value
ADDITIONAL INFO |
EXAMPLE | Floor(1.2)


Function - FRAC

FRAC
 Frac

Math

SYNTAX | Frac( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the fractional part of each element in the array
ADDITIONAL INFO |
EXAMPLE | Frac(1.2)


Function - IEEEREMAINDER

IEEEREMAINDER
 IeeeRemainder

Math

SYNTAX | IeeeRemainder( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, calculate the remainder resulting from the division of the element value by the specified number
ADDITIONAL INFO |
EXAMPLE | IeeeRemainder(1, 1)


Function - INT

INT
 Int

Math

SYNTAX | Int( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the integer part of each element in the array
ADDITIONAL INFO |
EXAMPLE | Int(1.2)


Function - LOG10

LOG10
 Log10

Math

SYNTAX | Log10( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the base 10 logarithm of each element in the array
ADDITIONAL INFO |
EXAMPLE | Log10(10)


Function - LOG

LOG
 Log

Math

SYNTAX | Log( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the natural logarithm (ln) of each element in the array
ADDITIONAL INFO |
EXAMPLE | Log(1)


Function - MAX

MAX
 Max

Math

SYNTAX | Max( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar of the ARRAY, returns the largest one
ADDITIONAL INFO |
EXAMPLE | Max(perf(close, 10), 0)


Function - MIN

MIN
 Min

Math

SYNTAX | Min( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar of the ARRAY, returns the smallest one
ADDITIONAL INFO |
EXAMPLE | Min(perf(close, 10), 0)


Function - POW

POW
 Pow

Math

SYNTAX | Pow( ARRAY array, ARRAY power)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each element in the array, raise the element value to the specified power
ADDITIONAL INFO |
EXAMPLE | Pow(2, 2)


Function - RANDOM

RANDOM
 Random Number

Math

SYNTAX | Random( ARRAY min, ARRAY max)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns a random number between min and max
ADDITIONAL INFO |
EXAMPLE | Random(0, 100)


Function - ROUND

ROUND
 Round

Math

SYNTAX | Round( ARRAY array, ARRAY decimals)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the rounded value of each element in the array
ADDITIONAL INFO |
EXAMPLE | Round(1.222, 2)


Function - SHARPE

SHARPE
 Sharpe

Math

SYNTAX | Sharpe( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the sharpe ratio for the specified array and period
ADDITIONAL INFO |
EXAMPLE | Sharpe(close, 30)


Function - SIGN

SIGN
 Sign

Math

SYNTAX | Sign( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the sign of each element in the array
ADDITIONAL INFO |
EXAMPLE | Sign(1)


Function - SIN

SIN
 Sin

Math

SYNTAX | Sin( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the sinus of each element in the array
ADDITIONAL INFO |
EXAMPLE | Sin(1)


Function - SINH

SINH
 Sinh

Math

SYNTAX | Sinh( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the hyperbolic sine of each element in the array
ADDITIONAL INFO |
EXAMPLE | Sinh(1)


Function - SQRT

SQRT
 Sqrt

Math

SYNTAX | Sqrt( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the square root of each element in the array
ADDITIONAL INFO |
EXAMPLE | Sqrt(4)


Function - SUM

SUM
 Sum

Math

SYNTAX | Sum( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates a cumulative sum of the ARRAY for all the lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | Sum(perf(close, 10) > 0)


Function - SUM

SUM
 Sum

Math

SYNTAX | Sum( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates a cumulative sum of the ARRAY for the specified number of lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | Sum(perf(close, 10) > 0, 20)


Function - TAN

TAN
 Tan

Math

SYNTAX | Tan( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the tangent of each element in the array
ADDITIONAL INFO |
EXAMPLE | Tan(1)


Function - TANH

TANH
 Tanh

Math

SYNTAX | Tanh( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the hyperbolic tangent of each element in the array
ADDITIONAL INFO |
EXAMPLE | Tanh(1)


Function - BSIGNAL

BSIGNAL
 Optimal signal

Optimal Signal

SYNTAX | BSignal( ARRAY min profit, ARRAY max drawdown, ARRAY minimum days, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Gives you the best long and short entries and exits depending on the parameters you choose Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent, a minimum number of bars equal to 10 and a maximum number of bars equal to 100 The system will give you the most profitable trades that meet these criteria Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows Click on those arrows to see additional information
ADDITIONAL INFO |
EXAMPLE | BSignal(30, -10, -1, 300)


Function - BSIGNALLONG

BSIGNALLONG
 Optimal long signal

Optimal Signal

SYNTAX | BSignalLong( ARRAY min profit, ARRAY max drawdown, ARRAY minimum days, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Gives you the best long entries and exits depending on the parameters you choose Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent, a minimum number of bars equal to 10 and a maximum number of bars equal to 100 The system will give you the most profitable trades that meet these criteria Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows Click on those arrows to see additional information
ADDITIONAL INFO |
EXAMPLE | BSignalLong(30, -10, -1, 300)


Function - BSIGNALSHORT

BSIGNALSHORT
 Optimal short signal

Optimal Signal

SYNTAX | BSignalShort( ARRAY min profit, ARRAY max drawdown, ARRAY minimum days, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Gives you the best short entries and exits depending on the parameters you choose Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent, a minimum number of bars equal to 10 and a maximum number of bars equal to 100 The system will give you the most profitable trades that meet these criteria Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows Click on those arrows to see additional information
ADDITIONAL INFO |
EXAMPLE | BSignalShort(30, -10, -1, 300)


Function - ENTRYLONGPROFIT

ENTRYLONGPROFIT

Optimal Signal

SYNTAX | EntryLongProfit( ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached
ADDITIONAL INFO |
EXAMPLE | EntryLongProfit(-10, -1)


Function - ENTRYLONGPROFITCOND

ENTRYLONGPROFITCOND

Optimal Signal

SYNTAX | EntryLongProfitCond( ARRAY condition, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached , then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitCond(1, -10, -1)


Function - ENTRYLONGPROFITCONDEXITRULE

ENTRYLONGPROFITCONDEXITRULE

Optimal Signal

SYNTAX | EntryLongProfitCondExitRule( ARRAY condition, ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitCondExitRule(1, 1, -10, -1)


Function - ENTRYLONGPROFITEXITRULE

ENTRYLONGPROFITEXITRULE

Optimal Signal

SYNTAX | EntryLongProfitExitRule( ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitExitRule(1, -10, -1)


Function - ENTRYLONGPROFITPERBAR

ENTRYLONGPROFITPERBAR

Optimal Signal

SYNTAX | EntryLongProfitPerBar( ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitPerBar(-10, -1)


Function - ENTRYLONGPROFITPERBARCOND

ENTRYLONGPROFITPERBARCOND

Optimal Signal

SYNTAX | EntryLongProfitPerBarCond( ARRAY condition, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached , then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitPerBarCond(1, -10, -1)


Function - ENTRYLONGPROFITPERBARCONDEXITRULE

ENTRYLONGPROFITPERBARCONDEXITRULE

Optimal Signal

SYNTAX | EntryLongProfitPerBarCondExitRule( ARRAY condition, ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitPerBarCondExitRule(1, 1, -10, -1)


Function - ENTRYLONGPROFITPERBAREXITRULE

ENTRYLONGPROFITPERBAREXITRULE

Optimal Signal

SYNTAX | EntryLongProfitPerBarExitRule( ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
ADDITIONAL INFO |
EXAMPLE | EntryLongProfitPerBarExitRule(1, -10, -1)


Function - ENTRYSHORTPROFIT

ENTRYSHORTPROFIT

Optimal Signal

SYNTAX | EntryShortProfit( ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached
ADDITIONAL INFO |
EXAMPLE | EntryShortProfit(-10, -1)


Function - ENTRYSHORTPROFITCOND

ENTRYSHORTPROFITCOND

Optimal Signal

SYNTAX | EntryShortProfitCond( ARRAY condition, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached , then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitCond(1, -10, -1)


Function - ENTRYSHORTPROFITCONDEXITRULE

ENTRYSHORTPROFITCONDEXITRULE

Optimal Signal

SYNTAX | EntryShortProfitCondExitRule( ARRAY condition, ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitCondExitRule(1, 1, -10, -1)


Function - ENTRYSHORTPROFITEXITRULE

ENTRYSHORTPROFITEXITRULE

Optimal Signal

SYNTAX | EntryShortProfitExitRule( ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitExitRule(1, -10, -1)


Function - ENTRYSHORTPROFITPERBAR

ENTRYSHORTPROFITPERBAR

Optimal Signal

SYNTAX | EntryShortProfitPerBar( ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitPerBar(-10, -1)


Function - ENTRYSHORTPROFITPERBARCOND

ENTRYSHORTPROFITPERBARCOND

Optimal Signal

SYNTAX | EntryShortProfitPerBarCond( ARRAY condition, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached , then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitPerBarCond(1, -10, -1)


Function - ENTRYSHORTPROFITPERBARCONDEXITRULE

ENTRYSHORTPROFITPERBARCONDEXITRULE

Optimal Signal

SYNTAX | EntryShortProfitPerBarCondExitRule( ARRAY condition, ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, then move to the bar number (next bar number + last trade holding period)
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitPerBarCondExitRule(1, 1, -10, -1)


Function - ENTRYSHORTPROFITPERBAREXITRULE

ENTRYSHORTPROFITPERBAREXITRULE

Optimal Signal

SYNTAX | EntryShortProfitPerBarExitRule( ARRAY exit, ARRAY max drawdown, ARRAY maximum days)
RETURNS | NUMERIC ARRAY
DESCRIPTION | For each bar in the 'close' array, calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
ADDITIONAL INFO |
EXAMPLE | EntryShortProfitPerBarExitRule(1, -10, -1)


Function - GETPRECALCULATEDGLOBAL

GETPRECALCULATEDGLOBAL
 Pre-calculated global value

Pre-calculated-value

SYNTAX | GetPreCalculatedGlobal( STRING field)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a global pre-calculated value (example: Last quote date)
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedGlobal("'Last quote date'")


Function - GETPRECALCULATEDVALUE

GETPRECALCULATEDVALUE
 PreCalculated Value

Pre-calculated-value

SYNTAX | GetPreCalculatedValue( STRING field)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValue("'last day volume'")


Function - GETPRECALCULATEDVALUE

GETPRECALCULATEDVALUE
 PreCalculated Value

Pre-calculated-value

SYNTAX | GetPreCalculatedValue( STRING field, ARRAY symbol name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValue("'last day volume'", "A")


Function - GETPRECALCULATEDVALUESTRING

GETPRECALCULATEDVALUESTRING
 Pre-calculated String

Pre-calculated-value

SYNTAX | GetPreCalculatedValueString( STRING field)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a STRING pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValueString("'date of last quote'")


Function - GETPRECALCULATEDVALUESTRING

GETPRECALCULATEDVALUESTRING
 Pre-calculated String

Pre-calculated-value

SYNTAX | GetPreCalculatedValueString( STRING field, ARRAY symbol name)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a STRING pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValueString("'date of last quote'", "A")


Function - PVAL

PVAL
 PreCalculated Value

Pre-calculated-value

SYNTAX | PVal( STRING field)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | PVal("'last day volume'")


Function - PVAL

PVAL
 PreCalculated Value

Pre-calculated-value

SYNTAX | PVal( STRING field, ARRAY symbol name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | PVal("'last day volume'", "A")


Function - PVALG

PVALG
 Pre-calculated global value

Pre-calculated-value

SYNTAX | PValG( STRING field)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a global pre-calculated value (example: Last quote date)
ADDITIONAL INFO |
EXAMPLE | PValG("'Last quote date'")


Function - PVALS

PVALS
 Pre-calculated String

Pre-calculated-value

SYNTAX | PValS( STRING field)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a STRING pre-calculated value
ADDITIONAL INFO |
EXAMPLE | PValS("'date of last quote'")


Function - PVALS

PVALS
 Pre-calculated String

Pre-calculated-value

SYNTAX | PValS( STRING field, ARRAY symbol name)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a STRING pre-calculated value
ADDITIONAL INFO |
EXAMPLE | PValS("'date of last quote'", "A")


Function - PREDICT

PREDICT
 Predict the next value

Predictions

SYNTAX | Predict( STRING category, STRING name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Return an array containing the predictions of the specified model
ADDITIONAL INFO |
EXAMPLE | Predict("category_name", "prediction_model_name")


Function - PREDICTSYMBOL

PREDICTSYMBOL
 Return '1' if the current symbol was used druing the training of the specified model

Predictions

SYNTAX | PredictSymbol( STRING category, STRING name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the selected model is created using the sepecified ticker data, returns 0 otherwise.
ADDITIONAL INFO |
EXAMPLE | PredictSymbol("category_name", "prediction_model_name")


Function - RANKING

RANKING
 Ranking System

Ranking

SYNTAX | Ranking( STRING category, STRING name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Apply the selected ranking system to the current symbol and returns an array containing the result for each bar
ADDITIONAL INFO |
EXAMPLE | Ranking("category_name", "ranking_system_name")


Function - APPLYRULE

APPLYRULE
 Apply a Trading Rule

Rules

SYNTAX | ApplyRule( STRING category, STRING name, ARRAY rule index (set -1 to get the number of rules in the specified list))
RETURNS | NUMERIC ARRAY
DESCRIPTION | Apply a trading rule given its index value and the name of the list of rules
ADDITIONAL INFO |
EXAMPLE | ApplyRule("category_name", "list_rules_name", 1)


Function - BUYPRICE

BUYPRICE
 Limit/Stop price for buy order

Simulator

SYNTAX | BuyPrice( ARRAY limit/stop, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the Limit/Stop price for the buy order (Set order type using 'SetSimTiming' function). This limit order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | BuyPrice(close * 1.01, 5)


Function - BUYPRICE

BUYPRICE
 Stop & Limit prices for buy order

Simulator

SYNTAX | BuyPrice( ARRAY stop, ARRAY limit, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the Limit & Stop price for the buy order (Set order type using 'SetSimTiming' function. Example: _StopLimit). The order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | BuyPrice(close * 1.01, close, 5)


Function - COVERPRICE

COVERPRICE
 Limit/Stop price for cover order

Simulator

SYNTAX | CoverPrice( ARRAY limit/stop, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the Limit/Stop price for the cover order (Set order type using 'SetSimTiming' function). This limit order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | CoverPrice(close * 1.01, 5)


Function - COVERPRICE

COVERPRICE
 Stop & Limit prices for cover order

Simulator

SYNTAX | CoverPrice( ARRAY stop, ARRAY limit, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the Limit & Stop price for the cover order (Set order type using 'SetSimTiming' function. Example: _StopLimit). The order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | CoverPrice(close * 1.01, close, 5)


Function - DRAWDOWN

DRAWDOWN
 Drawdown

Simulator

SYNTAX | Drawdown()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the drawdown curve of the current symbol
ADDITIONAL INFO |
EXAMPLE | Drawdown()


Function - EQUITY

EQUITY
 Equity

Simulator

SYNTAX | Equity()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the equity curve of the current symbol, starting from 100
ADDITIONAL INFO |
EXAMPLE | Equity()


Function - OPTIMIZE

OPTIMIZE
 Optimize variables

Simulator

SYNTAX | Optimize( ARRAY variable name, ARRAY min, ARRAY max, ARRAY step)
RETURNS |
DESCRIPTION | Used by the simulator to optimize a variable
ADDITIONAL INFO |
EXAMPLE | Optimize("a", 1, 5, 1)


Function - SELLPRICE

SELLPRICE
 Limit/Stop price for sell order

Simulator

SYNTAX | SellPrice( ARRAY limit/stop, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the Limit/Stop price for the sell order (Set order type using 'SetSimTiming' function). This limit order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | SellPrice(close * 1.01, 5)


Function - SELLPRICE

SELLPRICE
 Stop & Limit prices for sell order

Simulator

SYNTAX | SellPrice( ARRAY stop, ARRAY limit, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the Limit & Stop price for the sell order (Set order type using 'SetSimTiming' function. Example: _StopLimit). The order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | SellPrice(close * 1.01, close, 5)


Function - SETSIMCOMMISSION

SETSIMCOMMISSION
 Simulation commissions

Simulator

SYNTAX | SetSimCommission( ENUM commission type, ARRAY value)
RETURNS |
DESCRIPTION | Update the simulator commission setting
ADDITIONAL INFO |
EXAMPLE | SetSimCommission(_Percentage, 0.02)


Function - SETSIMLONGRANK

SETSIMLONGRANK
 Simulation long ranking system

Simulator

SYNTAX | SetSimLongRank( ARRAY array)
RETURNS |
DESCRIPTION | Override the simulator long ranking system and create a simple long simulation ranking system using the provided array
ADDITIONAL INFO |
EXAMPLE | SetSimLongRank(rsi(14))


Function - SETSIMPERIODS

SETSIMPERIODS
 Simulation periods

Simulator

SYNTAX | SetSimPeriods( ARRAY start year, ARRAY start month, ARRAY start day, ARRAY end year, ARRAY end month, ARRAY end day)
RETURNS |
DESCRIPTION | Update the simulator start and end periods
ADDITIONAL INFO |
EXAMPLE | SetSimPeriods(2000, 1, 1, 2011, 12, 29)


Function - SETSIMREFSYMBOL

SETSIMREFSYMBOL
 Simulation reference symbol

Simulator

SYNTAX | SetSimRefSymbol( ARRAY symbol name)
RETURNS |
DESCRIPTION | Update the simulator reference symbol
ADDITIONAL INFO |
EXAMPLE | SetSimRefSymbol("^RUT")


Function - SETSIMSETTING

SETSIMSETTING
 Simulation settings

Simulator

SYNTAX | SetSimSetting( ENUM setting item, ARRAY value)
RETURNS |
DESCRIPTION | Update the simulator settings
ADDITIONAL INFO |
EXAMPLE | SetSimSetting(_NbPositions, 10)


Function - SETSIMSHORTRANK

SETSIMSHORTRANK
 Simulation short ranking system

Simulator

SYNTAX | SetSimShortRank( ARRAY array)
RETURNS |
DESCRIPTION | Override the simulator short ranking system and create a simple short simulation ranking system using the provided array
ADDITIONAL INFO |
EXAMPLE | SetSimShortRank(1 / rsi(14))


Function - SETSIMSTOP

SETSIMSTOP
 Simulation stops

Simulator

SYNTAX | SetSimStop( ENUM stop type, ENUM stop entry, ARRAY value, ARRAY reentry)
RETURNS |
DESCRIPTION | Update the simulator stops
ADDITIONAL INFO |
EXAMPLE | SetSimStop(_StopLoss, _Percent, 20, 1)


SETSIMTIMING
Simulation timing

Simulator

SYNTAX | SetSimTiming( ENUM entry type, ENUM entry price, ARRAY decalage (0 to execute the next bar))
RETURNS |
DESCRIPTION | Update the trading system order type
ADDITIONAL INFO |
EXAMPLE | SetSimTiming(_Buy, _Open, 1)


Function - SHORTPRICE

SHORTPRICE
 Limit/Stop price for short order

Simulator

SYNTAX | ShortPrice( ARRAY limit/stop, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the Limit/Stop price for the short order (Set order type using 'SetSimTiming' function). This limit order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | ShortPrice(close * 1.01, 5)


Function - SHORTPRICE

SHORTPRICE
 Stop & Limit prices for short order

Simulator

SYNTAX | ShortPrice( ARRAY stop, ARRAY limit, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the Limit & Stop price for the short order (Set order type using 'SetSimTiming' function. Example: _StopLimit). The order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | ShortPrice(close * 1.01, close, 5)


Function - GETDATASTRING

GETDATASTRING
 String Database Field

String

SYNTAX | GetDataString( STRING database name, STRING field name, ARRAY regular expression)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a string array from a database field
ADDITIONAL INFO |
EXAMPLE | GetDataString("'database_name'", "'field_name'", "buy")


Function - GETDATASTRINGINDEX

GETDATASTRINGINDEX
 String Database Field Index

String

SYNTAX | GetDataStringIndex( STRING database name, STRING field name, ARRAY index, ARRAY regular expression)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a string array from a database field, index parameter specify the index of the data (When using for example intraday database with an historical timeframe)
ADDITIONAL INFO |
EXAMPLE | GetDataStringIndex("'database_name'", "'field_name'", 0, "buy")


Function - GETDATASTRINGINSIDE

GETDATASTRINGINSIDE
 String Database Field Index Inside

String

SYNTAX | GetDataStringInside( STRING database name, STRING field name, ARRAY low, ARRAY high, ENUM periodtype, ARRAY regular expression)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a string array from a database field (Accept only values which date are inside the specified limits)
ADDITIONAL INFO |
EXAMPLE | GetDataStringInside("'database name'", "'field name'", 0, 10, P_Hour, "buy")


Function - IFFSTR

IFFSTR
 IF-Then-Else

String

SYNTAX | IffStr( ARRAY , ARRAY , ARRAY )
RETURNS | TEXT ARRAY
DESCRIPTION | A conditional function that returns the value of the first string parameter if condition is true (different from 0), if condition is false then it returns the value of the second string parameter.
ADDITIONAL INFO |
EXAMPLE | IffStr(rsi(14) > 50, "TRUE", "FALSE")


Function - STRINGCONTAINS

STRINGCONTAINS
 String Contains

String

SYNTAX | StringContains( ARRAY string, ARRAY string)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the first string parameter contains the second string parameter, 0 otherwise
ADDITIONAL INFO |
EXAMPLE | StringContains("HELLO", "HE")


Function - STRINGEQUAL

STRINGEQUAL
 String Equals

String

SYNTAX | StringEqual( ARRAY string, ARRAY string)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the two strings are equal, 0 otherwise
ADDITIONAL INFO |
EXAMPLE | StringEqual("HELLO", "HELLO")


Function - STRINGEXTRACT

STRINGEXTRACT
 String Extract

String

SYNTAX | StringExtract( ARRAY string, ARRAY value, ARRAY value1)
RETURNS | TEXT ARRAY
DESCRIPTION | Extract a string from the string in the first parameter, starting at the specified number in the second parameter and ending at the specified number in the third parameter
ADDITIONAL INFO |
EXAMPLE | StringExtract("HELLO", 1, 3)


Function - STRINGEXTRACTENDS

STRINGEXTRACTENDS
 String Extract Ends

String

SYNTAX | StringExtractEnds( ARRAY string, ARRAY value)
RETURNS | TEXT ARRAY
DESCRIPTION | Extract a string from the string in the first parameter, starting from (Length of the first parameter string - number in the second parameter) and ending at the length of the first parameter string
ADDITIONAL INFO |
EXAMPLE | StringExtractEnds("HELLO", 2)


Function - STRINGEXTRACTSTART

STRINGEXTRACTSTART
 String Extract Start

String

SYNTAX | StringExtractStart( ARRAY string, ARRAY value)
RETURNS | TEXT ARRAY
DESCRIPTION | Extract a string from the string in the first parameter, starting at 0 and ending at the specified number in the second parameter
ADDITIONAL INFO |
EXAMPLE | StringExtractStart("HELLO", 2)


Function - STRINGINSERT

STRINGINSERT
 String Insert

String

SYNTAX | StringInsert( ARRAY string, ARRAY toinsert, ARRAY index)
RETURNS | TEXT ARRAY
DESCRIPTION | Insert in the first parameter the second parameter string at the specified index number
ADDITIONAL INFO |
EXAMPLE | StringInsert(" EVERYBODY", "HELLO", 0)


Function - STRINGLENGTH

STRINGLENGTH
 String Length

String

SYNTAX | StringLength( ARRAY string)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the length of the string
ADDITIONAL INFO |
EXAMPLE | StringLength("HELLO")


Function - STRINGREPLACE

STRINGREPLACE
 String Replace

String

SYNTAX | StringReplace( ARRAY string, ARRAY oldvalue, ARRAY newvalue)
RETURNS | TEXT ARRAY
DESCRIPTION | Replace in the first parameter string, oldValue with newValue
ADDITIONAL INFO |
EXAMPLE | StringReplace("HELLO", "O", "OOOO")


Function - ADDRESS

ADDRESS
 Address

Symbol Info

SYNTAX | Address()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Address
ADDITIONAL INFO |
EXAMPLE | Address()


Function - COUNTRY

COUNTRY
 Country

Symbol Info

SYNTAX | Country()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Country
ADDITIONAL INFO |
EXAMPLE | Country()


Function - CURRENCY

CURRENCY
 Currency

Symbol Info

SYNTAX | Currency()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Currency
ADDITIONAL INFO |
EXAMPLE | Currency()


Function - FULLNAME

FULLNAME
 FullName

Symbol Info

SYNTAX | FullName()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's FullName
ADDITIONAL INFO |
EXAMPLE | FullName()


Function - GROUP

GROUP
 Group

Symbol Info

SYNTAX | Group()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Group
ADDITIONAL INFO |
EXAMPLE | Group()


Function - INDEX

INDEX
 Index

Symbol Info

SYNTAX | Index()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Index
ADDITIONAL INFO |
EXAMPLE | Index()


Function - INDUSTRY

INDUSTRY
 Industry

Symbol Info

SYNTAX | Industry()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Industry
ADDITIONAL INFO |
EXAMPLE | Industry()


Function - ISINLIST

ISINLIST
 Is In List

Symbol Info

SYNTAX | IsInList( ENUM list type, ARRAY list name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the current symbol is in the specified list
ADDITIONAL INFO |
EXAMPLE | IsInList(_Watchlist, "list")


Function - MARKET

MARKET
 Market

Symbol Info

SYNTAX | Market()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Market
ADDITIONAL INFO |
EXAMPLE | Market()


Function - NAME1

NAME1
 Name1

Symbol Info

SYNTAX | Name1()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Name1
ADDITIONAL INFO |
EXAMPLE | Name1()


Function - NAME2

NAME2
 Name2

Symbol Info

SYNTAX | Name2()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Name2
ADDITIONAL INFO |
EXAMPLE | Name2()


Function - NAME3

NAME3
 Name3

Symbol Info

SYNTAX | Name3()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Name3
ADDITIONAL INFO |
EXAMPLE | Name3()


Function - NAME

NAME
 Name

Symbol Info

SYNTAX | Name()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Name
ADDITIONAL INFO |
EXAMPLE | Name()


Function - SECTOR

SECTOR
 Sector

Symbol Info

SYNTAX | Sector()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Sector
ADDITIONAL INFO |
EXAMPLE | Sector()


Function - WEBSITE

WEBSITE
 Website

Symbol Info

SYNTAX | Website()
RETURNS | TEXT ARRAY
DESCRIPTION | Returns the symbol's Website
ADDITIONAL INFO |
EXAMPLE | Website()


Function - AMA

AMA
 Adaptive Moving Average

Technical

SYNTAX | AMA( ARRAY array, ARRAY smoothing factor)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the adaptive moving average, which is a moving average with a time-variant smoothing factor.
ADDITIONAL INFO |
EXAMPLE | AMA(close, 0.4)


Function - AVGIF

AVGIF
 Average If

Technical

SYNTAX | AvgIf( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates, when condition is TRUE, the average of the ARRAY for all the lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | AvgIf(perf(close, 10) > 0, close)


Function - AVGIF

AVGIF
 Average If

Technical

SYNTAX | AvgIf( ARRAY condition, ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates, when condition is TRUE, the average of the ARRAY for the specified number of lookback periods (current bar is included) (When the condition is true)
ADDITIONAL INFO |
EXAMPLE | AvgIf(perf(close, 10) > 0, close, 10)


Function - BARSSINCE

BARSSINCE
 Bars Since

Technical

SYNTAX | BarsSince( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the number of bars that have passed since the array was different from 0
ADDITIONAL INFO |
EXAMPLE | BarsSince(perf(close, 10) > 10)


Function - COUNT

COUNT
 Count

Technical

SYNTAX | Count()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars
ADDITIONAL INFO |
EXAMPLE | Count()


Function - CROSS

CROSS
 Cross

Technical

SYNTAX | Cross( ARRAY , ARRAY )
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns '1', when the first array crosses above the second array, otherwise the result is '0'
ADDITIONAL INFO |
EXAMPLE | Cross(sma(14), sma(21))


Function - GFUN

GFUN
 Gaussian

Technical

SYNTAX | GFun( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the gaussian for the specified array
ADDITIONAL INFO |
EXAMPLE | GFun(volume, 30)


Function - GROUPBY

GROUPBY
 Group past values

Technical

SYNTAX | GroupBy( ARRAY array, ARRAY groupby, ENUM calculation method)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Groups all past values and returns a number based on a given calculation method
ADDITIONAL INFO |
EXAMPLE | GroupBy(perf(close, 1), DayOfWeek(), "avg")


Function - GROUPBY

GROUPBY
 Group past values

Technical

SYNTAX | GroupBy( ARRAY array, ARRAY groupby, ENUM calculation method, ARRAY bars to consider, ARRAY offset)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Groups past values (defined by the last 2 parameters) and returns a number based on a given calculation method
ADDITIONAL INFO |
EXAMPLE | GroupBy(perf(close, 1), DayOfWeek(), "avg", 30, 0)


Function - GROUPBY

GROUPBY
 Group past values

Technical

SYNTAX | GroupBy( ARRAY array, ARRAY groupby, ENUM calculation method, ARRAY bars to consider, ARRAY offset, ARRAY filter)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Groups past values (that pass the filter) and returns a number based on a given calculation method
ADDITIONAL INFO |
EXAMPLE | GroupBy(perf(close, 1), DayOfWeek(), "avg", 30, 0, perf(close, 1) > 0)


Function - HHVLB

HHVLB
 Highest Since

Technical

SYNTAX | HhvLb( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the array reached its highest value
ADDITIONAL INFO |
EXAMPLE | HhvLb(close)


Function - HHVLB

HHVLB
 Highest Since

Technical

SYNTAX | HhvLb( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the array reached its highest value over the specified period
ADDITIONAL INFO |
EXAMPLE | HhvLb(close, 20)


Function - HIGHESTSINCE

HIGHESTSINCE
 Highest Since

Technical

SYNTAX | HighestSince( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the highest value of the array since CONDITION was TRUE on the most recent occurrence
ADDITIONAL INFO |
EXAMPLE | HighestSince(cross( close, sma(close, 20)), rsi(14))


Function - HIGHESTSINCE

HIGHESTSINCE
 Highest Since

Technical

SYNTAX | HighestSince( ARRAY condition, ARRAY array, ARRAY n-th)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the highest value of the array since CONDITION was TRUE on the n-th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | HighestSince(cross( close, sma(close, 20)), rsi(14), 1)


Function - HIGHESTSINCEBARS

HIGHESTSINCEBARS
 Bars Since Highest

Technical

SYNTAX | HighestSinceBars( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of trading bars that have passed since the highest value of the array and since CONDITION was TRUE on the most recent occurrence
ADDITIONAL INFO |
EXAMPLE | HighestSinceBars(cross( close, sma(close, 20)), rsi(14))


Function - HIGHESTSINCEBARS

HIGHESTSINCEBARS
 Bars Since Highest

Technical

SYNTAX | HighestSinceBars( ARRAY condition, ARRAY array, ARRAY n-th)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of trading bars that have passed since the highest value of the array and since CONDITION was TRUE on the n-th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | HighestSinceBars(cross( close, sma(close, 20)), rsi(14), 1)


Function - HISTOPRICE

HISTOPRICE
 Historical prices from intraday data

Technical

SYNTAX | HistoPrice( ENUM price, ARRAY day lag (o to get the current day))
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the historical close, open, high, low, volume or open interest of past days
ADDITIONAL INFO |
EXAMPLE | HistoPrice(_open, 1)


Function - HISTOPRICE

HISTOPRICE
 Historical prices from intraday data

Technical

SYNTAX | HistoPrice( ENUM price, ARRAY day lag (o to get the current day), ARRAY use open session time. 1 for true.)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the historical close, open, high, low, volume or open interest of past days. Ability to select whether to use session open time or not.
ADDITIONAL INFO |
EXAMPLE | HistoPrice(_open, 1, 1)


Function - IFF

IFF
 IF-Then-Else

Technical

SYNTAX | Iff( ARRAY , ARRAY , ARRAY )
RETURNS | NUMERIC ARRAY
DESCRIPTION | A conditional function that returns the value of the first parameter if condition is true (different from 0), if condition is false then it returns the value of the second parameter.
ADDITIONAL INFO |
EXAMPLE | Iff(rsi(14) > 50, 1, 0)


Function - ISFALSE

ISFALSE
 Is False

Technical

SYNTAX | IsFalse( ARRAY array, ARRAY lag)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if all the values between the current bar and the lag bar are inferior or equal to 0
ADDITIONAL INFO |
EXAMPLE | IsFalse(perf(close, 10), 20)


Function - ISLASTBAR

ISLASTBAR
 Is Last Bars

Technical

SYNTAX | IsLastBar()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if the the current bar is the last one
ADDITIONAL INFO |
EXAMPLE | IsLastBar()


Function - ISNAN

ISNAN
 Is NaN

Technical

SYNTAX | IsNaN( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if all elements in the array equal to NaN
ADDITIONAL INFO |
EXAMPLE | IsNaN(1)


Function - ISNONAN

ISNONAN
 Is not NaN

Technical

SYNTAX | IsNoNaN( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 0 if at least one elements in the array is equal to NaN
ADDITIONAL INFO |
EXAMPLE | IsNoNaN(1)


Function - ISNOZERO

ISNOZERO
 Is not Zero

Technical

SYNTAX | IsNoZero( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 0 if at least one elements in the array is equal to 0
ADDITIONAL INFO |
EXAMPLE | IsNoZero(1)


Function - ISNULL

ISNULL
 Is NULL

Technical

SYNTAX | IsNull( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if all elements in the array equal to 0
ADDITIONAL INFO |
EXAMPLE | IsNull(1)


Function - ISTRUE

ISTRUE
 Is True

Technical

SYNTAX | IsTrue( ARRAY array, ARRAY lag)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if all the values between the current bar and the lag bar are superior to 0
ADDITIONAL INFO |
EXAMPLE | IsTrue(perf(close, 10), 20)


Function - LASTNOTNULLVALUE

LASTNOTNULLVALUE
 Last not null

Technical

SYNTAX | LastNotNullValue( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the last (not equal to 0) value of the ARRAY
ADDITIONAL INFO |
EXAMPLE | LastNotNullValue(close)


Function - LASTVALUE

LASTVALUE
 Last Value

Technical

SYNTAX | LastValue( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the last value of the ARRAY
ADDITIONAL INFO |
EXAMPLE | LastValue(close)


Function - LLVLB

LLVLB
 Lowest Since

Technical

SYNTAX | LlvLb( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the array reached its lowest value
ADDITIONAL INFO |
EXAMPLE | LlvLb(close)


Function - LLVLB

LLVLB
 Lowest Since

Technical

SYNTAX | LlvLb( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the array reached its lowest value over the specified period
ADDITIONAL INFO |
EXAMPLE | LlvLb(close, 20)


Function - LOWESTSINCE

LOWESTSINCE
 Lowest Since

Technical

SYNTAX | LowestSince( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the lowest value of the array since CONDITION was TRUE on the most recent occurrence
ADDITIONAL INFO |
EXAMPLE | LowestSince(cross( close, sma(close, 20)), rsi(14))


Function - LOWESTSINCE

LOWESTSINCE
 Lowest Since

Technical

SYNTAX | LowestSince( ARRAY condition, ARRAY array, ARRAY n-th)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the lowest value of the array since CONDITION was TRUE on the n-th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | LowestSince(cross( close, sma(close, 20)), rsi(14), 1)


Function - LOWESTSINCEBARS

LOWESTSINCEBARS
 Bars Since Lowest

Technical

SYNTAX | LowestSinceBars( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of trading bars that have passed since the lowest value of the array and since CONDITION was TRUE on the most recent occurrence
ADDITIONAL INFO |
EXAMPLE | LowestSinceBars(cross( close, sma(close, 20)), rsi(14))


Function - LOWESTSINCEBARS

LOWESTSINCEBARS
 Bars Since Lowest

Technical

SYNTAX | LowestSinceBars( ARRAY condition, ARRAY array, ARRAY n-th)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of trading bars that have passed since the lowest value of the array and since CONDITION was TRUE on the n-th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | LowestSinceBars(cross( close, sma(close, 20)), rsi(14), 1)


Function - LSWITCH

LSWITCH
 Latching Switch

Technical

SYNTAX | LSwitch( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 for all bars after the first array is 'true' until a 'true' occurs in the second array. In this case, next bars will get 0 until the first array is 'true' again.
ADDITIONAL INFO |
EXAMPLE | LSwitch(rsi(14) > 50, rsi(14) < 50)


Function - NANTOLAST

NANTOLAST
 NaN to Last

Technical

SYNTAX | NaNtoLast( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Update the NA values with the last non NaN values
ADDITIONAL INFO |
EXAMPLE | NaNtoLast(perf(close, -10))


Function - NANTOZERO

NANTOZERO
 NaN values to Zero

Technical

SYNTAX | NaNtoZero( ARRAY array, ARRAY type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Change NaN value to Zero in the specified array. Set zero to the parameter 'type' to update only the firsts NaN, Set one to update all NaN values
ADDITIONAL INFO |
EXAMPLE | NaNtoZero(rsi(14), 0)


Function - PEAK

PEAK
 Peak

Technical

SYNTAX | Peak( ARRAY array, ARRAY change)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array in the last peak
ADDITIONAL INFO |
EXAMPLE | Peak(close, 10)


Function - PEAK

PEAK
 Peak

Technical

SYNTAX | Peak( ARRAY array, ARRAY change, ARRAY n)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array N peak(s) ago
ADDITIONAL INFO |
EXAMPLE | Peak(close, 10, 1)


Function - PEAKBARS

PEAKBARS
 Peak Bars

Technical

SYNTAX | PeakBars( ARRAY array, ARRAY change)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the last peak
ADDITIONAL INFO |
EXAMPLE | PeakBars(close, 10)


Function - PEAKBARS

PEAKBARS
 Peak Bars

Technical

SYNTAX | PeakBars( ARRAY array, ARRAY change, ARRAY n)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since N peak(s) ago
ADDITIONAL INFO |
EXAMPLE | PeakBars(close, 10, 1)


Function - PERF

PERF
 Performance over a specified period

Technical

SYNTAX | Perf( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the performance of the array for the specified period (k-step Return)
ADDITIONAL INFO |
EXAMPLE | Perf(close, 20)


Function - PERFD

PERFD
 Average Daily Performance

Technical

SYNTAX | PerfD( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the average daily performance of the array for the specified period (k-step Trend)
ADDITIONAL INFO |
EXAMPLE | PerfD(close, 20)


Function - RANK

RANK
 Rank

Technical

SYNTAX | Rank( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the rank of the stock for this array, rank ranges are from 0 to 100 (To use in simulation)
ADDITIONAL INFO |
EXAMPLE | Rank(close)


Function - REF

REF
 Lag

Technical

SYNTAX | Ref( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | References a previous or subsequent element in a ARRAY. A negative period references X periods in the future; a positive period references X periods ago (Replace empty values in the ARRAY with NA)
ADDITIONAL INFO |
EXAMPLE | Ref(close, 1)


Function - REFZERO

REFZERO
 Lag modified

Technical

SYNTAX | RefZero( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | References a previous or subsequent element in a ARRAY. A negative period references X periods in the future; a positive period references X periods ago (Replace empty values in the ARRAY with 0)
ADDITIONAL INFO |
EXAMPLE | RefZero(close, 1)


Function - REMOVESAMESIGNALS

REMOVESAMESIGNALS
 Remove Excessive Signals

Technical

SYNTAX | RemoveSameSignals( ARRAY array, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Removes excessive signals. Returns 1 on the first occurence of 'true' signal in the first array. then Returns 0 until the second array is 'true' even if there are 'true' signals in the first array.
ADDITIONAL INFO |
EXAMPLE | RemoveSameSignals(rsi(14) > 50, rsi(14) < 50)


Function - REMOVESAMESIGNALS

REMOVESAMESIGNALS
 Remove Excessive Signals

Technical

SYNTAX | RemoveSameSignals( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Removes excessive signals. Returns 1 on the first occurence of 'true' signal in the first array. then Returns 0 until the array become 'false' then 'true'.
ADDITIONAL INFO |
EXAMPLE | RemoveSameSignals(rsi(14) > 50)


Function - RFUN

RFUN
 Relative Volatility

Technical

SYNTAX | RFun( ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the relative volatility of the specified array
ADDITIONAL INFO |
EXAMPLE | RFun(close, 30)


Function - SUMIF

SUMIF
 Summation If

Technical

SYNTAX | SumIf( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates, when condition is TRUE, a cumulative sum of the ARRAY for all the lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | SumIf(rsi(14) > 50, 1)


Function - SUMIF

SUMIF
 Summation If

Technical

SYNTAX | SumIf( ARRAY condition, ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates, when condition is TRUE, a cumulative sum of the ARRAY for the specified number of lookback periods (current bar is included)
ADDITIONAL INFO |
EXAMPLE | SumIf(rsi(14) > 50, 1, 20)


Function - TOTALBARS

TOTALBARS
 Total Bars

Technical

SYNTAX | TotalBars()
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the total number of bars
ADDITIONAL INFO |
EXAMPLE | TotalBars()


Function - TROUGH

TROUGH
 Trough

Technical

SYNTAX | Trough( ARRAY array, ARRAY change)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array in the last trough
ADDITIONAL INFO |
EXAMPLE | Trough(close, 10)


Function - TROUGH

TROUGH
 Trough

Technical

SYNTAX | Trough( ARRAY array, ARRAY change, ARRAY n)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array N trough(s) ago
ADDITIONAL INFO |
EXAMPLE | Trough(close, 10, 1)


Function - TROUGHBARS

TROUGHBARS
 Trough Bars

Technical

SYNTAX | TroughBars( ARRAY array, ARRAY change)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since the last trough
ADDITIONAL INFO |
EXAMPLE | TroughBars(close, 10)


Function - TROUGHBARS

TROUGHBARS
 Trough Bars

Technical

SYNTAX | TroughBars( ARRAY array, ARRAY change, ARRAY n)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the number of bars since N trough(s) ago
ADDITIONAL INFO |
EXAMPLE | TroughBars(close, 10, 1)


Function - VALUE

VALUE
 Value

Technical

SYNTAX | Value( ARRAY array, ARRAY bar number)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the specified ARRAY for the bar number X
ADDITIONAL INFO |
EXAMPLE | Value(close, 5)


Function - VALUEWHEN

VALUEWHEN
 Value When

Technical

SYNTAX | ValueWhen( ARRAY expression, ARRAY array, ARRAY period)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array, when the expression is TRUE, of the n -th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | ValueWhen(cross( close, sma(close, 20)), rsi(14), 10)


Function - VALUEWHEN

VALUEWHEN
 Value When

Technical

SYNTAX | ValueWhen( ARRAY expression, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array, when the expression is TRUE, of the last occurrence
ADDITIONAL INFO |
EXAMPLE | ValueWhen(cross(close, sma(close, 20)), rsi(14))


Function - VALUEWHEN

VALUEWHEN
 Value When

Technical

SYNTAX | ValueWhen( ARRAY condition, ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array, when the condition was TRUE, on the most recent occurrence
ADDITIONAL INFO |
EXAMPLE | ValueWhen(cross(close, sma(close, 20)), rsi(14))


Function - VALUEWHEN

VALUEWHEN
 Value When

Technical

SYNTAX | ValueWhen( ARRAY condition, ARRAY array, ARRAY n-th)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns the value of the array, when the condition was TRUE, on the n-th most recent occurrence
ADDITIONAL INFO |
EXAMPLE | ValueWhen(cross( close, sma(close, 20)), rsi(14), 1)


Function - ZIGZAG

ZIGZAG
 Zig Zag

Technical

SYNTAX | ZigZag( ARRAY array, ARRAY change)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculates the Zig Zag indicator given the percent change
ADDITIONAL INFO |
EXAMPLE | ZigZag(close, 10)


Function - TIMEFRAMEAPPLY

TIMEFRAMEAPPLY
 Change the timeframe of a time-series

Time-frame

SYNTAX | TimeframeApply( ARRAY timeframe, ARRAY time-series)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Changes the timeframe of a time-series and returns this new compressed time-series
ADDITIONAL INFO |
EXAMPLE | TimeframeApply(7, rsi(14) > 50)


Function - TIMEFRAMECOMPRESS

TIMEFRAMECOMPRESS
 Compress a time-series

Time-frame

SYNTAX | TimeframeCompress( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Compress a time-series retrieved with the 'TFGetSeries' or 'TFGetSeries1' functions
ADDITIONAL INFO |
EXAMPLE | TimeframeCompress(close)


Function - TIMEFRAMEDECOMPRESS

TIMEFRAMEDECOMPRESS
 Decompress a time-series

Time-frame

SYNTAX | TimeframeDecompress( ARRAY array)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Decompress a time-series that was previously compressed using the TFCompress function
ADDITIONAL INFO |
EXAMPLE | TimeframeDecompress(close)


Function - TIMEFRAMEGETSERIES1

TIMEFRAMEGETSERIES1
 Get a time-series for a different time-frame

Time-frame

SYNTAX | TimeframeGetSeries1( ARRAY symbol, ARRAY timeframe, ENUM arrayname, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol and for the specified time-frame
ADDITIONAL INFO |
EXAMPLE | TimeframeGetSeries1("A", 1, close, LastData)


Function - TIMEFRAMEGETSERIES1

TIMEFRAMEGETSERIES1
 Get a time-series for a different time-frame

Time-frame

SYNTAX | TimeframeGetSeries1( ARRAY symbol, ARRAY timeframe, ENUM arrayname, ENUM type, ARRAY set 1 for historical)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified symbol, the specified time-frame and the specified historical or intraday data
ADDITIONAL INFO |
EXAMPLE | TimeframeGetSeries1("A", 1, close, LastData, 1)


Function - TIMEFRAMEGETSERIES

TIMEFRAMEGETSERIES
 Get a time-series for a different time-frame

Time-frame

SYNTAX | TimeframeGetSeries( ARRAY timeframe, ENUM arrayname, ENUM type)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns an array (close, open, high, low, volume, open-interest) for the specified time-frame
ADDITIONAL INFO |
EXAMPLE | TimeframeGetSeries(1, close, LastData)


Function - TIMEFRAMERESTORE

TIMEFRAMERESTORE
 Restore time-frame

Time-frame

SYNTAX | TimeframeRestore()
RETURNS |
DESCRIPTION | Restore the original time-frame
ADDITIONAL INFO |
EXAMPLE | TimeframeRestore()


Function - TIMEFRAMESET

TIMEFRAMESET
 Set time-frame

Time-frame

SYNTAX | TimeframeSet( ARRAY time-frame)
RETURNS |
DESCRIPTION | Change the current time-frame
ADDITIONAL INFO |
EXAMPLE | TimeframeSet(7)


OnEndPeriod

QuantShare API Documentation

OnEndPeriod Members

Manage your trading system using the advanced money management script.

Fields

TradingSystemSettings (of type MMTradingSystemSettings) | Trading system settings
Variables (of type MMVariables) | A class that is used to manipulate variables
Portfolio (of type MMPortfolio) | Porftolio Metrics
Divers (of type MMDivers) | Divers functions
Orders (of type MMOrders) | A class that is used to generate orders
Data (of type MMData) | A class that is used to get signals data, parse formulas...
Functions (of type MMOnEndPeriod) | Functions related to the OnEndPeriod event


OnEndSimulation

QuantShare API Documentation

OnEndSimulation Members

Manage your trading system using the advanced money management script.

Fields

TradingSystemSettings (of type MMTradingSystemSettings) | Trading system settings
Variables (of type MMVariables) | A class that is used to manipulate variables
Portfolio (of type MMPortfolio) | Porftolio Metrics
Divers (of type MMDivers) | Divers functions
Functions (of type MMOnEndSimulation) | Functions related to the OnEndSimulation event


OnStartSimulation

QuantShare API Documentation

OnStartSimulation Members

Manage your trading system using the advanced money management script.

Fields

TradingSystemSettings (of type MMTradingSystemSettings) | Trading system settings
Variables (of type MMVariables) | A class that is used to manipulate variables
Portfolio (of type MMPortfolio) | Porftolio Metrics
Divers (of type MMDivers) | Divers functions
Functions (of type MMOnStartSimulation) | Functions related to the OnStartSimulation event
Optimize (of type MMOptimize) | A class that can be used to define variables that will be used in the optimization


OnClosePosition

QuantShare API Documentation

OnClosePosition Members

Manage your trading system using the advanced money management script.

Fields

TradingSystemSettings (of type MMTradingSystemSettings) | Trading system settings
Variables (of type MMVariables) | A class that is used to manipulate variables
Portfolio (of type MMPortfolio) | Porftolio Metrics
Divers (of type MMDivers) | Divers functions
Orders (of type MMOrders) | A class that is used to generate orders
Data (of type MMData) | A class that is used to get signals data, parse formulas...
Functions (of type MMOnClosePosition) | Functions related to the OnClosePosition event


OnNewPosition

QuantShare API Documentation

OnNewPosition Members

Manage your trading system using the advanced money management script.

Fields

TradingSystemSettings (of type MMTradingSystemSettings) | Trading system settings
Variables (of type MMVariables) | A class that is used to manipulate variables
Portfolio (of type MMPortfolio) | Porftolio Metrics
Divers (of type MMDivers) | Divers functions
Orders (of type MMOrders) | A class that is used to generate orders
Data (of type MMData) | A class that is used to get signals data, parse formulas...
NewPosition (of type MMNewPosition) | Class containing information about the position the simulator is about to buy/short
Functions (of type MMOnNewPosition) | Functions related to the OnNewPosition event


_TradingOrder

QuantShare API Documentation

_TradingOrder Members

Parent

Properties

OrderLag (of type Int32) | Execute order at tomorrow plus the number of bars specified in the OrderLag variable (-1 to execute at the current bar)
Symbol (of type String) | Security symbol
Var1 (of type Object) | Custom variable
NbShares (of type Double) | Number of shares
PositionValidFor (of type Int32) | For entry orders: The number of periods to keep the order alive (in case the order isn't filled) For exit orders: The number of periods to keep the order alive before transforming it to an open market order

Methods

CancelOrder (returns Void) | (optional reason String) Cancel the order
SetCommissions (returns Void) | (commissions Double) Update commissions value


CustomDatabaseValues

QuantShare API Documentation

CustomDatabaseValues Members

Parent

Properties

[Int32] (of type Object) | Gets the element at the specified index
Length (of type Int32) | Gets the number of elements for the current bar period

Methods

GetValue (returns Object) (index Int32)

Gets the element at the specified index


MMData

QuantShare API Documentation

MMData Members

A class that is used to get signals data, parse formulas...

Parent

Methods

GetCustomDatabaseData (returns VectorCustom) | (database String, field String, symbol name String) Gets the specified database field data
ParseFormula (returns MMParser) | (formula. Ex: a = rsi(14); String) Parse a vector-based formula
IsMarketData (returns Boolean) | (Symbol name String) Returns whether there is market data or not on the current date
GetPriceSeries (returns TimeSeries) | (parameterless) Returns a price series
IsSymbolExists (returns Boolean) | (symbol name String) Returns TRUE if the specified symbol exists in this trading system
IsSymbolExistsInDatabase (returns Boolean) | (symbol name String) Returns TRUE if the specified symbol exists in your database
GetSymbols (returns String[]) | (parameterless) Gets the strategy's symbols
GetAllSymbols (returns String[]) | (parameterless) Gets all symbols in your database
GetSymbolInfo (returns Symbol) | (symbol name String) Gets symbol's informatiion
GetBuySignals (returns MMEntrySignals) | (parameterless) Gets buy signals generated at the end of this period
GetShortSignals (returns MMEntrySignals) | (parameterless) Gets short signals generated at the end of this period
GetSellSignals (returns MMExitSignals) | (parameterless) Gets sell signals generated at the end of this period
GetCoverSignals (returns MMExitSignals) | (parameterless) Gets cover signals generated at the end of this period


MMDivers

QuantShare API Documentation

MMDivers Members

Divers functions

Parent

Properties

IsFirstBar (of type Boolean) | Specify whether the current bar is the first one or not
CurrentDate (of type DateTime) | Current Date

Methods

Output (returns Void) (parameterless)

Set Output. Output can be found in Trading System Report, under the Details tab (Log Panel).


MMEntrySignals

QuantShare API Documentation

MMEntrySignals Members

Parent

Properties

Count (of type Int32) Gets the number of signals

Methods

GetSymbol (returns String) | (Signal index Int32) Gets the symbol name
GetDetail (returns Double) | (Signal index Int32, Tags: limitprice, rank, stoploss, stoptrailing, stopprofit, stopbars String) Gets a symbol detail


MMExitPosition

QuantShare API Documentation

MMExitPosition Members

Parent

Properties

EntryDate (of type DateTime) | Current position entry date
SignalEntryDate (of type DateTime) | Current position signal date. Signal date is the date where the symbol buy/short value became TRUE. Entry date is the date where the symbol was bought or shorted. The Signal date could be different than the Entry date when the buy/short entry price could not be met on the signal date.
Symbol (of type String) | Current position symbol
PositionEquity (of type Double) | Current position size
Performance (of type Double) | Current position performance (in percentage)
Profit (of type Double) | Current position profit or loss
EntryPrice (of type Double) | Current position entry price
BarsSinceEntry (of type Int32) | Current position number of bars held
MAE (of type Double) | Current position maximum adverse excursion
MFE (of type Double) | Current position maximum favorable excursion
NbShares (of type Int32) | Current position number of shares
MaximumDrawdown (of type Double) | Current position maximum drawdown
NumberOfScaleIn (of type Int32) | Current position number of scale-in trades
NumberOfScaleOut (of type Int32) | Current position number of scale-out trades
LastPrice (of type Double) | Current position last price
Var1 (of type Object) | Custom variable
Var2 (of type Double) | Custom variable
Var3 (of type Double) | Custom variable
Var4 (of type Double) | Custom variable
StopSettings (of type MMStopSettings) | Stop Settings

Methods

GetValueFromFormula (returns Double) (parameterless)

Parse a vector-based formula and returns the vector value for the current date. Example: GetValueFromFormula('a = rsi(14);', 'a'); -> to get the RSI value of the current symbol for the current date.


MMExitSignals

QuantShare API Documentation

MMExitSignals Members

Parent

Properties

Count (of type Int32) Gets the number of signals

Methods

GetSymbol (returns String) | (Signal index Int32) Gets the symbol name
GetPrice (returns Double) | (Signal index Int32) Gets the symbol sell/cover limit price


MMNewPosition

QuantShare API Documentation

MMNewPosition Members

Class containing information about the position the simulator is about to buy/short

Parent

Properties

IsLong (of type Boolean) | Specify whether the new position is Long or Short
Price (of type Double) | The new position price
NbShares (of type Int32) | The number of shares for the current position
Rank (of type Double) | The Rank of this symbol in the specified long or short ranking system
Symbol (of type String) | The symbol name
RemainingCash (of type Double) | Portfolio cash at the end of the previous period
NbPositions (of type Int32) | The current number of positions in the portfolio
NbLongPositions (of type Int32) | The current number of long positions in the portfolio
NbShortPositions (of type Int32) | The current number of short positions in the portfolio


MMOnClosePosition

QuantShare API Documentation

MMOnClosePosition Members

Functions related to the OnClosePosition event

Parent

Methods

AddTradeMetric (returns Void) | (Metric name String, Metric value Double) Adds a metric for this position
GetPositionDetails (returns MMExitPosition) | (parameterless) Gets details about the current position
DontCloseTheCurrentPosition (returns Void) | (parameterless) Restricts the simulator from exiting the current position
DontClosePositionsForThisPeriod (returns Void) | (parameterless) Restricts the simulator from exiting all the positions within this period (date)
UpdateNumberOfShares (returns Boolean) | (Number of shares Int32) Updates the number of shares to sell/cover
UpdateOrder (returns Boolean) | (Order - Example: To create a limit order -> Orders.LimitOrder(price) _TradingOrder) Updates the order used to exit this position


MMOnEndPeriod

QuantShare API Documentation

MMOnEndPeriod Members

Functions related to the OnEndPeriod event

Parent

Methods

AddMetric (returns Void) | (Metric name String, Metric value for the current period (date) Double) Adds a time-series metric to the simulation
SkipPeriods (returns Void) | (Number of periods Double) Skips money monagement execution for the specified number of periods (for all symbols)
RejectNewPositionsDuringTheNextPeriods (returns Void) | (Number of periods Double) Instructs the simulator to not open new positions during the specified number of periods
CreatePositionSettings (returns MMPositionSettings) | (Specify the category of the position. Long, Short or any custom value String) A position settings can be used to add additional information to a submitted order
CloseAllPositions (returns Void) | (Number of periods to skip executing OnEndPeriod script Double) Closes all portfolio's positions using market-at-open orders
CloseAllPositions (returns Void) | (Number of periods to skip executing OnEndPeriod script Double, Long for long orders - Short for short orders String) Closes portfolio's positions for the specified category using market-at-open orders
CloseAllPositions (returns Void) | (Number of periods to skip executing OnEndPeriod script Double, Trading order _TradingOrder) Closes all portfolio's positions
CloseAllPositions (returns Void) | (Number of periods to skip executing OnEndPeriod script Double, Trading order _TradingOrder, Long for long orders - Short for short orders String) Closes portfolio's positions for the specified category
GetNumberShares (returns Double) | (Symbol name String, Long or Short Boolean, Trading order _TradingOrder) Gets the approximative number of shares to be bought or shorted
GetNumberShares (returns Double) | (Symbol name String, Long or Short Boolean, Trading order _TradingOrder, Long for long orders - Short for short orders String) Gets the approximative number of shares to be bought or shorted
AddLongPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder) Adds a new long position
AddLongPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder) Adds a new long position - Let the simulator automatically choose the number of shares to buy
AddLongPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder, Create a position settings using the function: CreatePositionSettings MMPositionSettings) Adds a new long position
AddLongPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder, Create a position settings using the function: CreatePositionSettings MMPositionSettings) Adds a new long position - Let the simulator automatically choose the number of shares to buy
AddShortPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder) Adds a new short position
AddShortPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder) Adds a new short position - Let the simulator automatically choose the number of shares to short
AddShortPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder, Create a position settings using the function: CreatePositionSettings MMPositionSettings) Adds a new short position
AddShortPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder, Create a position settings using the function: CreatePositionSettings MMPositionSettings) Adds a new short position - Let the simulator automatically choose the number of shares to short
SellPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder) Sell a long position
SellPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder) Sell a long position - Sell all shares
SellPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder, Long, Short or any custom category String) Sell a long position
SellPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder, Long, Short or any custom category String) Sell a long position - Sell all shares
CoverPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder) Cover a short position
CoverPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder) Cover a short position - Cover all shares
CoverPosition (returns Boolean) | (Symbol name String, Number of shares Double, Trading order _TradingOrder, Long, Short or any custom category String) Cover a short position
CoverPosition (returns Boolean) | (Symbol name String, Trading order _TradingOrder, Long, Short or any custom category String) Cover a short position - Cover all shares


MMOnEndSimulation

QuantShare API Documentation

MMOnEndSimulation Members

Functions related to the OnEndSimulation event

Parent

Methods

AddMetric (returns Void) (Metric name String, Metric value Double)

Adds a metric to the simulator


MMOnNewPosition

QuantShare API Documentation

MMOnNewPosition Members

Functions related to the OnNewPosition event

Parent

Properties

StopSettings (of type MMStopSettings) Stop Settings

Methods

RejectPosition (returns Void) | (parameterless) Reject the current position
RejectAllPositionsForThisPeriod (returns Void) | (parameterless) Reject all positions for the current period
UpdateNumberOfShares (returns Boolean) | (Number of shares Int32) Update the number of shares to buy/short
UpdateOrder (returns Boolean) | (Order - Example: To create a limit order -> Orders.LimitOrder(price) _TradingOrder) Update the order used to enter this position


MMOnStartSimulation

QuantShare API Documentation

MMOnStartSimulation Members

Functions related to the OnStartSimulation event

Parent

Methods

SetTextInput (returns Void) | (Variable name String, Default Value String, Description String) Gets a text value for the Money Management Input Form, use the Variable Class to get the value
SetTextInput (returns Void) | (Variable name String, Default Value String, Description String, Set the possible values String[]) Gets a text value for the Money Management Input Form, use the Variable Class to get the value
SetNumericInput (returns Void) | (Variable name String, Default Value Double, Description String) Gets a numeric value for the Money Management Input Form, use the Variable Class to get the value
AddReportMetric (returns Void) | (parameterless) Adds a variable to the simulator report grid - Variables can be updated later using 'Variables.SetVariable'


MMOptimize

QuantShare API Documentation

MMOptimize Members

A class that can be used to define variables that will be used in the optimization

Parent

Methods

OptimizeText (returns Void) | (variable name String, values String[]) Creates an optimizable variable, use the Variable Class to get the value
OptimizeDouble (returns Void) | (variable name String, start value Double, end value Double, step value Double) Creates an optimizable variable, use the Variable Class to get the value


MMOrders

QuantShare API Documentation

MMOrders Members

A class that is used to generate orders

Parent

Methods

OpenMarketOrder (returns _TradingOrder) | (parameterless) Creates an market order that is executed at the open
OpenMarketOrder (returns _TradingOrder) | (Execute order at the next bar plus the number of specified bars (-1 to execute at the current bar) Int32, Keep the order active for the specified number of bars Int32) Creates an market order that is executed at the open
CloseMarketOrder (returns _TradingOrder) | (parameterless) Creates an market order that is executed at the close
CloseMarketOrder (returns _TradingOrder) | (Execute order at the next bar plus the number of specified bars (-1 to execute at the current bar) Int32, Keep the order active for the specified number of bars Int32) Creates an market order that is executed at the close
LimitOrder (returns _TradingOrder) | (limit price Double) Creates an market order that is executed at the specified price
LimitOrder (returns _TradingOrder) | (limit price Double, Execute order at the next bar plus the number of specified bars (-1 to execute at the current bar) Int32, Keep the order active for the specified number of bars Int32) Creates an market order that is executed at the specified price
GetPendingBuyOrders (returns _TradingOrder[]) | (parameterless) Gets the list of all BUY pending orders
GetPendingSellOrders (returns _TradingOrder[]) | (parameterless) Gets the list of all SELL pending orders
GetPendingShortOrders (returns _TradingOrder[]) | (parameterless) Gets the list of all SHORT pending orders
GetPendingCoverOrders (returns _TradingOrder[]) | (parameterless) Gets the list of all COVER pending orders


MMParser

QuantShare API Documentation

MMParser Members

Parent

Properties

IsErrors (of type Boolean) Returns whether an error occurred while parsing the formula

Methods

GetErrors (returns String) | (parameterless) Gets the last execution errors
GetTimeSeries (returns TimeSeries) | (symbol name String, variable within the formula String) Retrieves a Time-Series.


MMPortfolio

QuantShare API Documentation

MMPortfolio Members

Porftolio Metrics

Parent

Properties

Equity (of type Double) | Current portfolio equity
Drawdown (of type Double) | Current portfolio drawdown
Return (of type Double) | Current portfolio return in percentage
PercentageInvested (of type Double) | Current portfolio percentage of invested money
NbPositions (of type Int32) | The current number of positions in the portfolio
NbLongPositions (of type Int32) | The current number of long positions in the portfolio
NbShortPositions (of type Int32) | The current number of short positions in the portfolio

Methods

IsInPortfolio (returns Boolean) | (symbol name String, Long or Short position Boolean) Returns whether a security symbol is in the portfolio
GetReturn (returns Double) | (Number of days/minutes Int32) Portfolio return over the specified number of days(Historical)/minutes(Intraday)
GetReturn (returns Double) | (Number of days/minutes Int32, Long, Short or any custom category String) Category return over the specified number of days(Historical)/minutes(Intraday)
IsInPortfolio (returns Boolean) | (symbol name String, Long or Short position Boolean, Long, Short or any custom category String) Returns TRUE if a security is in the portfolio
IsInPendingOrders (returns Boolean) | (symbol name String, Specify the order type: Buy, Sell, Short or Cover String) Returns whether a security symbol is in the pending orders list
IsInPendingOrders (returns Boolean) | (symbol name String, Specify the order type: Buy, Sell, Short or Cover String, Long, Short or any custom category String) Returns whether a security symbol is in the pending orders list
GetPosition (returns MMPosition) | (symbol name String) Gets a position from the portfolio
GetPosition (returns MMPosition) | (symbol name String, Long, Short or any custom category String) Gets a position from the portfolio
GetAllPositions (returns MMPosition[]) | (parameterless) Gets all positions generated by the simulator - open and closed positions
GetLastClosedPositions (returns MMPosition[]) | (parameterless) Gets all previously closed positions
GetClosedPositions (returns MMPosition[]) | (DateTime DateTime) Gets all positions that were closed in or after the specified date
GetOpenPositions (returns MMPosition[]) | (parameterless) Gets the current portfolio positions
GetCategorySettings (returns Double) | (Long, Short or a custom category String, Returns PercentToInvest when true otherwise it returns the number of positions Boolean) Gets the percent of equity to invest and the maximum number of positions of a category
UpdateCategorySettings (returns Void) | (Long, Short or a custom category String, Percent of equity to invest - Example: 50 to assign 50% of the equity to the current category Double, Number of positions Int32, Order type to scale-in or scale-out positions. Set null to ignore scaling. Scaling is automatically ignored if the number of positions is changed. _TradingOrder) Updates the percent of equity to invest and the number of positions to allow for a category
GetAvailableCash (returns Double) | (Long for long category - Short for short category String) Gets the cash available for the specified category
GetAvailableNumberOfPositions (returns Double) | (Long for long orders - Short for short orders String) Gets the number of positions available for the specified category (Maximum positions - open positions - entry orders + exit orders)
GetNumberOfPositions (returns Double) | (Long for long category - Short for short category String) Gets the number of open positions for the specified category
GetAllowedNumberOfPositions (returns Double) | (Long for long category - Short for short category String) Gets the number of allowed positions for the specified category
GetTotalEquity (returns Double) | (Long for long category - Short for short category String) Gets the positions value plus cash available for the specified category
GetPositionsSize (returns Double) | (Long for long category - Short for short category String) Gets the positions value for the specified category
UpdateMarginFactor (returns Int32) | (margin factor Double) Updates the margin factor
UpdateMarginFactor (returns Int32) | (margin factor (higher or equal to 1) Double, order type used to scale-in or scale-out positions _TradingOrder) Updates the margin factor and scale-in or scale-out existing positions to meet the new requirements
UpdatePercentInvested (returns Int32) | (percent invested (between 0 and 100) Double) Updates the percentage invested value
UpdatePercentInvested (returns Int32) | (percent invested (between 0 and 100) Double, order type used to scale-in or scale-out positions _TradingOrder) Updates the percentage invested value and scale-in or scale-out existing positions to meet the new requirements


MMPosition

QuantShare API Documentation

MMPosition Members

Parent

Properties

EntryDate (of type DateTime) | Current position entry date
SignalEntryDate (of type DateTime) | Current position signal date. Signal date is the date where the symbol buy/short value became TRUE. Entry date is the date where the symbol was bought or shorted. The Signal date could be different than the Entry date when the buy/short entry price could not be met on the signal date.
Symbol (of type String) | Current position symbol
Category (of type String) | Gets position category
PositionEquity (of type Double) | Current position size
Performance (of type Double) | Current position performance (in percentage)
Profit (of type Double) | Current position profit or loss
CloseReason (of type String) | Returns the close reason
EntryPrice (of type Double) | Current position entry price
BarsSinceEntry (of type Int32) | Current position number of bars held
MAE (of type Double) | Current position maximum adverse excursion
MFE (of type Double) | Current position maximum favorable excursion
NbShares (of type Int32) | Current position number of shares
MaximumDrawdown (of type Double) | Current position maximum drawdown
NumberOfScaleIn (of type Int32) | Current position number of scale-in trades
NumberOfScaleOut (of type Int32) | Current position number of scale-out trades
LastPrice (of type Double) | Current position last price
IsLong (of type Boolean) | Specifies whether this is a long or short position
Rank (of type Double) | The rank of this symbol in the specified long or short ranking system
Var1 (of type Object) | Custom variable
Var2 (of type Double) | Custom variable
Var3 (of type Double) | Custom variable
Var4 (of type Double) | Custom variable
StopSettings (of type MMStopSettings) | Stop Settings

Methods

ScaleIn (returns Void) | (Number of shares Int32) Scale-in position
ScaleIn (returns Void) | (Number of shares Int32, Trading order _TradingOrder) Scale-in position
ScaleOut (returns Void) | (Number of shares Int32) Scale-out position
ScaleOut (returns Void) | (Number of shares Int32, Trading order _TradingOrder) Scale-out position
ClosePosition (returns Void) | (parameterless) Closes the current position
ClosePosition (returns Boolean) | (Order - Example: To create a limit order -> Orders.LimitOrder(price) _TradingOrder) Closes the current position
GetValueFromFormula (returns Double) | (parameterless) Parses a vector-based formula and returns the vector value for the current date. Example: GetValueFromFormula('a = rsi(14);', 'a'); -> to get the RSI value of the current symbol for the current date.
AddTradeMetric (returns Void) | (Metric name String, Metric value Double) Adds a metric for this position


MMPositionSettings

QuantShare API Documentation

MMPositionSettings Members

Parent

Methods

AddTrailingStop (returns Void) | (Example: 10 (% or Points depending on the trading system settings) Double) Adds a trailing stop
AddStopLoss (returns Void) | (Example: 10 (% or Points depending on the trading system settings) Double) Adds a stop loss
AddNBarsStop (returns Void) | (Example: 10 (% or Points depending on the trading system settings) Double) Adds an Nbars stop
AddProfitStop (returns Void) | (Example: 10 (% or Points depending on the trading system settings) Double) Adds a profit stop


MMStopSettings

QuantShare API Documentation

MMStopSettings Members

Parent

Properties

StopLossEnabled (of type Boolean) | [Deprecated]
TrailingStopEnabled (of type Boolean) | [Deprecated]
ProfitStopEnabled (of type Boolean) | [Deprecated]
NBarsStopEnabled (of type Boolean) | [Deprecated]
StopLossOption (of type Double) | Stop Loss Option (0=Disable, 1=Percent, 2=Point) - This is a global setting for all trades
TrailingStopOption (of type Double) | Stop Loss Option (0=Disable, 1=Percent, 2=Point) - This is a global setting for all trades
ProfitStopOption (of type Double) | Stop Loss Option (0=Disable, 1=Percent, 2=Point) - This is a global setting for all trades
NBarsStopOption (of type Double) | Stop Loss Option (0=Disable, 1=Percent, 2=Point) - This is a global setting for all trades
StopLoss (of type Double) | Stop Loss - Set (double.NaN) to disable
TrailingStop (of type Double) | Trailing Stop - Set (double.NaN) to disable
ProfitStop (of type Double) | Profit Stop - Set (double.NaN) to disable
NBarsStop (of type Double) | N-Bars Stop - Set (double.NaN) to disable


MMTradingSystemSettings

QuantShare API Documentation

MMTradingSystemSettings Members

Trading system settings

Parent

Properties

InitialEquity (of type Double) | Portfolio initial equity
StartDate (of type DateTime) | Simulation start date
EndDate (of type DateTime) | Simulation end date
NbPositions (of type Int32) | Portfolio maximum number of positions
PercentToInvest (of type Double) | Portfolio percent of capital to invest
Formula (of type String) | Trading system's formula
IsLong (of type Boolean) | Returns true if the trading system supports long positions
IsShort (of type Boolean) | Returns true if the trading system supports short positions
Symbols (of type String[]) | Trading system's symbols
MaxWeight (of type Double) | Maximum Position Weight - Example: 2 - New Positions can have a maximum size of two times the average expected position size Set 0 to disable this setting.
MinWeight (of type Double) | Minimum Position Weight - Example: 0.4 - New Positions can have a minimum size of 40% the average expected position size Set 0 to disable this setting.
IsAutoAdjustCashNewPositions (of type Boolean) | Specify whether to adjust the amount of cash available for new positions after a position is entered or at the end of a period. By default, the amount of cash is updated after each position.


MMVariables

QuantShare API Documentation

MMVariables Members

A class that is used to manipulate variables

Parent

Properties

[String] (of type Object) Gets a variable value

Methods

SetVariable (returns Void) | (Variable Name String, Value Object) Assigns a value to a variable
GetVariable (returns Object) | (Variable Name String) Gets a variable value
RemoveVariable (returns Boolean) | (Variable Name String) Removes a variable
GetVariables (returns String[]) | (parameterless) Gets a list of all the declared variables
IsVariableExists (returns Boolean) | (Variable Name String) Returns true if the variable exist, otherwise returns false


Symbol

QuantShare API Documentation

Symbol Members

Parent

Properties

Name (of type String) | Security name
Name1 (of type String) | Security name1
Name2 (of type String) | Security name2
Name3 (of type String) | Security name3
FullName (of type String) | Security full name
Group (of type String) | Security group
Market (of type String) | Security market
Industry (of type String) | Security industry
Sector (of type String) | Security sector
Description (of type String) | Security description
Country (of type String) | Security country
Address (of type String) | Company address
Website (of type String) | Company website
IsActive (of type Boolean) | Specify whether the current security is active or not
IsTradable (of type Boolean) | Specify whether the current security is tradable or not
Currency (of type String) | Security currency
TickSize (of type Double) | Security Tick Size
RoundLotSize (of type Double) | Security Round Lot Size
PointValue (of type Double) | Security Point Value
MarginDeposit (of type Double) | Security Margin Deposit
Multiplier (of type Int32) | Security Multiplier
Strike (of type Double) | Security strike price
ExpirationDate (of type String) | Security expiration date

Methods

GetIndexesFromList (returns String[]) | (parameterless) Get a list of all the indexes where the current security belongs to
AddIndex (returns Void) | (Index String) Add the current symbol to an index
RemoveIndex (returns Void) | (Index String) Remove the current symbol from an index


TimeSeries

QuantShare API Documentation

TimeSeries Members

Parent

Properties

Count (of type Int32) | Gets the time-series number of elements
[Int32] (of type Double) | Gets a time-series value

Methods

GetValue (returns Double) (lag Int32)

Gets a time-series value


VectorCustom

QuantShare API Documentation

VectorCustom Members

Parent

Properties

Count (of type Int32) | Gets the number of elements
[Int32] (of type CustomDatabaseValues) | Gets the elements at the specified bar index

Methods

GetValue (returns CustomDatabaseValues) (lag Int32)

Gets the elements at the specified bar index


Analyze Ranking System Metrics

QuantShare API Documentation

Analyze Ranking System Metrics Members

Fields

Buckets (of type RankingSystemPerformanceDetails) | Class containing information about the ranking system buckets
Fitness (of type Double) | Fitness value


BucketDetails

QuantShare API Documentation

BucketDetails Members

Parent

Properties

AnnualReturn (of type Double) | Annual return
NbPositions (of type Int32) | Number of positions taken within this bucket
Label (of type String) | Bucket label
Score (of type Double) | Bucket score
DetailsDate (of type BucketDetailsDate[]) | Bucket's positions details for rebalance dates. Each array element corresponds to a rebalance date.
RebalancePeriod (of type Int32) | The ranking system rebalance period


BucketDetailsDate

QuantShare API Documentation

BucketDetailsDate Members

Parent

Properties

AvgPerf (of type Double) | Average performance
AvgBarsHeld (of type Double) | Average bars held
Equity (of type Double) | Equity value
NbPositions (of type Int32) | Number of positions
Date (of type DateTime) | Rebalance date
Score (of type Double) | Score value for the current bucket and the current rebalance date


RankingSystemPerformanceDetails

QuantShare API Documentation

RankingSystemPerformanceDetails Members

Class containing information about the ranking system buckets

Parent

Properties

Buckets (of type BucketDetails[]) | Array containing the buckets details, the first array element contains the data of the first bucket...
LastBucket (of type BucketDetails) | Last bucket details


Analyze Rules Metrics

QuantShare API Documentation

Analyze Rules Metrics Members

Fields

Output (of type Double) | Average output per position
OutputPerBar (of type Double) | Average output per position and per bar
PercentPositive (of type Double) | Percent of positive positions
BestPosition (of type Double) | Best position output
WorstPosition (of type Double) | Worst position output
AvgBarsHeld (of type Double) | Average bars held per position
NbPositions (of type Double) | Number of positions
StandardDeviation (of type Double) | Standard deviation of the position outputs
Positions (of type SymbolPositionDetails) | Details of all positions
Fitness (of type Double) | Fitness value
Functions (of type RulesFunctions) | Function class that lets you add additional metrics


PositionDetails

QuantShare API Documentation

PositionDetails Members

Parent

Properties

Output (of type Double) | The position output
NbBars (of type Int32) | The number of bars the current position was held
Date (of type DateTime) | Position entry date


SymbolPositionDetails

QuantShare API Documentation

SymbolPositionDetails Members

Details of all positions

Parent

Properties

Symbol (of type String) | Symbol name
Positions (of type PositionDetails[]) | Positions details for the current symbol


RulesFunctions

QuantShare API Documentation

RulesFunctions Members

Function class that lets you add additional metrics

Parent

Methods

AddMetric (returns Void) | (metric name String, metric value Double) Adds a new metric
GetOutputName (returns String) | (parameterless) Returns the output name
GetRuleFormula (returns String) | (parameterless) Returns the rule formula


Downloader URL-Script

QuantShare API Documentation

Downloader URL-Script Members

This script is used to generated custom URLs. These URLs will be used to download data.

Fields

Functions (of type URLScriptFunctions) Contains a list of methods


BrowserActions

QuantShare API Documentation

BrowserActions Members

Parent

Properties

Visible (of type Boolean) Select whether to display the browser or not

Methods

Sleep (returns Void) | (number of milliseconds Int32) Sleep during the specified period
Browse (returns Void) | (URL String) Browse to a specific URL
ClickLink (returns Void) | (Anchor name - Text that describes the link String) Click on a link
ClickLink1 (returns Void) | (Anchor name String) Click on a link that contains the specified anchor name
ClickButton (returns Void) | (Button name String) Click on a button
SubmitForm (returns Void) | (Form name String) Submit a form
AddContentToParser (returns Void) | (parameterless) Add current html code to parser
SetField (returns Void) | (Field name String, Field value String) Update a specific form field


HTMLElement

QuantShare API Documentation

HTMLElement Members

Parent

Properties

TagName (of type String) | Get the tag name
InnerText (of type String) | Get the inner text
InnerHTML (of type String) | Get the inner html

Methods

GetAttribute (returns String) (attribute name String)

Get an attribute value


Net

QuantShare API Documentation

Net Members

Parent

Methods

DownloadString (returns String) | (URL String) Download content from the specified URL
GetLinks (returns String[]) | (html content String) Get all links from the provided content
GetLinksByAnchor (returns String[]) | (html content String, anchor text String) Get links from the specified content that contains the provided anchor text
GetHTMLElements (returns HTMLElement[]) | (html content String) Get HTML elements by tag name
GetHTMLElementsByTag (returns HTMLElement[]) | (html content String, tag name String) Get HTML elements by tag name


URLPath

QuantShare API Documentation

URLPath Members

Parent

Methods

AddURL (returns Void) | (URL String, Message to display String) Add a URL to the current Path
AddURL (returns Void) | (URL String, Message to display String, Referrer URL String) Add a URL to the current Path
AddURL (returns Void) | (URL String, Message to display String, Referrer URL String, List of Fields String[], List of Values String[]) Add a URL to the current Path using a POST method


URLScriptFunctions

QuantShare API Documentation

URLScriptFunctions Members

Contains a list of methods

Parent

Properties

Net (of type Net) | Functions to download, parse... HTML content
Browser (of type BrowserActions) | Use a browser to connect and download data

Methods

GetDefaultURL (returns String) | (parameterless) Returns the default URL
GetStartDate (returns DateTime) | (parameterless) Get the start date
GetEndDate (returns DateTime) | (parameterless) Get the end date
CreateURLPath (returns URLPath) | (parameterless) Create a URL Path class, the downloader must load all the URLs specified in this class in order to download your content
AddURL (returns Void) | (URL String, Message to display String) Add a URL to the download list
AddURLPath (returns Void) | (URL Path URLPath) Add a URL Path, the downloader must load all the specified URLs in order to download your content
GetValues (returns String) | (Parameter name String) Get a URL parameter value. Example: The current symbol
SetValues (returns Void) | (Parameter name String, Parameter value String) Set a URL parameter value. Example: The current symbol
GetAllValues (returns String[]) | (Parameter name String) Get all the URL parameter values. Example: All the selected symbols
GetSymbolInfo (returns Symbol) | (parameterless) Get Symbol information


Indicators

QuantShare API Documentation

Indicators Members

Create an indicator using JScript.Net.

Fields

result (of type VectorD) | You have to assign values to this array
cFunctions (of type CFunctions) | Divers functions
TA (of type QSFunctions) | Trading Indicators
Chart (of type Charts) | Plot data on a chart


CFunctions

QuantShare API Documentation

CFunctions Members

Divers functions

Parent

Properties

Open (of type VectorD) | Open price vector
Close (of type VectorD) | Close price vector
SymbolInfo (of type Symbol) | Symbol information
Timeframe (of type Int32) | Current Time-frame
IsIntraday (of type Boolean) | Returns whether the formula is applied to Intraday data or not
Symbol (of type String) | Symbol name
Date (of type VectorDate) | Date vector
High (of type VectorD) | High price vector
Low (of type VectorD) | Low price vector
Volume (of type VectorD) | Volume price vector
OpenInt (of type VectorD) | Open Interest price vector

Methods

SetForwardAndBackwardBars (returns Void) | (backward bars Int32, forward bars Int32) Set the number of forward and backward bars used by this functionTheses values are used by the application to optimize the parsing process Example: sma(close, 10), uses 10 backward bars and 0 forward bars
CompileFormula (returns QSFormula) | (formula String) Compile a vector-based formula
CreateNumericVector (returns VectorD) | (parameterless) Returns an empty numeric vector
CreateTextVector (returns VectorS) | (parameterless) Returns an empty text vector
GetVectorDouble (returns VectorD) | (variable name String) Get a numeric vector from the current formula
GetVectorString (returns VectorS) | (variable name String) Get a text vector from the current formula
CreateFormula (returns QSFormula) | (formula String) Create a vector-based formula
GetTimeframeData (returns VectorCustomDouble) | (timeframe Int32, close, open, high, low, volume or openint String) For each trading bar get the quotes for the specified timeframe that occurred during this bar interval
GetTimeframeData (returns VectorCustomDouble) | (symbol String, timeframe Int32, close, open, high, low, volume or openint String) For each trading bar get the quotes of the specific symbol and for the specified timeframe that occurred during this bar interval
GetTimeframeData (returns VectorCustomDouble) | (symbol String, timeframe Int32, close, open, high, low, volume or openint String, Specify whether to get historical or intraday data Boolean) For each trading bar get the quotes of the specific symbol and for the specified timeframe that occurred during this bar interval
GetTimeframeRawData (returns VectorR) | (symbol String, timeframe Int32, close, open, high, low, volume or openint String) Get all data for the specific symbol and timeframe - not adjusted to the current symbol's data
GetTimeframeRawData (returns VectorR) | (symbol String, timeframe Int32, close, open, high, low, volume or openint String, Specify whether to get historical or intraday data Boolean) Get all data for the specific symbol and timeframe - not adjusted to the current symbol's data
GetCustomDatabaseData (returns VectorCustom) | (database String, field String) For each trading bar get the elements of the database field data that occurred during this bar interval
GetCustomDatabaseData (returns VectorCustom) | (database String, field String, symbol name String) For each trading bar get the elements of the database field data that occurred during this bar interval
GetCustomDatabaseRawData (returns VectorR) | (database String, field String, symbol name String) Get all the elements of the database field - not adjusted to the current symbol's data


Charts

QuantShare API Documentation

Charts Members

Plot data on a chart

Parent

Methods

Plot (returns Void) | (array VectorD, description VectorS) Plot a time-series
Plot (returns Void) | (array VectorD, description VectorS, color VectorColor) Plot a time-series
Plot (returns Void) | (array VectorD, description VectorS, color VectorColor, chart type ChartType, style Style) Plot a time-series
Plot1 (returns Void) | (first time-series VectorD, second time-series VectorD, description1 VectorS, description2 VectorS, Fill color VectorColor, Color1 VectorColor, Color2 VectorColor, Chart ChartType, Style Style) Plot two time-series
PlotCandleStick (returns Void) | (parameterless) Plot an OHLC Chart
PlotCandleStick1 (returns Void) | (parameterless) Plot an OHLC Chart
PlotSymbol (returns Void) | (parameterless) Plot Symbols on a Chart
PlotArrow (returns Void) | (parameterless) Plot Arrows
PrintChart (returns Void) | (parameterless) Plot Text on a Chart
Print (returns Void) | (parameterless) Print Text (View -> Output)
UpdateSettings (returns Void) | (parameterless) Update Chart Settings
UpdatePrintSettings (returns Void) | (parameterless) Update Print Settings
UpdateColor (returns Void) | (parameterless) Update color of the last plot using the specified conditions
SetMinScale (returns Void) | (parameterless) Set the minimum chart scale
SetMaxScale (returns Void) | (parameterless) Set the maximum chart scale
SetScale (returns Void) | (Min Value Double, Max Value Double) Set the chart scale
SetPercentScale (returns Void) | (parameterless) Update chart scale by a percentage
SetHatchBrush (returns Void) | (parameterless) Set a hatch brush for the last plot


CustomDatabaseValues

QuantShare API Documentation

CustomDatabaseValues Members

Parent

Properties

[Int32] (of type Object) | Get the element at the specified index
Length (of type Int32) | Get the number of elements for the current bar period

Methods

GetValue (returns Object) (index Int32)

Get the element at the specified index


CustomDatabaseValuesDouble

QuantShare API Documentation

CustomDatabaseValuesDouble Members

Parent

Properties

[Int32] (of type Double) | Get the element at the specified index
Length (of type Int32) | Get the number of elements for the current bar period

Methods

GetValue (returns Double) (index Int32)

Get the element at the specified index


QSFormula

QuantShare API Documentation

QSFormula Members

Parent

Methods

GetVectorDouble (returns VectorD) | (variable name String) Get a double variable from the compiled formula
GetVectorString (returns VectorS) | (variable name String) Get a string variable from the compiled formula
SetParameter (returns Void) | (variable name String, vector VectorD) Set a formula variable
Compile (returns Boolean) | (parameterless) Compile the formula. Returns true if the compilation succeeds


QSFunctions

QuantShare API Documentation

QSFunctions Members

Trading Indicators

Parent

Methods

NbInIndex (returns VectorD) | (Index name VectorS) Returns the number of symbols that are included in the specified index
BSignalLong (returns VectorD) | (Min profit VectorD, Max drawdown VectorD, Minimum days VectorD, Maximum days VectorD) Gives you the best long entries and exits depending on the parameters you choose|Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent,|a minimum number of bars equal to 10 and a maximum number of bars equal to 100|The system will give you the most profitable trades that meet these criteria|Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows|Click on those arrows to see additional information
BSignalShort (returns VectorD) | (Min profit VectorD, Max drawdown VectorD, Minimum days VectorD, Maximum days VectorD) Gives you the best short entries and exits depending on the parameters you choose|Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent,|a minimum number of bars equal to 10 and a maximum number of bars equal to 100|The system will give you the most profitable trades that meet these criteria|Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows|Click on those arrows to see additional information
BSignal (returns VectorD) | (Min profit VectorD, Max drawdown VectorD, Minimum days VectorD, Maximum days VectorD) Gives you the best long and short entries and exits depending on the parameters you choose|Example if you choose a minimum profit of 20 percent, a maximum drawdown of 10 percent,|a minimum number of bars equal to 10 and a maximum number of bars equal to 100|The system will give you the most profitable trades that meet these criteria|Plot the returned array in a graph that contains CandleStick data to see entries and exits arrows|Click on those arrows to see additional information
EntryLongProfit (returns VectorD) | (Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached
EntryShortProfit (returns VectorD) | (Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached
EntryLongProfitPerBar (returns VectorD) | (Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached
EntryShortProfitPerBar (returns VectorD) | (Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached
EntryLongProfitCond (returns VectorD) | (Condition VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached , |then move to the bar number (next bar number + last trade holding period)
EntryShortProfitCond (returns VectorD) | (Condition VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached , |then move to the bar number (next bar number + last trade holding period)
EntryLongProfitPerBarCond (returns VectorD) | (Condition VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached , |then move to the bar number (next bar number + last trade holding period)
EntryShortProfitPerBarCond (returns VectorD) | (Condition VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached , |then move to the bar number (next bar number + last trade holding period)
EntryLongProfitExitRule (returns VectorD) | (Exit VectorD, Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
EntryShortProfitExitRule (returns VectorD) | (Exit VectorD, Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
EntryLongProfitPerBarExitRule (returns VectorD) | (Exit VectorD, Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
EntryShortProfitPerBarExitRule (returns VectorD) | (Exit VectorD, Max drawdown VectorD, Maximum days VectorD) For each bar in the 'close' array, calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE
EntryLongProfitCondExitRule (returns VectorD) | (Condition VectorD, Exit VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, |then move to the bar number (next bar number + last trade holding period)
EntryShortProfitCondExitRule (returns VectorD) | (Condition VectorD, Exit VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, |then move to the bar number (next bar number + last trade holding period)
EntryLongProfitPerBarCondExitRule (returns VectorD) | (Condition VectorD, Exit VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance PER BAR of a system that buy the current symbol at the next open bar and sell it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, |then move to the bar number (next bar number + last trade holding period)
EntryShortProfitPerBarCondExitRule (returns VectorD) | (Condition VectorD, Exit VectorD, Max drawdown VectorD, Maximum days VectorD) Calculates the performance PER BAR of a system that short the current symbol at the next open bar and cover it when the system drawdown becomes|higher than the specified number or the maximum number of bar is reached or the exit rule is TRUE, |then move to the bar number (next bar number + last trade holding period)
CdlLadderbottom (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Ladder Bottom, The downtrend is finishing with four consecutive black candles, each closing lower than the previous day.
CdlLongleggeddoji (returns VectorD) | (parameterless) Long Legged Doji, The Long-legged Doji is composed of long upper and lower shadows.
CdlLongleggeddoji (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Long Legged Doji, The Long-legged Doji is composed of long upper and lower shadows.
CdlLongline (returns VectorD) | (parameterless) Long Line Candle, A long day (LONGLINE) represents a large price move from open to close.
CdlLongline (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Long Line Candle, A long day (LONGLINE) represents a large price move from open to close.
CdlMarubozu (returns VectorD) | (parameterless) Marubozu, in Japanese, Marubozu means close cropped or close-cut.
CdlMarubozu (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Marubozu, in Japanese, Marubozu means close cropped or close-cut.
CdlMatchinglow (returns VectorD) | (parameterless) Matching Low, The Matching Low pattern is similar to the Homing Pigeon patter, the exception being that the two days of the pattern close on their lows, at the same level.
CdlMatchinglow (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Matching Low, The Matching Low pattern is similar to the Homing Pigeon patter, the exception being that the two days of the pattern close on their lows, at the same level.
CdlMathold (returns VectorD) | (penetration VectorD) Mat Hold, The pattern appears during an uptrend, which is further confirmed by the first long white candlestick.
CdlMathold (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Mat Hold, The pattern appears during an uptrend, which is further confirmed by the first long white candlestick.
CdlMorningdojistar (returns VectorD) | (penetration VectorD) Morning Doji Star, A three day bullish reversal pattern that is very similar to the Morning Star.
CdlMorningdojistar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Morning Doji Star, A three day bullish reversal pattern that is very similar to the Morning Star.
CdlMorningstar (returns VectorD) | (penetration VectorD) Morning Star, The Morning Star is a bottom reversal signal.
CdlMorningstar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Morning Star, The Morning Star is a bottom reversal signal.
CdlOnneck (returns VectorD) | (parameterless) On-Neck Pattern, The On Neck Line pattern is almost a 'meeting line pattern', but the critical term is 'almost'.
CdlOnneck (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) On-Neck Pattern, The On Neck Line pattern is almost a 'meeting line pattern', but the critical term is 'almost'.
CdlPiercing (returns VectorD) | (parameterless) Piercing Pattern, The Piercing Pattern is composed of a two-candle formation in a down trending market.
CdlPiercing (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Piercing Pattern, The Piercing Pattern is composed of a two-candle formation in a down trending market.
CdlRickshawman (returns VectorD) | (parameterless) Rickshaw Man, Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
CdlRickshawman (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Rickshaw Man, Rickshaw man is a specific type of long-legged doji where the open and close are in the middle of the price range.
CdlRisefall3methods (returns VectorD) | (parameterless) Rising/Falling Three Methods, The Falling Three Method is basically the opposite of the Rising Three Method, The market has been in a downtrend.
CdlRisefall3methods (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Rising/Falling Three Methods, The Falling Three Method is basically the opposite of the Rising Three Method, The market has been in a downtrend.
CdlSeparatinglines (returns VectorD) | (parameterless) Separating Lines, You can identify it from the following points: The first day is a long white candle.
CdlSeparatinglines (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Separating Lines, You can identify it from the following points: The first day is a long white candle.
CdlShootingstar (returns VectorD) | (parameterless) Shooting Star, The Shooting Star is comprised of one candle.
CdlShootingstar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Shooting Star, The Shooting Star is comprised of one candle.
CdlShortline (returns VectorD) | (parameterless) Short Line Candle, Short days (SHORTLINES) can be interpreted by the same analytical process of the long candles.
CdlShortline (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Short Line Candle, Short days (SHORTLINES) can be interpreted by the same analytical process of the long candles.
CdlSpinningtop (returns VectorD) | (parameterless) Spinning Top, spinning Tops are depicted with small bodies relative to the shadows.
CdlSpinningtop (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Spinning Top, spinning Tops are depicted with small bodies relative to the shadows.
CdlStalledpattern (returns VectorD) | (parameterless) Stalled Pattern, Another pattern close to the Three White Soldiers pattern is the Stalled Pattern (commonly known as the Deliberation pattern).
CdlStalledpattern (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Stalled Pattern, Another pattern close to the Three White Soldiers pattern is the Stalled Pattern (commonly known as the Deliberation pattern).
CdlSticksandwich (returns VectorD) | (parameterless) Stick Sandwich, The Stick Sandwich looks somewhat like an ice cream sandwich.
CdlSticksandwich (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Stick Sandwich, The Stick Sandwich looks somewhat like an ice cream sandwich.
CdlTakuri (returns VectorD) | (parameterless) Takuri (Dragonfly Doji with very long lower shadow) : This function is contained within the Pattern Recognition set of indicators.
CdlTakuri (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Takuri (Dragonfly Doji with very long lower shadow) : This function is contained within the Pattern Recognition set of indicators.
CdlTasukigap (returns VectorD) | (parameterless) Tasuki Gap, The Upside Tasuki Gap is found in a rising trend.
CdlTasukigap (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Tasuki Gap, The Upside Tasuki Gap is found in a rising trend.
CdlThrusting (returns VectorD) | (parameterless) Thrusting Pattern, The Thrusting pattern is almost an 'On Neck' or an 'In Neck' pattern and resembles the Meeting Line pattern, also.
CdlThrusting (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Thrusting Pattern, The Thrusting pattern is almost an 'On Neck' or an 'In Neck' pattern and resembles the Meeting Line pattern, also.
CdlTristar (returns VectorD) | (parameterless) Tristar Pattern, The Tri Star pattern is relatively rare.
CdlTristar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Tristar Pattern, The Tri Star pattern is relatively rare.
CdlUnique3river (returns VectorD) | (parameterless) Unique 3 River, The Unique Three River Bottom is a bullish pattern, somewhat characteristic of the Morning Star Pattern.
CdlUnique3river (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Unique 3 River, The Unique Three River Bottom is a bullish pattern, somewhat characteristic of the Morning Star Pattern.
CdlUpsidegap2crows (returns VectorD) | (parameterless) Upside Gap Two Crows, The Upside Gap Two Crows is a three-day pattern.
CdlUpsidegap2crows (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Upside Gap Two Crows, The Upside Gap Two Crows is a three-day pattern.
CdlXsidegap3methods (returns VectorD) | (parameterless) Upside/Downside Gap Three Methods, the Bullish Upside Gap Three Methods Pattern, the market is in a strong bullish mood.
CdlXsidegap3methods (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Upside/Downside Gap Three Methods, the Bullish Upside Gap Three Methods Pattern, the market is in a strong bullish mood.
Absolute (returns VectorD) | (array VectorD) Calculate the absolute value of each element in the array
Atan (returns VectorD) | (array VectorD) Calculate the arc tangent of each element in the array
Ceil (returns VectorD) | (array VectorD) For each element in the array, calculate the lowest integer greater than or equal to the element value
Cos (returns VectorD) | (array VectorD) Calculate the cosinus of each element in the array
Sin (returns VectorD) | (array VectorD) Calculate the sinus of each element in the array
Tan (returns VectorD) | (array VectorD) Calculate the tangent of each element in the array
Cosh (returns VectorD) | (array VectorD) Calculate the hyperbolic cosine of each element in the array
Sinh (returns VectorD) | (array VectorD) Calculate the hyperbolic sine of each element in the array
Tanh (returns VectorD) | (array VectorD) Calculate the hyperbolic tangent of each element in the array
Exp (returns VectorD) | (array VectorD) For each element in the array, calculate 'e' raised to the element value
Floor (returns VectorD) | (array VectorD) For each element in the array, calculate the largest integer less than or equal to the element value
Frac (returns VectorD) | (array VectorD) Calculate the fractional part of each element in the array
Int (returns VectorD) | (array VectorD) Calculate the integer part of each element in the array
Log (returns VectorD) | (array VectorD) Calculate the natural logarithm (ln) of each element in the array
Log10 (returns VectorD) | (array VectorD) Calculate the base 10 logarithm of each element in the array
Round (returns VectorD) | (array VectorD, decimals VectorD) Calculate the rounded value of each element in the array
Sign (returns VectorD) | (array VectorD) Calculate the sign of each element in the array
Sqrt (returns VectorD) | (array VectorD) Calculate the square root of each element in the array
Pow (returns VectorD) | (array VectorD, power VectorD) For each element in the array, raise the element value to the specified power
IeeeRemainder (returns VectorD) | (array VectorD, array VectorD) For each element in the array, calculate the remainder resulting from the division of the element value by the specified number
DivRem (returns VectorD) | (array VectorD, array VectorD) For each element in the array, calculate the quotion
IsNull (returns VectorD) | (array VectorD) Returns 1 if all elements in the array equal to 0
IsNaN (returns VectorD) | (array VectorD) Returns 1 if all elements in the array equal to NaN
IsNoZero (returns VectorD) | (array VectorD) Returns 0 if at least one elements in the array is equal to 0
IsNoNaN (returns VectorD) | (array VectorD) Returns 0 if at least one elements in the array is equal to NaN
NaNtoZero (returns VectorD) | (Array VectorD, type VectorD) Change NaN value to Zero in the specified array.|Set zero to the parameter 'type' to update only the firsts NaN, Set one to update all NaN values
NaNtoLast (returns VectorD) | (array VectorD) Update the NA values with the last non NaN values
NbMarkets (returns VectorD) | (parameterless) Returns the number of markets
NbGroups (returns VectorD) | (parameterless) Returns the number of groups
NbSectors (returns VectorD) | (parameterless) Returns the number of sectors
NbIndustries (returns VectorD) | (parameterless) Returns the number of industries
NbIndexes (returns VectorD) | (parameterless) Returns the number of indexes
NbInMarket (returns VectorD) | (Market name VectorS) Returns the number of symbols that are included in the specified market
NbInGroup (returns VectorD) | (Group name VectorS) Returns the number of symbols that are included in the specified group
NbInSector (returns VectorD) | (Sector name VectorS) Returns the number of symbols that are included in the specified sector
NbInIndustry (returns VectorD) | (Industry name VectorS) Returns the number of symbols that are included in the specified industry
Minute (returns VectorD) | (parameterless) Returns the current bar's minute
Second (returns VectorD) | (parameterless) Returns the current bar's second
Interval (returns VectorD) | (parameterless) Returns the number of ticks between the current and previous bar date
NbDays (returns VectorD) | (period VectorD) Returns the number of days between the current bar and the bar referenced by the period value
IsTrue (returns VectorD) | (array VectorD, lag VectorD) Returns 1 if all the values between the current bar and the lag bar are superior to 0
IsFalse (returns VectorD) | (array VectorD, lag VectorD) Returns 1 if all the values between the current bar and the lag bar are inferior or equal to 0
TotalBars (returns VectorD) | (parameterless) Returns the total number of bars
IsLastBar (returns VectorD) | (parameterless) Returns 1 if the the current bar is the last one
LSwitch (returns VectorD) | (array VectorD, array VectorD) Returns 1 for all bars after the first array is 'true' until a 'true' occurs in the second array. In this case, next bars will get 0 until the first array is 'true' again.
AMA (returns VectorD) | (array VectorD, smoothing factor VectorD) Returns the adaptive moving average, which is a moving average with a time-variant smoothing factor.
HistoPrice (returns VectorD) | (System.Collections.Generic.List`1[System.String] String, day lag (O to get the current day) VectorD) Returns the historical close, open, high, low, volume or open interest of past days
HistoPrice (returns VectorD) | (System.Collections.Generic.List`1[System.String] String, day lag (O to get the current day) VectorD, Use Open Session Time. 1 for TRUE. VectorD) Returns the historical close, open, high, low, volume or open interest of past days. Ability to select whether to use session open time or not.
Cdl2crows (returns VectorD) | (parameterless) Two Crows, The Two Crows Pattern is a 3-day pattern.
Cdl2crows (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Two Crows, The Two Crows Pattern is a 3-day pattern.
Cdl3blackcrows (returns VectorD) | (parameterless) Three Black Crows, The Three Black Crows got their name from the resemblance of three crows looking down from their perch from a tree.
Cdl3blackcrows (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three Black Crows, The Three Black Crows got their name from the resemblance of three crows looking down from their perch from a tree.
Cdl3inside (returns VectorD) | (parameterless) Three Inside Up/Down, Note that after the long candle day that is in the same direction of the trend that the Harami pattern occurs.
Cdl3inside (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three Inside Up/Down, Note that after the long candle day that is in the same direction of the trend that the Harami pattern occurs.
Cdl3linestrike (returns VectorD) | (parameterless) Three-Line Strike : This function is contained within the Pattern Recognition set of indicators.
Cdl3linestrike (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three-Line Strike : This function is contained within the Pattern Recognition set of indicators.
Cdl3outside (returns VectorD) | (parameterless) Three Outside Up/Down : This function is contained within the Pattern Recognition set of indicators.
Cdl3outside (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three Outside Up/Down : This function is contained within the Pattern Recognition set of indicators.
Cdl3staRsinsouth (returns VectorD) | (parameterless) Three Stars In The South, The slow down of the trend is visually obvious.
Cdl3staRsinsouth (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three Stars In The South, The slow down of the trend is visually obvious.
Cdl3whitesoldiers (returns VectorD) | (parameterless) Three Advancing White Soldiers, The Three White Soldiers (also known as The Advancing Three White Soldiers) is a healthy market reversal pattern.
Cdl3whitesoldiers (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Three Advancing White Soldiers, The Three White Soldiers (also known as The Advancing Three White Soldiers) is a healthy market reversal pattern.
CdlAbandonedbaby (returns VectorD) | (penetration VectorD) Abandoned Baby, A rare reversal pattern characterized by a gap followed by a Doji, which is then followed by another gap in the opposite direction.
CdlAbandonedbaby (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Abandoned Baby, A rare reversal pattern characterized by a gap followed by a Doji, which is then followed by another gap in the opposite direction.
CdlAdvanceblock (returns VectorD) | (parameterless) Advance Block, The Advance Block is somewhat indicative as the Three White Soldiers but it is a bearish signal.
CdlAdvanceblock (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Advance Block, The Advance Block is somewhat indicative as the Three White Soldiers but it is a bearish signal.
CdlBelthold (returns VectorD) | (parameterless) Belt-hold, The Belt Hold lines are formed by single candlesticks.
CdlBelthold (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Belt-hold, The Belt Hold lines are formed by single candlesticks.
CdlBreakaway (returns VectorD) | (parameterless) Breakaway, If a trend has been evident, the breakaway pattern, whether bullish or bearish initially indicates the acceleration of that trend.
CdlBreakaway (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Breakaway, If a trend has been evident, the breakaway pattern, whether bullish or bearish initially indicates the acceleration of that trend.
CdlClosingmarubozu (returns VectorD) | (parameterless) Closing Marubozu, a Closing Marubozu has no shadow at it's closing end.
CdlClosingmarubozu (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Closing Marubozu, a Closing Marubozu has no shadow at it's closing end.
CdlConcealbabyswall (returns VectorD) | (parameterless) Concealing Baby Swallow, The first two days of the signal, two Black Marubozus, demonstrate the continuation of the downtrend.
CdlConcealbabyswall (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Concealing Baby Swallow, The first two days of the signal, two Black Marubozus, demonstrate the continuation of the downtrend.
CdlCounterattack (returns VectorD) | (parameterless) Counterattack, Meeting Lines (or Counterattack Lines) are formed when opposite coloured bodies have the same closing price.
CdlCounterattack (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Counterattack, Meeting Lines (or Counterattack Lines) are formed when opposite coloured bodies have the same closing price.
CdlDarkcloudcover (returns VectorD) | (penetration VectorD) Dark Cloud Cover, The dark Cloud Cover is the bearish counterpart to the Piercing pattern.
CdlDarkcloudcover (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Dark Cloud Cover, The dark Cloud Cover is the bearish counterpart to the Piercing pattern.
CdlDoji (returns VectorD) | (parameterless) Doji, the Doji is one of the most important signals in candlestick analysis.
CdlDoji (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Doji, the Doji is one of the most important signals in candlestick analysis.
CdlDojistar (returns VectorD) | (parameterless) Doji Star, Upon seeing a Doji in an overbought or oversold condition, an extremely high probability reversal situation becomes evident.
CdlDojistar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Doji Star, Upon seeing a Doji in an overbought or oversold condition, an extremely high probability reversal situation becomes evident.
CdlDragonflydoji (returns VectorD) | (parameterless) Dragonfly Doji, The Dragonfly Doji occurs when trading opens, trades lower, then closes at the open price which is the high of the day.
CdlDragonflydoji (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Dragonfly Doji, The Dragonfly Doji occurs when trading opens, trades lower, then closes at the open price which is the high of the day.
CdlEngulfing (returns VectorD) | (parameterless) Engulfing Pattern, Two of the most compelling candlestick signals are the Bullish Engulfing Pattern and Bearish Engulfing Pattern.
CdlEngulfing (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Engulfing Pattern, Two of the most compelling candlestick signals are the Bullish Engulfing Pattern and Bearish Engulfing Pattern.
CdlEveningdojistar (returns VectorD) | (penetration VectorD) Evening Doji Star, A three day bearish reversal pattern similar to the Evening Star.
CdlEveningdojistar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Evening Doji Star, A three day bearish reversal pattern similar to the Evening Star.
CdlEveningstar (returns VectorD) | (penetration VectorD) Evening Star, The Evening Star pattern is a top reversal signal.
CdlEveningstar (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD, penetration VectorD) Evening Star, The Evening Star pattern is a top reversal signal.
CdlGapsidesidewhite (returns VectorD) | (parameterless) Up/Down-gap side-by-side white lines, The Up Side By Side White Lines Pattern appears in a bullish market.
CdlGapsidesidewhite (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Up/Down-gap side-by-side white lines, The Up Side By Side White Lines Pattern appears in a bullish market.
CdlGravestonedoji (returns VectorD) | (parameterless) Gravestone Doji, The Gravestone Doji is formed when the open and the close occur at the low end of the trading range.
CdlGravestonedoji (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Gravestone Doji, The Gravestone Doji is formed when the open and the close occur at the low end of the trading range.
CdlHammer (returns VectorD) | (parameterless) Hammer, The Hammer is comprised of one candle.
CdlHammer (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Hammer, The Hammer is comprised of one candle.
CdlHangingman (returns VectorD) | (parameterless) Hanging Man, The Hanging Man is also comprised of one candle.
CdlHangingman (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Hanging Man, The Hanging Man is also comprised of one candle.
CdlHarami (returns VectorD) | (parameterless) Harami Pattern, The Harami is an often seen formation.
CdlHarami (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Harami Pattern, The Harami is an often seen formation.
CdlHaramicross (returns VectorD) | (parameterless) Harami Cross Pattern, A two day pattern similar to the Harami (see CDLHARAMI() ), the difference is that the last day is a Doji.
CdlHaramicross (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Harami Cross Pattern, A two day pattern similar to the Harami (see CDLHARAMI() ), the difference is that the last day is a Doji.
CdlHighwave (returns VectorD) | (parameterless) High-Wave Candle : This function is contained within the Pattern Recognition set of indicators.
CdlHighwave (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) High-Wave Candle : This function is contained within the Pattern Recognition set of indicators.
CdlHikkake (returns VectorD) | (parameterless) Hikkake Pattern
CdlHikkake (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Hikkake Pattern
CdlHikkakemod (returns VectorD) | (parameterless) Modified Hikkake Pattern
CdlHikkakemod (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Modified Hikkake Pattern
CdlHomingpigeon (returns VectorD) | (parameterless) Homing Pigeon, The Homing Pigeon is the same as the Harami, except for the colour of the second day's body.
CdlHomingpigeon (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Homing Pigeon, The Homing Pigeon is the same as the Harami, except for the colour of the second day's body.
CdlIdentical3crows (returns VectorD) | (parameterless) Identical Three Crows, The Three Identical Crows have the same criteria as the Three Black Crows.
CdlIdentical3crows (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Identical Three Crows, The Three Identical Crows have the same criteria as the Three Black Crows.
CdlInneck (returns VectorD) | (parameterless) In-Neck Pattern, The In Neck pattern is almost a Meeting Line pattern.
CdlInneck (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) In-Neck Pattern, The In Neck pattern is almost a Meeting Line pattern.
CdlInvertedhammer (returns VectorD) | (parameterless) Inverted Hammer, The Inverted Hammer is comprised of one candle.
CdlInvertedhammer (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Inverted Hammer, The Inverted Hammer is comprised of one candle.
CdlKicking (returns VectorD) | (parameterless) Kicking, The Kicker signal is the most powerful signal of all.
CdlKicking (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Kicking, The Kicker signal is the most powerful signal of all.
CdlKickingbylength (returns VectorD) | (parameterless) Kicking - bull/bear determined by the longer marubozu, The Kicker signal is the most powerful signal of all.
CdlKickingbylength (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Kicking - bull/bear determined by the longer marubozu, The Kicker signal is the most powerful signal of all.
CdlLadderbottom (returns VectorD) | (parameterless) Ladder Bottom, The downtrend is finishing with four consecutive black candles, each closing lower than the previous day.
MidPoint (returns VectorD) | (close VectorD, timePeriod VectorD) MidPoint over period
MidPrice (returns VectorD) | (timePeriod VectorD) MidPoint Price over period
MidPrice (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) MidPoint Price over period
Llv (returns VectorD) | (timePeriod VectorD) Lowest value over a specified period
Llv (returns VectorD) | (close VectorD, timePeriod VectorD) Lowest value over a specified period
Minus_Di (returns VectorD) | (timePeriod VectorD) Minus Directional Indicator
Minus_Di (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Minus Directional Indicator
Minus_Dm (returns VectorD) | (timePeriod VectorD) Minus Directional Movement
Minus_Dm (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) Minus Directional Movement
Mom (returns VectorD) | (timePeriod VectorD) Momentum
Mom (returns VectorD) | (close VectorD, timePeriod VectorD) Momentum
Natr (returns VectorD) | (timePeriod VectorD) Normalized Average True Range
Natr (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Normalized Average True Range
Obv (returns VectorD) | (parameterless) On Balance Volume
Obv (returns VectorD) | (close VectorD, volume VectorD) On Balance Volume
Plus_Di (returns VectorD) | (timePeriod VectorD) Plus Directional Indicator
Plus_Di (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Plus Directional Indicator
Plus_Dm (returns VectorD) | (timePeriod VectorD) Plus Directional Movement
Plus_Dm (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) Plus Directional Movement
Ppo (returns VectorD) | (fastPeriod VectorD, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) Percentage Price Oscillator
Ppo (returns VectorD) | (close VectorD, fastPeriod VectorD, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) Percentage Price Oscillator
Roc (returns VectorD) | (timePeriod VectorD) Rate of change
Roc (returns VectorD) | (close VectorD, timePeriod VectorD) Rate of change
Rocp (returns VectorD) | (timePeriod VectorD) Rate of change Percentage
Rocp (returns VectorD) | (close VectorD, timePeriod VectorD) Rate of change Percentage
Rocr (returns VectorD) | (timePeriod VectorD) Rate of change ratio
Rocr (returns VectorD) | (close VectorD, timePeriod VectorD) Rate of change ratio
Rocr100 (returns VectorD) | (timePeriod VectorD) Rate of change ratio (scale 100)
Rocr100 (returns VectorD) | (close VectorD, timePeriod VectorD) Rate of change ratio (scale 100)
Rsi (returns VectorD) | (timePeriod VectorD) Relative Strength Index
Rsi (returns VectorD) | (close VectorD, timePeriod VectorD) Relative Strength Index
Sar (returns VectorD) | (acceleration VectorD, maximum VectorD) Parabolic SAR
Sar (returns VectorD) | (high VectorD, low VectorD, acceleration VectorD, maximum VectorD) Parabolic SAR
SarExt (returns VectorD) | (startValue VectorD, offsetOnReverse VectorD, accelerationInitLong VectorD, accelerationLong VectorD, accelerationMaxLong VectorD, accelerationInitShort VectorD, accelerationShort VectorD, accelerationMaxShort VectorD) Parabolic SAR - Extended
SarExt (returns VectorD) | (high VectorD, low VectorD, startValue VectorD, offsetOnReverse VectorD, accelerationInitLong VectorD, accelerationLong VectorD, accelerationMaxLong VectorD, accelerationInitShort VectorD, accelerationShort VectorD, accelerationMaxShort VectorD) Parabolic SAR - Extended
Sma (returns VectorD) | (timePeriod VectorD) Simple Moving Average
Sma (returns VectorD) | (close VectorD, timePeriod VectorD) Simple Moving Average
Stddev (returns VectorD) | (timePeriod VectorD) Standard Deviation
Stddev (returns VectorD) | (close VectorD, timePeriod VectorD) Standard Deviation
StochSlowd (returns VectorD) | (fastK_Period VectorD, slowK_Period VectorD, System.Collections.Generic.List`1[System.String] String, slowD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Slow D
StochSlowd (returns VectorD) | (high VectorD, low VectorD, close VectorD, volume VectorD, fastK_Period VectorD, slowK_Period VectorD, System.Collections.Generic.List`1[System.String] String, slowD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Slow D
StochSlowk (returns VectorD) | (fastK_Period VectorD, slowK_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Slow K
StochSlowk (returns VectorD) | (high VectorD, low VectorD, close VectorD, volume VectorD, fastK_Period VectorD, slowK_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Slow K
StochRsiFastd (returns VectorD) | (timePeriod VectorD, fastK_Period VectorD, fastD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Relative Strength Index Fast D
StochRsiFastd (returns VectorD) | (close VectorD, timePeriod VectorD, fastK_Period VectorD, fastD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Relative Strength Index Fast D
StochRsiFastk (returns VectorD) | (timePeriod VectorD, fastK_Period VectorD) Stochastic Relative Strength Index Fast K
StochRsiFastk (returns VectorD) | (close VectorD, timePeriod VectorD, fastK_Period VectorD) Stochastic Relative Strength Index Fast K
StochFastd (returns VectorD) | (fastK_Period VectorD, fastD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Fast D
StochFastd (returns VectorD) | (high VectorD, low VectorD, close VectorD, fastK_Period VectorD, fastD_Period VectorD, System.Collections.Generic.List`1[System.String] String) Stochastic Fast D
StochFastk (returns VectorD) | (fastK_Period VectorD) Stochastic Fast K
StochFastk (returns VectorD) | (high VectorD, low VectorD, close VectorD, fastK_Period VectorD) Stochastic Fast K
T3 (returns VectorD) | (timePeriod VectorD, vFactor VectorD) Triple Exponential Moving Average (T3)
T3 (returns VectorD) | (close VectorD, timePeriod VectorD, vFactor VectorD) Triple Exponential Moving Average (T3)
Tema (returns VectorD) | (timePeriod VectorD) Triple Exponential Moving Average
Tema (returns VectorD) | (close VectorD, timePeriod VectorD) Triple Exponential Moving Average
Trange (returns VectorD) | (parameterless) True Range
Trange (returns VectorD) | (high VectorD, low VectorD, close VectorD) True Range
Trima (returns VectorD) | (timePeriod VectorD) Triangular Moving Average
Trima (returns VectorD) | (close VectorD, timePeriod VectorD) Triangular Moving Average
Trix (returns VectorD) | (timePeriod VectorD) 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
Trix (returns VectorD) | (close VectorD, timePeriod VectorD) 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
Tsf (returns VectorD) | (timePeriod VectorD) Time Series Forecast
Tsf (returns VectorD) | (close VectorD, timePeriod VectorD) Time Series Forecast
TypPrice (returns VectorD) | (timePeriod VectorD) Typical Price
TypPrice (returns VectorD) | (high VectorD, low VectorD, close VectorD) Typical Price
UltOsc (returns VectorD) | (timePeriod1 VectorD, timePeriod2 VectorD, timePeriod3 VectorD) Ultimate Oscillator
UltOsc (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod1 VectorD, timePeriod2 VectorD, timePeriod3 VectorD) Ultimate Oscillator
Var (returns VectorD) | (timePeriod VectorD) Variance
Var (returns VectorD) | (close VectorD, timePeriod VectorD) Variance
WclPrice (returns VectorD) | (parameterless) Weighted Close Price
WclPrice (returns VectorD) | (high VectorD, low VectorD, close VectorD) Weighted Close Price
Willr (returns VectorD) | (timePeriod VectorD) Williams' %R
Willr (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Williams' %R
Wma (returns VectorD) | (timePeriod VectorD) Weighted Moving Average
Wma (returns VectorD) | (close VectorD, timePeriod VectorD) Weighted Moving Average
Count (returns VectorD) | (parameterless) Returns the number of bars
DateTicks (returns VectorD) | (parameterless) Returns the number of ticks that represent the current date and time
TimeTicks (returns VectorD) | (parameterless) Returns the number of ticks that represent the current time
DayOfWeek (returns VectorD) | (parameterless) Returns the current bar's day of week (1 for Monday, 2 for Tuesday, 3 for Wednesday...)
DayOfYear (returns VectorD) | (parameterless) Returns the current bar's day of the year
Week (returns VectorD) | (parameterless) Returns the current bar's week
Day (returns VectorD) | (parameterless) Returns the current bar's day of the month
Month (returns VectorD) | (parameterless) Returns the current bar's month
Year (returns VectorD) | (parameterless) Returns the current bar's year
Hour (returns VectorD) | (parameterless) Returns the current bar's hour
Adxr (returns VectorD) | (timePeriod VectorD) Average Directional Movement Index Rating
Adxr (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Average Directional Movement Index Rating
Apo (returns VectorD) | (fastPeriod VectorD, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) Absolute Price Oscillator
Apo (returns VectorD) | (high VectorD, fastPeriod VectorD, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) Absolute Price Oscillator
AroonDown (returns VectorD) | (timePeriod VectorD) Aroon Down
AroonDown (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) Aroon Down
AroonOsc (returns VectorD) | (timePeriod VectorD) Aroon Oscillator
AroonOsc (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) Aroon Oscillator
AroonUp (returns VectorD) | (timePeriod VectorD) Aroon Up
AroonUp (returns VectorD) | (high VectorD, low VectorD, timePeriod VectorD) Aroon Up
Atr (returns VectorD) | (timePeriod VectorD) Average True Range
Atr (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Average True Range
AvgPrice (returns VectorD) | (parameterless) Average Price
AvgPrice (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Average Price
BbandsLower (returns VectorD) | (timePeriod VectorD, nbDevDown VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Lower band)
BbandsLower (returns VectorD) | (close VectorD, timePeriod VectorD, nbDevDown VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Lower band)
BbandsMiddle (returns VectorD) | (timePeriod VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Middle band)
BbandsMiddle (returns VectorD) | (close VectorD, timePeriod VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Middle band)
BbandsUpper (returns VectorD) | (timePeriod VectorD, nbDevUp VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Upper band)
BbandsUpper (returns VectorD) | (close VectorD, timePeriod VectorD, nbDevUp VectorD, System.Collections.Generic.List`1[System.String] String) Bollinger Bands (Upper band)
Bop (returns VectorD) | (parameterless) Balance Of Power
Bop (returns VectorD) | (open VectorD, high VectorD, low VectorD, close VectorD) Balance Of Power
Cci (returns VectorD) | (timePeriod VectorD) Commodity Channel Index
Cci (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Commodity Channel Index
Cmo (returns VectorD) | (timePeriod VectorD) Chande Momentum Oscillator
Cmo (returns VectorD) | (close VectorD, timePeriod VectorD) Chande Momentum Oscillator
Correl (returns VectorD) | (array VectorD, timePeriod VectorD) Correlation Analysis
Correl (returns VectorD) | (array VectorD, array VectorD, timePeriod VectorD) Correlation Analysis
Dema (returns VectorD) | (timePeriod VectorD) Double Exponential Moving Average
Dema (returns VectorD) | (close VectorD, timePeriod VectorD) Double Exponential Moving Average
Dx (returns VectorD) | (timePeriod VectorD) Directional Movement Index
Dx (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Directional Movement Index
Ema (returns VectorD) | (timePeriod VectorD) Exponential Moving Average
Ema (returns VectorD) | (close VectorD, timePeriod VectorD) Exponential Moving Average
Fama (returns VectorD) | (fastLimit VectorD, slowLimit VectorD) Following Adaptive Moving Average
Fama (returns VectorD) | (array VectorD, fastLimit VectorD, slowLimit VectorD) Following Adaptive Moving Average
Ht_Dcperiod (returns VectorD) | (parameterless) Hilbert Transform - Dominant Cycle Period
Ht_Dcperiod (returns VectorD) | (close VectorD) Hilbert Transform - Dominant Cycle Period
Ht_Dcphase (returns VectorD) | (parameterless) Hilbert Transform - Dominant Cycle Phase
Ht_Dcphase (returns VectorD) | (close VectorD) Hilbert Transform - Dominant Cycle Phase
Ht_Leadsine (returns VectorD) | (parameterless) Hilbert Transform - SineWave
Ht_Leadsine (returns VectorD) | (close VectorD) Hilbert Transform - SineWave
Ht_Phasorphase (returns VectorD) | (parameterless) Hilbert Transform - Instantaneous Trendline
Ht_Phasorphase (returns VectorD) | (close VectorD) Hilbert Transform - Instantaneous Trendline
Ht_Phasorquadrature (returns VectorD) | (parameterless) Hilbert Transform - Trend vs Cycle Mode
Ht_Phasorquadrature (returns VectorD) | (close VectorD) Hilbert Transform - Trend vs Cycle Mode
Ht_Sine (returns VectorD) | (parameterless) Hilbert Transform - SineWave
Ht_Sine (returns VectorD) | (close VectorD) Hilbert Transform - SineWave
Ht_Trendline (returns VectorD) | (parameterless) Hilbert Transform - Phasor Components
Ht_Trendline (returns VectorD) | (close VectorD) Hilbert Transform - Phasor Components
Ht_Trendmode (returns VectorD) | (parameterless) Hilbert Transform - Phasor Components
Ht_Trendmode (returns VectorD) | (close VectorD) Hilbert Transform - Phasor Components
Kama (returns VectorD) | (timePeriod VectorD) Kaufman Adaptive Moving Average
Kama (returns VectorD) | (close VectorD, timePeriod VectorD) Kaufman Adaptive Moving Average
LinearReg (returns VectorD) | (timePeriod VectorD) Linear Regression
LinearReg (returns VectorD) | (close VectorD, timePeriod VectorD) Linear Regression
LinearReg_Angle (returns VectorD) | (timePeriod VectorD) Linear Regression Angle
LinearReg_Angle (returns VectorD) | (close VectorD, timePeriod VectorD) Linear Regression Angle
LinearReg_Intercept (returns VectorD) | (timePeriod VectorD) Linear Regression Intercept
LinearReg_Intercept (returns VectorD) | (close VectorD, timePeriod VectorD) Linear Regression Intercept
LinearReg_Slope (returns VectorD) | (timePeriod VectorD) Linear Regression Slope
LinearReg_Slope (returns VectorD) | (close VectorD, timePeriod VectorD) Linear Regression Slope
Ma (returns VectorD) | (timePeriod VectorD, System.Collections.Generic.List`1[System.String] String) Moving Average
Ma (returns VectorD) | (close VectorD, timePeriod VectorD, System.Collections.Generic.List`1[System.String] String) All Moving Average
Macd (returns VectorD) | (parameterless) Moving Average Convergence/Divergence
Macd (returns VectorD) | (close VectorD) Moving Average Convergence/Divergence
MacdExt (returns VectorD) | (fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD with controllable MA type
MacdExt (returns VectorD) | (close VectorD, fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD with controllable MA type
MacdExtHist (returns VectorD) | (fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String, signalPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD Historigramme with controllable MA type
MacdExtHist (returns VectorD) | (close VectorD, fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String, signalPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD Historigramme with controllable MA type
MacdExtSignal (returns VectorD) | (fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String, signalPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD Signal with controllable MA type
MacdExtSignal (returns VectorD) | (close VectorD, fastPeriod VectorD, System.Collections.Generic.List`1[System.String] String, slowPeriod VectorD, System.Collections.Generic.List`1[System.String] String, signalPeriod VectorD, System.Collections.Generic.List`1[System.String] String) MACD Signal with controllable MA type
MacdHist (returns VectorD) | (signalPeriod VectorD) MACD Historigramme
MacdHist (returns VectorD) | (close VectorD, signalPeriod VectorD) MACD Historigramme
MacdSignal (returns VectorD) | (signalPeriod VectorD) MACD Signal
MacdSignal (returns VectorD) | (close VectorD, signalPeriod VectorD) MACD Signal
Mama (returns VectorD) | (fastLimit VectorD, slowLimit VectorD) MESA Adaptive Moving Average
Mama (returns VectorD) | (array VectorD, fastLimit VectorD, slowLimit VectorD) MESA Adaptive Moving Average
Hhv (returns VectorD) | (timePeriod VectorD) Highest value over a specified period
Hhv (returns VectorD) | (close VectorD, timePeriod VectorD) Highest value over a specified period
MedPrice (returns VectorD) | (parameterless) Median Price
MedPrice (returns VectorD) | (high VectorD, low VectorD) Median Price
Mfi (returns VectorD) | (timePeriod VectorD) Money Flow Index
Mfi (returns VectorD) | (high VectorD, low VectorD, close VectorD, volume VectorD, timePeriod VectorD) Money Flow Index
MidPoint (returns VectorD) | (timePeriod VectorD) MidPoint over period
FFT (returns VectorCustom) | (parameterless) Performs Fast Fourier Transform
Date (returns VectorS) | (parameterless) Returns the bar's Date
Now (returns VectorS) | (parameterless) Returns the current Date
StringExtract (returns VectorS) | (string VectorS, value VectorD, value1 VectorD) Extract a string from the string in the first parameter, starting at the specified number in the second parameter and ending at the specified number in the third parameter
StringExtractStart (returns VectorS) | (string VectorS, value VectorD) Extract a string from the string in the first parameter, starting at 0 and ending at the specified number in the second parameter
StringExtractEnds (returns VectorS) | (string VectorS, value VectorD) Extract a string from the string in the first parameter, starting from (Length of the first parameter string - number in the second parameter) and ending at the length of the first parameter string
StringReplace (returns VectorS) | (string VectorS, oldValue VectorS, newValue VectorS) Replace in the first parameter string, oldValue with newValue
StringInsert (returns VectorS) | (string VectorS, ToInsert VectorS, index VectorD) Insert in the first parameter the second parameter string at the specified index number
IffStr (returns VectorS) | ( VectorD, VectorS, VectorS) A conditional function that returns the value of the first string parameter if condition is true (different from 0), if condition is false then it returns the value of the second string parameter.
Market (returns VectorS) | (parameterless) Returns the symbol's Market
Industry (returns VectorS) | (parameterless) Returns the symbol's Industry
Sector (returns VectorS) | (parameterless) Returns the symbol's Sector
Group (returns VectorS) | (parameterless) Returns the symbol's Group
Index (returns VectorS) | (parameterless) Returns the symbol's Index
Name (returns VectorS) | (parameterless) Returns the symbol's Name
FullName (returns VectorS) | (parameterless) Returns the symbol's FullName
Website (returns VectorS) | (parameterless) Returns the symbol's Website
Address (returns VectorS) | (parameterless) Returns the symbol's Address
Country (returns VectorS) | (parameterless) Returns the symbol's Country
Currency (returns VectorS) | (parameterless) Returns the symbol's Currency
Name1 (returns VectorS) | (parameterless) Returns the symbol's Name1
Name2 (returns VectorS) | (parameterless) Returns the symbol's Name2
Name3 (returns VectorS) | (parameterless) Returns the symbol's Name3
States (returns VectorD) | (array VectorD, states (ex : 70|50|30) String) Returns an array containing different states.|Example: States(perf(close, 20), 10|0|-10) | Returns 0 if the array element value is lower then -10, returns 1 if the array element value is between -10 and 0 and returns 2 if the array element value is higher than 10
GapDown (returns VectorD) | (parameterless) Returns 1, when a down gap happen
GapUp (returns VectorD) | (parameterless) Returns 1, when an up gap happen
Inside (returns VectorD) | (parameterless) Returns 1, when an inside day occurs
Outside (returns VectorD) | (parameterless) Returns 1, when an outside day occurs
HhvLb (returns VectorD) | (array VectorD) Returns the number of bars since the array reached its highest value
HhvLb (returns VectorD) | (array VectorD, period VectorD) Returns the number of bars since the array reached its highest value over the specified period
LlvLb (returns VectorD) | (array VectorD) Returns the number of bars since the array reached its lowest value
LlvLb (returns VectorD) | (array VectorD, period VectorD) Returns the number of bars since the array reached its lowest value over the specified period
ZigZag (returns VectorD) | (array VectorD, change VectorD) Calculates the Zig Zag indicator given the percent change
Peak (returns VectorD) | (array VectorD, change VectorD) Returns the value of the array in the last peak
Peak (returns VectorD) | (array VectorD, change VectorD, N VectorD) Returns the value of the array N peak(s) ago
Trough (returns VectorD) | (array VectorD, change VectorD) Returns the value of the array in the last trough
Trough (returns VectorD) | (array VectorD, change VectorD, N VectorD) Returns the value of the array N trough(s) ago
PeakBars (returns VectorD) | (array VectorD, change VectorD) Returns the number of bars since the last peak
PeakBars (returns VectorD) | (array VectorD, change VectorD, N VectorD) Returns the number of bars since N peak(s) ago
TroughBars (returns VectorD) | (array VectorD, change VectorD) Returns the number of bars since the last trough
TroughBars (returns VectorD) | (array VectorD, change VectorD, N VectorD) Returns the number of bars since N trough(s) ago
BarsSince (returns VectorD) | (array VectorD) Calculates the number of bars that have passed since the array was different from 0
Cross (returns VectorD) | ( VectorD, VectorD) Returns '1', when the first array crosses above the second array, otherwise the result is '0'
RemoveSameSignals (returns VectorD) | (array VectorD, array VectorD) Removes excessive signals.|Returns 1 on the first occurence of 'true' signal in the first array.|then Returns 0 until the second array is 'true' even if there are 'true' signals in the first array.
RemoveSameSignals (returns VectorD) | (array VectorD) Removes excessive signals.|Returns 1 on the first occurence of 'true' signal in the first array.|then Returns 0 until the array become 'false' then 'true'.
ValueWhen (returns VectorD) | (expression VectorD, array VectorD, period VectorD) Returns the value of the array, when the expression is TRUE, of the n -th most recent occurrence
ValueWhen (returns VectorD) | (expression VectorD, array VectorD) Returns the value of the array, when the expression is TRUE, of the last occurrence
Perf (returns VectorD) | (array VectorD, period VectorD) Returns the performance of the array for the specified period (k-step Return)
PerfD (returns VectorD) | (array VectorD, period VectorD) Returns the average daily performance of the array for the specified period (k-step Trend)
GFun (returns VectorD) | (array VectorD, period VectorD) Returns the gaussian for the specified array
RFun (returns VectorD) | (array VectorD, period VectorD) Returns the relative volatility of the specified array
Random (returns VectorD) | (min VectorD, max VectorD) Returns a random number between min and max
Sharpe (returns VectorD) | (array VectorD, period VectorD) Returns the sharpe ratio for the specified array and period
Iff (returns VectorD) | ( VectorD, VectorD, VectorD) A conditional function that returns the value of the first parameter if condition is true (different from 0), if condition is false then it returns the value of the second parameter.
SumIf (returns VectorD) | (condition VectorD, array VectorD) Calculates, when condition is TRUE, a cumulative sum of the ARRAY for all the lookback periods (current bar is included)
SumIf (returns VectorD) | (condition VectorD, array VectorD, period VectorD) Calculates, when condition is TRUE, a cumulative sum of the ARRAY for the specified number of lookback periods (current bar is included)
Avg (returns VectorD) | (array VectorD) Calculates the average of the ARRAY for all the lookback periods (current bar is included)
Avg (returns VectorD) | (array VectorD, period VectorD) Calculates the average of the ARRAY for the specified number of lookback periods (current bar is included)
AvgIf (returns VectorD) | ( condition VectorD, array VectorD) Calculates, when condition is TRUE, the average of the ARRAY for all the lookback periods (current bar is included)
AvgIf (returns VectorD) | ( condition VectorD, array VectorD, period VectorD) Calculates, when condition is TRUE, the average of the ARRAY for the specified number of lookback periods (current bar is included) (When the condition is true)
Sum (returns VectorD) | (array VectorD) Calculates a cumulative sum of the ARRAY for all the lookback periods (current bar is included)
Sum (returns VectorD) | (array VectorD, period VectorD) Calculates a cumulative sum of the ARRAY for the specified number of lookback periods (current bar is included)
Min (returns VectorD) | (array VectorD, array VectorD) For each bar of the ARRAY, returns the smallest one
Max (returns VectorD) | (array VectorD, array VectorD) For each bar of the ARRAY, returns the largest one
LastValue (returns VectorD) | (array VectorD) Returns the last value of the ARRAY
LastNotNullValue (returns VectorD) | (array VectorD) Returns the last (not equal to 0) value of the ARRAY
Ref (returns VectorD) | (array VectorD, period VectorD) References a previous or subsequent element in a ARRAY. A negative period references X periods in the future; a positive period references X periods ago (Replace empty values in the ARRAY with NA)
RefZero (returns VectorD) | (array VectorD, period VectorD) References a previous or subsequent element in a ARRAY. A negative period references X periods in the future; a positive period references X periods ago (Replace empty values in the ARRAY with 0)
Value (returns VectorD) | (array VectorD, bar number VectorD) Returns the value of the specified ARRAY for the bar number X
StringContains (returns VectorD) | (string VectorS, string VectorS) Returns 1 if the first string parameter contains the second string parameter, 0 otherwise
StringLength (returns VectorD) | (string VectorS) Returns the length of the string
StringEqual (returns VectorD) | (string VectorS, string VectorS) Returns 1 if the two strings are equal, 0 otherwise
Ad (returns VectorD) | (parameterless) Chaikin A/D Line
Ad (returns VectorD) | (high VectorD, low VectorD, close VectorD, volume VectorD) Chaikin A/D Line
AdOsc (returns VectorD) | (fastPeriod VectorD, slowPeriod VectorD) Chaikin A/D Oscillator
AdOsc (returns VectorD) | (high VectorD, low VectorD, close VectorD, volume VectorD, fastPeriod VectorD, slowPeriod VectorD) Chaikin A/D Oscillator
Adx (returns VectorD) | (timePeriod VectorD) Average Directional Movement Index
Adx (returns VectorD) | (high VectorD, low VectorD, close VectorD, timePeriod VectorD) Average Directional Movement Index


VectorCustom

QuantShare API Documentation

VectorCustom Members

Parent

Properties

[Int32] (of type CustomDatabaseValues) | Get the elements at the specified bar index
Length (of type Int32) | Get the vector length

Methods

GetValues (returns CustomDatabaseValues) (index Int32)

Get the elements at the specified bar index


VectorCustomDouble

QuantShare API Documentation

VectorCustomDouble Members

Parent

Properties

[Int32] (of type CustomDatabaseValuesDouble) | Get the elements at the specified bar index
Length (of type Int32) | Get the vector length

Methods

GetValues (returns CustomDatabaseValuesDouble) | (index Int32) Get the elements at the specified bar index
ToVectorD (returns VectorD) | (parameterless) Convert this object to a VectorD object


VectorD

QuantShare API Documentation

VectorD Members

Parent

Properties

Length (of type Int32) | Get the vector length
BackwardBars (of type Int32) | Get the number of previous bars required to calculate the value of a particular bar
ForwardBars (of type Int32) | Get the number of future bars required to calculate the value of a particular bar

Methods

GetValue (returns Double) | (index Int32) Get an element value from the vector
SetValue (returns Void) | (index Int32, value Double) Assign a value to an element of the vector
Assign (returns Void) | (value Double) Assign a value to all the elements of the vector
Assign (returns Void) | (value VectorD) Assign a vector to the current vector
StoreData (returns Void) | (name String, value Object) Store a value
RetrieveData (returns Object) | (name String) Retrieve a value stored using the 'StoreData' function


VectorDate

QuantShare API Documentation

VectorDate Members

Parent

Properties

Length (of type Int32) Get the vector length

Methods

SetValue (returns Void) | (index Int32, value DateTime) Assign a value to an element of the vector
GetValue (returns DateTime) | (index Int32) Get an element value from the vector


VectorR

QuantShare API Documentation

VectorR Members

Parent

Properties

[Int32] (of type Object) | Get an element value from the vector
Length (of type Int32) | Get the vector length

Methods

GetValue (returns Object) | (index Int32) Get an element value from the vector
GetDate (returns DateTime) | (index Int32) Get a date from the vector


VectorS

QuantShare API Documentation

VectorS Members

Parent

Properties

Length (of type Int32) Get the vector length

Methods

SetValue (returns Void) | (index Int32, value String) Assign a value to an element of the vector
GetValue (returns String) | (index Int32) Get an element value from the vector
Assign (returns Void) | (value String) Assign a value to all the elements of the vector
Assign (returns Void) | (value VectorS) Assign a vector to the current vector


Parser Post-Script

QuantShare API Documentation

Parser Post-Script Members

Script that is executed after parsing the downloaded data.

Fields

Data (of type PostScript) Contains the data that was parsed


PostScript

QuantShare API Documentation

PostScript Members

Contains the data that was parsed

Parent

Properties

Rows (of type PostScriptRow[]) | Get the content rows
SymbolInfo (of type Symbol) | Symbol information


PostScriptRow

QuantShare API Documentation

PostScriptRow Members

Parent

Properties

IsIgnoreLine (of type Boolean) | Specify whether to ignore the current row or not
Data (of type Object[]) | Get the elements of the current row


Parser Pre-Script

QuantShare API Documentation

Parser Pre-Script Members

Script that is executed before parsing the downloaded data.

Fields

Content (of type PreScript) Contains the content to parse


PreScript

QuantShare API Documentation

PreScript Members

Contains the content to parse

Parent

Properties

Rows (of type PreScriptRow[]) Get the content rows

Methods

GetURLORFileName (returns String) | (parameterless) Get the URL or the file path that was used to get the current content
GetSymbolNameFromNameX (returns String) | (0 for name1... Int32, symbol nameX String) Get symbol name from name1, name2 or name3
GetDatabaseName (returns String) | (index Int32) Get the database name for the specified column index
GetFieldName (returns String) | (index Int32) Get the field name for the specified column index
SetDatabaseAndField (returns Boolean) | (index Int32, database name String, field name String, database descriptive name String, field descriptive name String, default value String, Is historical database Boolean, Is numeric field Boolean, Is get snapshot Boolean) Updates the Database and field names for the specified column index
GetNumericValue (returns Double) | (Database name String, Field name String, Symbol String, Date DateTime) Returns the last value from a database/field for the specified symbol and the specified date (Value should occur before the specified date)
AddRow (returns Void) | (Elements to add String[]) Add a new row
GetContent (returns String) | (parameterless) Get the downloaded content
GetContentLines (returns String[]) | (parameterless) Get the downloaded content


PreScriptRow

QuantShare API Documentation

PreScriptRow Members

Parent

Properties

IsIgnoreLine (of type Boolean) | Specify whether to ignore the current line or not
Data (of type String[]) | Get the elements of the current line


Prediction Model Metrics

QuantShare API Documentation

Prediction Model Metrics Members

Fields

Cycle (of type Int32) | The current cycle number
NetworkError (of type Double) | The network error
StrategyMetric (of type Double) | The strategy metric (The default metric is the Output Per Bar)
LearningErrors (of type PredictionErrors) | Metrics for the learning samples
ValidationErrors (of type PredictionErrors) | Metrics for the validation samples
TestErrors (of type PredictionErrors) | Metrics for the test samples
OptimizerMetrics (of type OptimizerMetricsClass) | Optimizer Metrics - Should be used only when working with the AI Optimizer
Fitness (of type Double) | The fitness value


OptimizerMetricsClass

QuantShare API Documentation

OptimizerMetricsClass Members

Optimizer Metrics - Should be used only when working with the AI Optimizer

Parent

Properties

Generation (of type Double) | Current generation number
AvgFitness (of type Double) | Average fitness for the current generation
HighestFitness (of type Double) | Highest fitness for the current generation
LowestFitness (of type Double) | Lowest fitness for the current generation


PredictionErrors

QuantShare API Documentation

PredictionErrors Members

Metrics for the test samples

Parent

Properties

MSE (of type Double) | Mean squared error
POCD (of type Double) | Prediction of correct direction
POCID (of type Double) | Prediction of change in direction
UTHEIL (of type Double) | Theil's U statistic assesses predictive accuracy relative to a naive no-change model. It is unitary when the MSFE (mean absolute forecast error) equals the mean square error of naive no-change forecasts, and it is greater than 1.0 if predictions are less accurate than no-change forecasts.


Simulation Metrics

QuantShare API Documentation

Simulation Metrics Members

Fields

InitialCapital (of type Double) | Initial Capital
EndCapital (of type Double) | End Capital
NetProfit (of type Double) | Net Profit
NetProfitInPercentage (of type Double) | Net Profit In Percentage
Exposure (of type Double) | Exposure
NetRiskAdjustedReturn (of type Double) | Net Risk Adjusted Return
AnnualReturn (of type Double) | Annual Return
RiskAdjustedReturn (of type Double) | Risk Adjusted Return
AverageProfitLoss (of type Double) | Average ProfitLoss
AverageProfitLossInPercentage (of type Double) | Average ProfitLoss In Percentage
AverageBarsHeld (of type Double) | Average Bars Held
TotalProfit (of type Double) | Total Profit
NumberOfWinners (of type Double) | Number Of Winners
AverageProfit (of type Double) | Average Profit
AverageProfitInPercentage (of type Double) | Average Profit In Percentage
AverageBarsHeldForWinners (of type Double) | Average Bars Held For Winners
MaxConsecutiveWinner (of type Double) | Max Consecutive Winner
LargestWinner (of type Double) | Largest Winner
NumberOfBarsInLargestWinner (of type Double) | Number Of Bars In Largest Winner
TotalLoss (of type Double) | Total Loss
NumberOfLosers (of type Double) | Number Of Losers
AverageLoss (of type Double) | Average Loss
AverageLossInPercentage (of type Double) | Average Loss In Percentage
AverageBarsHeldForLosers (of type Double) | Average Bars Held For Losers
MaxConsecutiveLoser (of type Double) | Max Consecutive Loser
LargestLoser (of type Double) | Largest Loser
NumberOfBarsInLargestLoser (of type Double) | Number Of Bars In Largest Loser
MaximumTradeDrawdown (of type Double) | Maximum Trade Drawdown
MaximumTradeDrawdownInpercentage (of type Double) | Maximum Trade Drawdown In percentage
MaximumSystemDrawdown (of type Double) | Maximum System Drawdown
MaximumSystemDrawdownInpercentage (of type Double) | Maximum System Drawdown In percentage
RecoveryFactor (of type Double) | Recovery Factor
CarMaxDD (of type Double) | Car MaxDD
RarMaxDD (of type Double) | Rar MaxDD
NumberOfTrades (of type Double) | Number Of Trades
PercentOfWinners (of type Double) | Percent Of Winners
AnnualTurnover (of type Double) | Annual Turnover
TotalTradingCosts (of type Double) | Total Trading Costs
VolumeActivity (of type Double) | Volume Activity
PercentTradingCostOfVolume (of type Double) | Percent Trading Cost Of Volume
PercentPositiveDays (of type Double) | Percent Positive Days
PercentPositiveWeeks (of type Double) | Percent Positive Weeks
PercentPositiveMonths (of type Double) | Percent Positive Months
PercentPositiveYears (of type Double) | Percent Positive Years
AverageDailyReturn (of type Double) | Average Daily Return
AverageWeeklyReturn (of type Double) | Average Weekly Return
AverageMonthlyReturn (of type Double) | Average Monthly Return
UlcerIndex (of type Double) | Ulcer Index
UlcerPerformanceIndex (of type Double) | Ulcer Performance Index
KRatio (of type Double) | K Ratio
StandardDeviation (of type Double) | Standard Deviation
DownsideStandardDeviation (of type Double) | Downside Standard Deviation
SharpeRatio (of type Double) | Sharpe Ratio
SortinoRatio (of type Double) | Sortino Ratio
ProfitFactor (of type Double) | Profit Factor
PayoffRatio (of type Double) | Payoff Ratio
Beta (of type Double) | Beta
Alpha (of type Double) | Alpha
RSquared (of type Double) | R Squared
Correlation (of type Double) | Correlation
Fitness (of type Double) | Fitness value
DailyReturn (of type SeriesStats) | Return per Day
WeeklyReturn (of type SeriesStats) | Return per Week
MonthlyReturn (of type SeriesStats) | Return per Month
YearlyReturn (of type SeriesStats) | Return per Year
OptimizerMetrics (of type OptimizerMetricsClass) | Optimizer Metrics - Should be used only when working with the AI Optimizer


SeriesStats

QuantShare API Documentation

SeriesStats Members

Return per Year

Parent

Properties

Count (of type Int32) | Total number of values
[Int32] (of type Double) | Get a value at the specified index

Methods

GetDate (returns DateTime) (index Int32)

Get the date at the specified index


Perdiction Model Metrics

QuantShare API Documentation

Perdiction Model Metrics Members

Fields

Cycle (of type Int32) | The current cycle number
NetworkError (of type Double) | The network error
StrategyMetric (of type Double) | The strategy metric (The default metric is the Output Per Bar)
LearningErrors (of type PredictionErrors) | Metrics for the learning samples
ValidationErrors (of type PredictionErrors) | Metrics for the validation samples
TestErrors (of type PredictionErrors) | Metrics for the test samples
Fitness (of type Double) | The fitness value


Function - PLOT

PLOT
 Plot

Charting

SYNTAX | Plot( ARRAY array, ARRAY description, ENUM color, ENUM chart type, ENUM style)
RETURNS |
DESCRIPTION | Plot a time-series
ADDITIONAL INFO |
EXAMPLE | Plot(rsi(14), "RSI", colorBlack, chartLine, styleOwnScale)


Function - ADDCOLUMN

ADDCOLUMN
 Add column

Columns

SYNTAX | AddColumn( ARRAY column name, ARRAY variable)
RETURNS |
DESCRIPTION | Create a numeric column for the screener or the watch-list
ADDITIONAL INFO |
EXAMPLE | AddColumn("Column1", rsi(14))


Function - ADDCOLUMN

ADDCOLUMN
 Add column

Columns

SYNTAX | AddColumn( ARRAY column name, ARRAY variable)
RETURNS |
DESCRIPTION | Create a text column for the screener or the watch-list
ADDITIONAL INFO |
EXAMPLE | AddColumn("Column1", Market())


Function - BBANDSLOWER

BBANDSLOWER
 Bollinger Bands (Lower band)

Indicators

SYNTAX | Bbandslower( ARRAY close, ARRAY timeperiod, ARRAY nbdevdown, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Lower band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | Bbandslower(close, 15, 2, _MaSma)


Function - BBANDSLOWER

BBANDSLOWER
 Bollinger Bands (Lower band)

Indicators

SYNTAX | Bbandslower( ARRAY timeperiod, ARRAY nbdevdown, ENUM movingaveragetype)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Bollinger Bands (Lower band)
ADDITIONAL INFO | Bollinger Bands are plotted at 2 standard deviations above and below a 20-day exponential moving average. As standard deviation is a measure of volatility, the bands are self-adjusting: widening during volatile markets and contracting during calmer periods. The price are considered "overbought" when they touch the upper band and "oversold" when they touch the lower band. Statisticly 95% of price data should fall between the two tranding bands. A way to use Bollinger Bands is to use the upper and lower bands as price targets. If prices bounce off the lower band and cross above the 20 day average, then the upper band becomes the upper price target. Bollinger Bands was created by John Bollinger.
EXAMPLE | Bbandslower(14, 2, _MaSma)


Function - SAR

SAR
 Parabolic SAR

Indicators

SYNTAX | Sar( ARRAY high, ARRAY low, ARRAY acceleration, ARRAY maximum)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | Sar(high, low, 0, 0.2)


Function - SAR

SAR
 Parabolic SAR

Indicators

SYNTAX | Sar( ARRAY acceleration, ARRAY maximum)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | Sar(0, 0.2)


Function - SAREXT

SAREXT
 Parabolic SAR - Extended

Indicators

SYNTAX | SarExt( ARRAY high, ARRAY low, ARRAY startvalue, ARRAY offsetonreverse, ARRAY accelerationinitlong, ARRAY accelerationlong, ARRAY accelerationmaxlong, ARRAY accelerationinitshort, ARRAY accelerationshort, ARRAY accelerationmaxshort)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR - Extended
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | SarExt(high, low, 0.02, 0, 0, 0, 0, 0, 0, 0)


Function - SAREXT

SAREXT
 Parabolic SAR - Extended

Indicators

SYNTAX | SarExt( ARRAY startvalue, ARRAY offsetonreverse, ARRAY accelerationinitlong, ARRAY accelerationlong, ARRAY accelerationmaxlong, ARRAY accelerationinitshort, ARRAY accelerationshort, ARRAY accelerationmaxshort)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Parabolic SAR - Extended
ADDITIONAL INFO | The Parabolic SAR sets trailing price stops for long or short positions Parabolic SAR was described by Welles Wilder in his 1978 book, "New Concepts in Technical Trading Systems".
EXAMPLE | SarExt(0.02, 0, 0, 0, 0, 0, 0, 0)


Function - ABS

ABS
 Abs

Math

SYNTAX | Abs( ARRAY value)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Calculate the absolute value of each element in the array
ADDITIONAL INFO |
EXAMPLE | Abs(-1)


Function - GETPRECALCULATEDVALUE

GETPRECALCULATEDVALUE
 PreCalculated Value

Pre-calculated-value

SYNTAX | GetPreCalculatedValue( STRING field, ARRAY ticker name)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValue("'last day volume'", "A")


Function - BUYPRICE

BUYPRICE
 Set the buy price

Simulator

SYNTAX | BuyPrice( ARRAY price, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the buy price. This limit order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | BuyPrice(22, close * 1.01)


Function - COVERPRICE

COVERPRICE
 Set the cover price

Simulator

SYNTAX | CoverPrice( ARRAY price, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the cover price. This limit order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | CoverPrice(close * 1.01, 5)


Function - SELLPRICE

SELLPRICE
 Set the sell price

Simulator

SYNTAX | SellPrice( ARRAY price, ARRAY exit at market after (bars))
RETURNS |
DESCRIPTION | Set the sell price. This limit order is valid for the specified number of bars, after this period the order is canceled and an order at the market is initiated.
ADDITIONAL INFO |
EXAMPLE | SellPrice(close * 1.01, 5)


Function - SHORTPRICE

SHORTPRICE
 Set the short price

Simulator

SYNTAX | ShortPrice( ARRAY price, ARRAY valid for (bars))
RETURNS |
DESCRIPTION | Set the short price. This limit order is valid for the specified number of bars, after this period the order is canceled.
ADDITIONAL INFO |
EXAMPLE | ShortPrice(22, close * 1.01)


Function - GETPRECALCULATEDVALUESTRING

GETPRECALCULATEDVALUESTRING
 PreCalculated String

Symbol Info

SYNTAX | GetPreCalculatedValueString( STRING field)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValueString("date of last quote")


Function - GETPRECALCULATEDVALUESTRING

GETPRECALCULATEDVALUESTRING
 PreCalculated String

Symbol Info

SYNTAX | GetPreCalculatedValueString( STRING field, ARRAY ticker name)
RETURNS | TEXT ARRAY
DESCRIPTION | Get a pre-calculated value
ADDITIONAL INFO |
EXAMPLE | GetPreCalculatedValueString("date of last quote", "A")


Function - ISNA

ISNA
 Is NA

Technical

SYNTAX | IsNa( ARRAY value)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 1 if all elements in the array equal to NA
ADDITIONAL INFO |
EXAMPLE | IsNa(1)


Function - ISNONA

ISNONA
 Is not NA

Technical

SYNTAX | IsNoNa( ARRAY value)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 0 if at least one elements in the array is equal to NA
ADDITIONAL INFO |
EXAMPLE | IsNoNa(1)


Function - ISNONULL

ISNONULL
 Is not NULL

Technical

SYNTAX | IsNoNull( ARRAY value)
RETURNS | NUMERIC ARRAY
DESCRIPTION | Returns 0 if at least one elements in the array is equal to 0
ADDITIONAL INFO |
EXAMPLE | IsNoNull(1)