Changes

Jump to navigation Jump to search

Editing Study Scripts

22 bytes added, 14:19, 23 March 2022
Studies are PowerLanguage scripts, expressing trading rules in a systematic and logical way that can be executed by a computer. Scripts consist of at least one, but usually more, statements. Each statement is a complete instruction.
To learn more, see [[<span style="color: red;">'''LINK'''</span>/04_PL/41-0006_Elements.html name=""; Language_Elements|PowerLanguage Elements]]
PowerLanguage scripts can be easily created and edited by using the PowerLanguage Editor. PowerLanguage Editor includes many advanced text editing features, built-in PowerLanguage keyword reference, and a keyword hint feature.
Before a study can be applied to a chart, the study's script must be [[<span style="color: red;">'''LINK'''</span>/03_PLE/31-0103_WorkingStudies.html name="4"; Editing_Study_Scripts#Compiling Scripts|compiled]].
The code is compiled directly in the PowerLanguage editor.
The script of a study can be [[<span style="color: red;">'''LINK'''</span>/03_PLE/31-0103_WorkingStudies.html name="5"; Editing_Study_Scripts#Protecting Studies|password protected]]; script of a protected study can not be viewed without the password.
<br>
<br>Changes can be undone by one of the following methods:
* Clicking the '''Undo''' http[[File://wwwPL_UNDO.multicharts.com/img/wiki/toolbar/PLE/05_Undo.gif png]] icon on the toolbar; or:
* Using the Ctrl+Z keyboard shortcut, or:
* Selecting '''Edit''' in the main menu, and clicking '''Undo'''.
<br>Changes can be redone by one of the following methods:
* Clicking the '''Redo''' http[[File://wwwPL_REDO.multicharts.com/img/wiki/toolbar/PLE/06_Redo.gif png]] icon on the toolbar; or:
* Using the Ctrl+Y keyboard shortcut, or:
* Selecting '''Edit''' in the main menu, and clicking '''Redo'''.
To find text:
# Open the '''Find''' window by clicking the '''Find''' http[[File://wwwPL_FIND.multicharts.com/img/wiki/toolbar/PLE/07_Find.gif png]] icon on the toolbar, by using the Ctrl+F keyboard shortcut, or by selecting '''Edit''' on the main menu and clicking '''Find'''.
# Enter the text to be found into the '''Find what''' box.
# Select the '''Match whole word only''' check box to find whole words only.
To replace text:
# Open the '''Replace''' window by clicking the '''Replace''' http[[File://wwwPL_REPLACE.multicharts.com/img/wiki/toolbar/PLE/08_Replace.gif png]] icon on the toolbar, by using the Ctrl+H keyboard shortcut, or by selecting '''Edit''' on the main menu and clicking '''Replace'''.
# Enter the text to be found and replaced into the '''Find what''' box.
# Enter the replacement text into the '''Replace with''' box.
Before a study can be applied to a chart, the study's script must be compiled. In process of compilation, the correctness of code in the script is verified. If any errors are found, the compilation process stops, and the error is highlighted. The results of the compilation, and errors if any, are displayed under the '''Build''' tab in the lower panel.
# To compile the script in the active window: Click the '''Compile''' http[[File://wwwPL_COMPILE.multicharts.com/img/wiki/toolbar/PLE/12_Compile.gif png]] toolbar icon, press the F3 key, or select '''Compile''' in the main menu and click '''Compile Study Name'''.
# To compile scripts of all opened studies: Select '''Compile''' in the main menu and click '''All Opened''', or use the Ctrl+Shift+F2 keyboard shortcut.
# To compile any uncompiled scripts of all open studies: Select '''Compile''' in the main menu and click '''All Uncompiled'''.
# To compile indicators and signals only: Select '''Compile''' in the main menu and click '''All Indicators and Signals Only'''.
There are two compilation modes available to select from the dropdown box: '''Fast Execution''' and '''Fast Compilation'''.<br>
 
[[File:CompilationMode.png]]
<br>
In '''Fast Execution''' mode the app attempts to optimize the study’s script.<br>
In '''Fast Compilation''' mode this procedure is skipped. It should not influence the script calculation and robustness of the code.
 
 
<br>
 
== Protecting Studies ==

Navigation menu