This is a tool that lets you create global scripts using CSharp or JScript.Net programming languages. These scripts have access to a lot of QuantShare tools/functions and they can be used, amongst other things, to create programs to perform or automate tasks. An example of such program is a script that creates 10 charts, update each one's formula then arrange them. Another example is a script that automatically downloads data, every single minute, for open chart's symbols and updates the chart after the download is complete.
To open this editor, select "Tools" in the menu and then click on "Script Editor". To create a new script, select "File" then "New". For each script added to this editor, a new tab is inserted.
To keep the editor on top, select "Settings then "Linked to Main Form".
Script Main Classes
As with any formula editor in QuantShare, when you type CONTROL+SPACE a list showing the available functions/classes appears.
Here is a brief description of the main classes available in the global script:
Chart: Access, create and manipulate charts. Basic actions include opening charts, moving chart windows, adding panes and formulas.
Databases: A class that permits you to load and save database's data for a given symbol.
Downloader: Open and execute a download item. Execution can be performed silently and downloader parameters can be passed by the class functions.
Global: Load, Save and Remove global variables. Once a variable is created it survives until the trading software is closed. A variable can also be accessed from another script.
ParserTool: A powerful class that allows you to parse any formula and then read the variables that belong to this formula.
Quotes: A class that allows you to access and update historical, intraday and tick data.
Symbols: If you want to programmatically add symbols, markets, indices or remove/update symbols then this class will help you.
App: This class contains four other classes:
App.Main: The main class contains functions to perform actions and retrieve data from the application. You can for example Change the active account, pause the script, get template names, read the content of the output...
App.Forms: It allows you to create simple forms.
App.Net: It allows you to download webpages and to parse them.
App.StoredVariables: This class contains the same functions as the "Global" class. The difference lies in the fact that here, the variables are stored on the hard drive and therefore variables persist even after the application is closed.
Here is a simple script that opens a new chart:
Charts.OpenChart("GOOG", "", "");
Once your program is completed, you can run it by clicking on the "Execute" button on the top. During program run, the button will show "Stop".
The bookmark panel is a button/folder container that is located under the drawing buttons. It contains folders and shortcuts of trading objects. You can directly create folders and shortcuts by right clicking on the panel.
In the Script Editor, you can add the current script to the bookmark panel by selecting "Settings" then "Add Current Script to Bookmark Panel". Once your script is in the bookmark panel, right click on it to display a menu and double click on it to execute the script (The button will turn Red during script run).