Editing Study Scripts: Difference between revisions
From MultiCharts
→Compiling Scripts
No edit summary |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
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. | 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 [[ | To learn more, see [[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. | 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 [[ | Before a study can be applied to a chart, the study's script must be [[Editing_Study_Scripts#Compiling Scripts|compiled]]. | ||
The code is compiled directly in the PowerLanguage editor. | The code is compiled directly in the PowerLanguage editor. | ||
The script of a study can be [[ | The script of a study can be [[Editing_Study_Scripts#Protecting Studies|password protected]]; script of a protected study can not be viewed without the password. | ||
<br> | <br> | ||
Line 22: | Line 22: | ||
<br>Changes can be undone by one of the following methods: | <br>Changes can be undone by one of the following methods: | ||
* Clicking the '''Undo''' | * Clicking the '''Undo''' [[File:PL_UNDO.png]] icon on the toolbar; or: | ||
* Using the Ctrl+Z keyboard shortcut, or: | * Using the Ctrl+Z keyboard shortcut, or: | ||
* Selecting '''Edit''' in the main menu, and clicking '''Undo'''. | * Selecting '''Edit''' in the main menu, and clicking '''Undo'''. | ||
Line 28: | Line 28: | ||
<br>Changes can be redone by one of the following methods: | <br>Changes can be redone by one of the following methods: | ||
* Clicking the '''Redo''' | * Clicking the '''Redo''' [[File:PL_REDO.png]] icon on the toolbar; or: | ||
* Using the Ctrl+Y keyboard shortcut, or: | * Using the Ctrl+Y keyboard shortcut, or: | ||
* Selecting '''Edit''' in the main menu, and clicking '''Redo'''. | * Selecting '''Edit''' in the main menu, and clicking '''Redo'''. | ||
Line 60: | Line 60: | ||
To find text: | To find text: | ||
# Open the '''Find''' window by clicking the '''Find''' | # Open the '''Find''' window by clicking the '''Find''' [[File:PL_FIND.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. | # Enter the text to be found into the '''Find what''' box. | ||
# Select the '''Match whole word only''' check box to find whole words only. | # Select the '''Match whole word only''' check box to find whole words only. | ||
Line 72: | Line 72: | ||
To replace text: | To replace text: | ||
# Open the '''Replace''' window by clicking the '''Replace''' | # Open the '''Replace''' window by clicking the '''Replace''' [[File:PL_REPLACE.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 text to be found and replaced into the '''Find what''' box. | ||
# Enter the replacement text into the '''Replace with''' box. | # Enter the replacement text into the '''Replace with''' box. | ||
Line 87: | Line 87: | ||
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. | 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''' | # To compile the script in the active window: Click the '''Compile''' [[File:PL_COMPILE.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 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 any uncompiled scripts of all open studies: Select '''Compile''' in the main menu and click '''All Uncompiled'''. | ||
Line 93: | Line 93: | ||
# To compile indicators and signals only: Select '''Compile''' in the main menu and click '''All Indicators and Signals Only'''. | # 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> | <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 == | == Protecting Studies == | ||