Scripts are a set of conditions that translate your criteria into a 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, Strategy Explorer, Market Scanner, and Sidebar
Let’s get started 🚀
Navigate to the Script Manager Settings
Click on the Visual Scripts button from the top menu bar to launch the Script Manager settings
A modal window for managing the scripts will appear for you to start creating, editing, removing, the script(s), and much more.
Create, Edit, and Delete Script Templates
Create Script Templates
Step 1: Navigate to the Script Manager and click on the ADD NEW button.
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.
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- GPT conditions, Happened control, multi tickers in a single script, pre-made script templates, saving a template, removing a template, commenting on the block, and more.
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.
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.
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.
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.
Delete Script Template
Step 1: Select the script template you don’t want from the left panel and click on the DELETE button.
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.
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.
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.
Step 3: Click on the SAVE button and the script will be saved and added to the left panel.
Note: You can also create the cloned versions of the scripts that have been shared to you.
Send Script to Alert, Strategy Explorer, Market Scanner, and Sidebar
You can send any script from the left panel (whether created by you or not) to Alert, Strategy Explorer, Market Scanner, and Smart Checklist.
- Send Script to Alert
- Send Script to Strategy Explorer
- Send Script to Market Scanner
- Send Script to Smart Checklist.
Send Script to Alert
The conditions defined in the Script Template can be migrated to the Multi-Factor Alert configuration window. So you can use these conditions as a foundation to create the Multi-Factor Alert.
Step 1: Select a script template from the left panel and click on the SEND TO button.
Step 2: Select Alerts: Create New Alert from the dropdown list.
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.
Send Script to Strategy Explorer
The conditions defined in the Script Template can be migrated to the Strategy Tester configuration window so that you can use these conditions as an entry or exit position for backtesting.
Step 1: Select a script template from the left panel and click on the SEND TO button.
Step 2: Select any of the following two options from the dropdown list:
- Strategy Explorer: Backtest as Entry
- Strategy Explorer: Backtest as Exit
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.
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.
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.
Send Script to Market Scanner
The conditions defined in the Script Template can be migrated to the Market Scanner configuration window so that you can check whether the specified technical conditions exist in those symbols or not.
Step 1: Select a script template from the left panel and click on the SEND TO button.
Step 2: Select Market Scanner: scan with this script from the dropdown list.
Step 3: Selecting Market Scanner: scan with this script will migrate the conditions in your Script Template to Market Scanner to scan and check if the specified technical conditions exist in those symbols or not.
For more information on Market Scanner, please refer to the documentation on Market Scanner.
Send Script to Smart Checklist
The conditions defined in the Script Template can be migrated to the Smart Checklist so it can automatically check these conditions for a symbol and provide a simple list with their status. This offers a quick, status check for the symbol.
Step 1: Select a script template from the left panel and click on the SEND TO button.
Step 2: Select Sidebar: See as Smart Checklist from the dropdown list.
Step 3: Selecting Sidebar: See as Smart Checklist will migrate the conditions in your Script Template to Smart Checklist.
For more information on the Smart Checklist, please refer to the documentation on the Smart Checklist widget.