Besides customising the PowerLanguage .NET Editor by rearranging window panels and adjusting the syntax highlighting, we can also organise scripts to our liking. How do we do that?

Organising scripts in the PowerLanguage .NET Editor

The primary tool for creating and editing MultiCharts .NET indicators, trading strategies, and functions is the PowerLanguage .NET Editor (MultiCharts, 2014). Granted, scripts can also be edited in other programs (like Visual Studio), but actions like exporting, importing, and removing scripts are only possible in the PowerLanguage .NET Editor.

Scripts can be organised into folders in the PowerLanguage .NET Editor (Henry MultiCharts, 2013). We do that in the ‘Studies’ window. Studies is the collective term that MultiCharts .NET uses for indicators, signals (which are trading strategies), and functions (MultiCharts Wiki, 2013). These are more commonly known as scripts.

Enabling the ‘Studies’ window in the PowerLanguage .NET Editor

So before we can organise scripts into (custom) folders, the ‘Studies’ window needs to be enabled. This window contains a tree-like ordering of all scripts currently in the PowerLanguage .NET Editor. It typically looks like:

Studies window in the PowerLanguage .NET Editor

If you cannot find it, check if it’s enabled by going to ‘View’ and switch on the ‘Navigator’ menu item:

Enabling the Studies window

Creating a folder in the ‘Studies’ window

To create a folder in the ‘Studies’ window, right-click on a top folder (for example the ‘Studies’ folder) and then select ‘Add New Folder’:

Adding a folder to the Studies window

That will create a new folder named ‘Folder1’:

New folder added to the Studies window

Now right-click on the new folder and select ‘Rename’ (or select the folder and press the F2 keyboard key):

Rename a folder in the PowerLanguage .NET Editor

Then type in the folder’s name followed by pressing Enter. For instance:

Folder in the Studies window successfully renamed
Tip: The folders in the PowerLanguage .NET Editor aren’t displayed when editing scripts in other programs, like Visual Studio (Henry MultiCharts, 2013).

Moving scripts to a custom folder in the PowerLanguage .NET Editor

Once we’ve made a new folder, we can add scripts to it by dragging them into the folder. To do so, first open the folder that contains the script to move:

Locating a script in the Studies window

Then left-click on the script and, while holding down the left mouse button, move the mouse to the new folder:

Dragging a MultiCharts .NET script to its new folder

Then release the mouse button to drop the script in the folder:

Script successfully moved to a different folder

Removing a folder from the PowerLanguage .NET Editor

We can only remove empty folders in the PowerLanguage .NET Editor. As long as a folder still contains a script, the ‘Delete’ option is not available:

Deleting a folder in the Studies window not possible

But as soon as it’s empty, the ‘Delete’ option is available:

Deleting a folder in the Studies window

After that the folder is gone:

Folder successfully deleted

By the way, there’s no confirmation window when removing a folder and deleting a folder cannot be undone.

Adding folders to folders in the PowerLanguage .NET Editor

Subfolders can be added to any folder by right-clicking on the folder and selecting ‘Add New Folder’:

Adding a folder to an existing folder

Then a little icon ( ) is placed before the folder:

New subfolder created in the Studies window

Click on that icon to expand the folder, and then we can look for the new folder. When found, click on this new folder and select ‘Rename’ (or select it and use the F2 keyboard shortcut):

Renaming a subfolder in the Studies window

This way we can create several custom folders to organise our scripts in the way we want. For example:

Organising MultiCharts .NET scripts with multiple custom folders

Note that we cannot change the order of scripts in a folder; they are automatically sorted by alphabet. That makes renaming scripts the only way to change the script’s order.

When we customise the layout of the ‘Studies’ window in the PowerLanguage .NET Editor, we can also place folders and scripts at the same level as the main ‘Studies’ folder. For that, drag-and-drop a folder (or script) above the ‘Studies’ folder until there’s black, horizontal line like this:

Drag-n-drop a folder in the Studies window

Then release the mouse button to drop the folder or script at that level. In this example, the ‘My scripts’ folder is placed at the top:

Folder successfully moved in the Studies window

Renaming existing folders in the PowerLanguage .NET Editor

Not only user-made folders, but all folders in the ‘Studies’ window can be given a different name. For that we right-click on a folder and select ‘Rename’ (or select the folder and press the F2 keyboard shortcut):

Rename the top folder in the Studies window

Then press Enter after typing in a new name. This way we can change the default folders to anything we want. For instance:

Custom folder names in the Studies window

For more on customising scripts in PowerLanguage .NET Editor, see changing the code highlighting, changing script settings, and removing scripts.

Summary

The ‘Studies’ window in the PowerLanguage .NET Editor allows for organising scripts into (custom) folders. We can add new folders, rename any existing folder, and delete folders. None of these actions can be undone, and so a removed folder is gone forever.

For more information about coding and the C# programming language, see Kodify.net.


References

Henry MultiCharts (2013, December 13). MultiCharts .NET FAQ. Retrieved on July 30, 2015, from http://www.multicharts.com/discussion/viewtopic.php?f=19&t=45848#p100789

MultiCharts (2014). MultiCharts .NET Programming Guide (version 1.1). Retrieved from http://www.multicharts.com/downloads/MultiCharts.NET-ProgrammingGuide-v1.1.pdf

MultiCharts Wiki (2013, May 6). Using Studies (PowerLanguage Editor). Retrieved on July 16, 2015, from https://www.multicharts.com/trading-software/index.php/Using_Studies_%28PowerLanguage_Editor%29

Visit programming tutorials for more helpful coding articles.