Script Manager

Scripts are a set of conditions that translate your criteria into the format that TrendSpider can understand. With the help of the Script Manager, you can easily organize all of your templates for Multi-Factor Alerts, Market Scanner, and Backtesting in a single place.
In this documentation, we will explore how to:

  • Navigate to the Script Manager Settings
  • Create, Edit, and Delete Script Template
  • Clone Script Template
  • Send Script to Alert or Strategy Explorer

Let’s get started 🚀

Navigate to the Script Manager Settings

Click on the Scripts button from the top menu bar to launch the Script Manager settings

script.png

A modal window for managing the scripts will appear for you to start creating, editing, removing, the script(s), and much more.

modal window for managing the scripts

Create, Edit, and Delete Script Templates

Create Script Templates

Step 1: Navigate to the Script Manager and click on the ADD NEW button.

Navigate to the Script Manager

Step 2: By default, a system-generated name is assigned to your new script template. You can choose to keep this name or Enter a name of your choice.

System-generated name assigned to your new script template

Step 3: Use the visual editor to add new or existing conditions to your script by clicking on “add parameter here” and selecting any of the following from the dropdown list:

  • Condition: Select this option to add a parameter(s) within a group.
  • Condition Group: Select this option to add a parameter(s) to a group nested under an existing group.
  • Load From Template: Select this option to load a pre-made script template.

Since Script Manager uses the same builder tool as Multi-Factor Alert, you can refer to the documentation on How to Create Multi-Factor Alerts to learn more about- pre-made script templates, saving a template, removing a template, commenting on the block, and more.

clicking on “add parameter here”

Step 4: After setting up the conditions for your script, hit the SAVE button and your script will be saved and listed in the left panel.

Note: After saving your script template, you will be able to use it in Strategy Tester, Multi-Factor Alerts, or Market Scanner.

script will be saved and listed in the left panel

Tip: Using the Hashtag system, you can organize templates based on commonalities. For instance, if you have several SMA-based strategies, you can add “#sma” to the template name. You can search for all SMA templates by entering the keyword “#sma” into the search bar. You can also combine multiple hashtags into a single template.

Hashtag system

Edit Script Template

You can select any of your saved scripts from the left panel and perform the following configurations:

  • Edit the Template Name
  • Edit or Add More Hashtags
  • Edit or Add More Conditions

After making the relevant changes, click on the SAVE button.

Edit Script Template

Note: Apart from your saved templates, the left panel also contains pre-built Script templates having the hashtag #sample (the #sample hashtag is part of TrendSpider’s public library). However, you cannot edit a prebuilt script template. You can send it to Alerts or Strategy Explorer or create a duplicate template by using it as a base and then choose to perform edits on the cloned version.

pre-built Script templates

Delete Script Template

Step 1: Select the script template you don’t want from the left panel and click on the DELETE button.

Select the script template you don’t want

Step 2: A confirmation window will appear. Click on the YES button to confirm your Delete action and the script will be removed from the left panel forever.

Delete confirmation window

Clone Script Template

As already illustrated above, the left panel contains all saved and pre-built Script Templates. You cannot edit a prebuilt script template but develop a duplicate template by using it as a base and then choose to perform edits on the cloned version.

Step 1: Select a prebuilt script template having the hashtag - #sample and click on the CREATE MY COPY button.

prebuilt script template

Step 2: When you clone a script template, a complete copy of all of its conditions is done without any specific exceptions which you can use as a base for creating a new script.

You can give it a name of your choice and also modify or add further conditions.

complete copy of all of the conditions

Step 3: Click on the SAVE button and the script will be saved and added to the left panel.

Click on the SAVE button

Note: You can also create the cloned versions of the scripts that have been shared to you.

Send Script to Alert or Strategy Explorer

You can send any script from the left panel (whether created by you or not) to Alerts for creating Multi-Factor Alert or Strategy Explorer to backtest the script as Entry or Exit position.

Send Script to Alert

Step 1: Select a script template from the left panel and click on the SEND TO button.

script template from the left panel

Step 2: Select Alerts: Create New Alert from the dropdown list.

elect Alerts: Create New Alert

Step 3: The conditions defined in the Script Template (selected in Step 1) will be migrated into the Multi-Factor Alert configuration window. You can use these conditions as a foundation to create the Multi-Factor Alert.

For more information on creating Multi-Factor Alerts, please refer to the documentation on- How to Create Multi-Factor Alerts.

creating Multi-Factor Alerts

Send Script to Strategy Explorer

Step 1: Select a script template from the left panel and click on the SEND TO button.

Select a Script and click Send

Step 2: Select any of the following two options from the dropdown list:

  • Strategy Explorer: Backtest as Entry
  • Strategy Explorer: Backtest as Exit

Select Strategy Explorer Option

Step 3: Selecting Strategy Explorer: Backtest as Entry will migrate the conditions in your Script Template (selected in Step 1) as an entry position to the Strategy Tester for backtesting.

migrate the conditions in your Script Template

Selecting Strategy Explorer: Backtest as Exit will migrate the conditions in your Script Template (selected in Step 1) as an exit position to the Strategy Tester for backtesting.

Strategy Explorer: Backtest as Exit

For more information on creating a strategy, please refer to the documentation on Strategy Tester

TIP: You can check out the Case study: using a Script in Backtester, Scanner & Alerts in the documentation- Scripts. Write once, use everywhere: scan, backtest, create alerts to develop further understanding.

Apr 14, 2023

Contact Us

Not finding what you're looking for? Contact Us Directly