Using Studies (PowerLanguage Editor)

From MultiCharts
Jump to: navigation, search

Custom studies can be created from scratch or existing studies modified by using the PowerLanguage Editor.

Studies can be classified into three types: Indicators, Signals, and Functions.

An Indicator is a visual technical analysis tool, used to analyze market conditions and identify and forecast trends and market patterns. An indicator is a visualization of a mathematical formula, and consists of one or more Plots – lines, histograms, series of points or crosses, highs and lows, left and right ticks, or a combination of the above.

A Signal is a mechanical technical analysis tool, used to systematically specify market entry or exit points according to a set of trading rules implemented in the signal's algorithm. The trade points are indicated on a chart by ticks and arrows. Signals can be viewed as the basic building blocks of strategies.

A Function is an independent procedure (subroutine) that can be called from another script to carry out a specific task.


Creating Indicators

To create an indicator:

  1. Open New dialog box by clicking the New PL New.png icon on the toolbar, by selecting File in the main menu and clicking New, or by using the Ctrl+N keyboard shortcut.
  2. Select Indicator.
  3. Enter the indicator name.
  4. Click OK.


Creating Signals

To create a signal:

  1. Open New dialog box by clicking the New PL New.png icon on the toolbar, by selecting File in the main menu and clicking New, or by using the Ctrl+N keyboard shortcut.
  2. Select Signal.
  3. Enter the signal name.
  4. Click OK.


Creating Functions

To create a function:

  1. Open New dialog box by clicking the New PL New.png icon on the toolbar, by selecting File in the main menu and clicking New, or by using the Ctrl+N keyboard shortcut.
  2. Select Function.
  3. Enter the function name.
  4. Select the Return Type.
  5. Select the Function Storage.
  6. Click OK.


Available Studies List

A list of all available studies can be viewed in the Open window. Studies' Name, Type, Status, and the last modification date (Modified) are displayed in the list.

Studies can be edited, deleted and the studies' properties can be modified from the Open window.

To open the Open window:

  1. Click the Open Portfolio LOAD.png icon on the toolbar.
  2. The Open window can also be opened by selecting File in the main menu and clicking Open, or by using the Ctrl+O keyboard shortcut.



Study List

The list of available studies, displayed in the Open window, can be set to include one or more of the following study types: Indicators, Signals, and Functions. To select the study types to be listed, select or clear the appropriate checkboxes in the Study Type section.

In the list, each study's name, type, status, and last modification date and time are displayed in the Name, Type, Status, and Modified columns. The list can be sorted by any column, in ascending or descending order, by clicking on the column header:

  • Name column displays the study's name.
  • Type column displays the study's type: Indicator, Signal, or Function.
  • Status column displays the study's status:
    • Compiled PL Comp.png - the study is ready to be used; to learn more, see Compiling Studies
    • Protected PL Locked.png - the study cannot be opened for editing, and the study’s code cannot be viewed; to learn more, see Protecting Studies
    • No status is displayed – the study has to be compiled before it can be used; to learn more, see Compiling Studies
  • Modified column displays the date and time that the most recent study modification has been made.

To scroll through the list of studies, use the scrollbar on the right side of the list, or the UP ARROW and DOWN ARROW keys on the keyboard.


Opening Studies

To open a study:

  1. Open the Open window.
    To open the Open window:
    1. Click the Open Portfolio LOAD.png icon on the toolbar.
    2. The Open window can also be opened by selecting File in the main menu and clicking Open, or by using the Ctrl+O keyboard shortcut.
  2. In the Study Type section, select or clear Indicator, Signal, and/or Function checkboxes to specify the types of studies to be included in the list.
  3. Select one or more studies to be opened; several studies can be selected at once by holding down Ctrl or/and Shift keys while making the selection. All studies can be selected by using the Ctrl+A keyboard shortcut, or by clicking any study’s name and then clicking Select All.
  4. Click OK or double-click the selected study.


Saving Studies

To save a study in PowerLanguage Editor, click the Save Portfolio Save.png icon on the toolbar. A study can also be saved by selecting File in the main menu and clicking Save, or by using the Ctrl+S keyboard shortcut.

All studies currently opened in PowerLanguage editor can be saved by selecting File in the main menu and clicking Save All, or by using the Ctrl+Shift+S keyboard shortcut.

Note: If no modifications have been made to studies, the Save icon on the toolbar and Save commands will not be available.


Renaming Studies

A study can be renamed by one of the following methods:

  • Click the Properties PL Properties.png icon on the toolbar; in the Properties tab of the Properties dialog box that appears, in the Name box, enter the new study name and click OK.
  • Right-click within the study’s window and then click Properties; in the Properties tab of the Properties dialog box that appears, in the Name box, enter the new study name and click OK.
  • Select File in the main menu and click Save As; in the dialog box that appears, enter the new study name and click OK.



A study can also be renamed from the Open window. To rename a study from the Open window:

  1. Open the Open window.
    To open the Open window:
    1. Click the Open Portfolio LOAD.png icon on the toolbar.
    2. The Open window can also be opened by selecting File in the main menu and clicking Open, or by using the Ctrl+O keyboard shortcut.
  2. In the Study Type section, select or clear Indicator, Signal, and/or Function checkboxes to specify the types of studies to be included in the list.
  3. Right-click the study to be renamed, and then click Edit.
  4. In the Properties tab of the Properties dialog box that appears, in the Name box, enter the new study name and click OK.


Closing Studies

A study can be closed by one of the following methods:

  • Click the Close icon on the study's title bar.
  • Right-click on the study's window tab, and then click Close.
  • Select File in the main menu and click Close.
  • Use the Alt+F4 keyboard shortcut.


Deleting Studies

To delete a study:

  1. Open the Open window.
    To open the Open window:
    1. Click the Open Portfolio LOAD.png icon on the toolbar.
    2. The Open window can also be opened by selecting File in the main menu and clicking Open, or by using the Ctrl+O keyboard shortcut.
  2. In the Study Type section, select or clear Indicator, Signal, and/or Function checkboxes to specify the types of studies to be included in the list.
  3. Select one or more studies to be deleted; several studies can be selected at once by holding down Ctrl or/and Shift keys while making the selection. All studies can be selected by using the Ctrl+A keyboard shortcut, or by clicking any study’s name and then clicking Select All.
  4. Press the Delete key on the keyboard, or right-click the study to be deleted, and then click Delete.


Editing Study Properties

Study properties can be edited from the Properties window.

Properties window can be opened by one of the following methods:

  • Click the Properties PL Properties.png icon on the toolbar.
  • Right-click within the study’s window and then click Properties.



Properties window can be opened from the Open window. To open the Properties window from the Open window:

  1. Open the Open window.
    To open the Open window:
    1. Click the Open Portfolio LOAD.png icon on the toolbar.
    2. The Open window can also be opened by selecting File in the main menu and clicking Open, or by using the Ctrl+O keyboard shortcut.
  2. In the Study Type section, select or clear Indicator, Signal, and/or Function checkboxes to specify the types of studies to be included in the list.
  3. Right-click the study, the properties of which are to be edited, and then click Edit.

To learn more about studies properties, see Default Properties