Exploration Tool Window
Launching Explorations from the IDE
Working with Exploration Results
The Explorer is one of the most powerful tools in Chartsy|One. It allows to scan historical data of selected symbols for trading opportunities using custom, fully programmable criteria.
The exploration is a definition of the screening task and it consists two parts: the exploration configuration and the exploration formula (source code). The exploration configuration contains general properties of the screening task, such as the exploration name and the time frame and the resolution of candles supplied to the exploration script (for example: daily candles, hourly candles,... etc). The exploration formula is the actual source code executed when the exploration task is running.
It is possible and quite common to have multiple exploration configurations associated with one exploration formula.
Exploration Tool Window
Explorations can be managed, created, deleted and organized into categories from the “Explorations” window.
To open the “Explorations” window use any of the following methods:
- Click Exploration from the Tools menu.
- Click a binocular icon on the main toolbar.
- Press the Ctrl + E keyboard shortcut.
To create a new exploration from the Exploration Tool window:
- Click New… button.
- A “New Exploration” window is opened, where you can define exploration configuration options:
- Name - an exploration display name (required),
- Class name - a name of the Java class containing the exploration formula source code to execute (required). You can reuse already existing formulas by pressing Browse… button and selecting picking the existing class from your Formula Center repository.
- Category - a name of a category under which a created exploration item will be shown (optional).
- Time Frame - the resolution of candles to use.
- Range - the range of data to use
- Apply To - a hint to the system, about what symbols to use in the exploration. The “Apply To” field should contain a valid name of the top-level folder from the “Symbols” tree view, or its regular expression if the “Regex” checkbox is selected.
- Press Finish button to accept changes.
The exploration configuration is saved and the source code editor tab is opened in the background. Use the source code editor and the build in development environment to develop an actual exploration code.
Note: If already existing class name is selected in step 2 above, then a code editor is not opened in the last step.
The exploration code is a Java class which contains an actual code that will be executed against all selected symbols when an exploration is launched. The class must extend Exploration base class and must implement at least the explore(Symbol, Quotes) method.
The explore(Symbol, Quotes) method is an entry point of a custom exploration code. It is called once for each symbol selected for exploration. The method is called with two arguments of type Symbol and Quotes.
The Symbol is a reference to the symbol being currently explored.
The Quotes object delivers a historical data candles for the symbol. The resolution and range of the candles matches the values declared in the exploration configuration. The Quotes object is an indexed, chronologically ordered collection of OHLC prices (candles). The latest, newest candle has index 0, while the older candles has indexes 1, 2,... etc. The method quotes.length() gives the total number of candles available in the object.
The explore() method usually crunches supplied historical symbol data and publishes results by invoking addColumn(String, Object) method or any of its alternate versions one or more times. The added columns will become automatically visible in the exploration result table.
For example the following exploration code displays an open, high, low and closing prices of the last candle and in addition displays the last value of the RSI(14) indicator.
To programmatically filter out symbols from the exploration override filter(Symbol) or filter(Symbol, Quotes) method (or both) in your exploration class. By returning “false” for a particular symbol it is effectively excluded from the exploration result and the explore() method won’t be called for it.
To launch the exploration from the “Explorations” window:
- Left click on the exploration to select it.
- Press the Explore button.
- A new “Select Symbols for Exploration” window is opened with a symbols tree view.
- Select one or more symbols from the displayed symbols tree by checking the box near each symbol or symbol group you want to be included in the exploration.
- Press the Explore button to confirm your selection and start the exploration.
A new exploration task is started in the background and a new “Exploration Result” tab is expected to open. The “Exploration Result” tab is a table displaying in realtime the results of the exploration task. The more symbol you included in the exploration, the more time the exploration needs to scan all historical data.
Launching Explorations from the IDE
While working with the exploration source code you can quickly launch an exploration by clicking the Launch button from the editor toolbar. The provided combobox allows also to change an exploration configuration against which an exploration will be launched.
Note: While working with the source code the editor changes must be saved before launching the exploration. Otherwise the Explorer Tool won’t be able to pick up the newest code and instead it will execute an old one.
Sometimes it is crucial to launch repeatedly many explorations or multiple versions of an exploration being developed with the same set of symbols. You can avoid repeatedly selecting the same set of symbols over and over again each time you start an exploration, by pre-selecting them in the Symbols view.
To do so, mark checked the required symbols or symbol folders in the symbol tree view. by checking the boxes near the tree items which you want to include in the exploration. If any items are checked in the view, the Explorer Tool will by default use all symbols from the checked symbols for new exploration launches.
Working with Exploration Results
The “Exploration Result” table displays a result of the ongoing or completed exploration process. Each row in the table corresponds to a single processed symbol. Each column is defined in the exploration source code and can display any data for a particular symbol you like.
To export exploration result table to CSV file:
- Right click on a row in the table.
- Select Export to CSV or other alternative export actions available in the context menu.
- Choose the file name and directory you want to export the data to.
- Click Save to confirm.
To show chart for a symbol:
- Double click on a row in the table;
- Right click on a row in the table,
- Click Open Chart from the context menu.
To quickly browse charts for a number of symbols from the exploration result follow the given steps:
- Order the rows in the exploration in a way you like to group the symbols you are interested in. For example, if you are interested in low-RSI stocks, sort the RSI column in ascending order.
- Select multiple rows in the table using any of the following methods:
- Press CTRL + left click on the row to select, CTRL + left click again to deselect;
- Press SHIFT + up/down arrow keys to select/deselect adjacent rows;
- Left mouse button press and drag to define the rows selection.
- Right click on the table.
- Select Open Charts(s) from the context menu.
A new chart tab is expected to open. To quickly switch charted symbol and navigate forth and back to the next (previous) symbol, press right (left) arrow keys on the keyboard.
Note: If the arrow keys are not changing the chart symbol, first click the “Go Forward” button in the chart toolbar, and then continue using the keyboard arrow keys.
Note: You can press and hold the “Go Forward” or “Go Back” buttons to open an entire list of symbols, from which you can select the symbol to chart.
While the exploration is running Chartsy displays a progress of the task in the application’s status bar.
To cancel a long running exploration:
- Click the cancel icon near the progress bar of the task.
- When asked for confirmation press Yes to confirm.
To modify properties of an exploration:
- Highlight an exploration you want to modify in the “Explorations” window.
- Click the Edit button.
- The “Modify Exploration” dialog is expected to open.
- Change exploration configuration properties and click Finish to save all changes.
To rename an exploration:
- Highlight an exploration you want to rename in the “Explorations” window.
- Click the Rename button.
- Enter a new name for the exploration.
- Click OK to accept change.
To create a new exploration configuration based on an existing one:
- Highlight an exploration you want to clone in the “Explorations” window.
- Click Copy as… button.
- A “New Exploration” window is expected to open with exploration properties already populated.
- Change exploration configuration properties in any way you like and click “Finish” to create a new exploration.
To remove existing exploration:
- Highlight an exploration you want to remove in the “Explorations” window.
- Click Delete… button.
- Click Yes when asked for confirmation.