This bot video demonstrates how to build a simple trend plus momentum trading bot. The bot uses a copy of an existing scanner automation and adds an indicator to identify if a security is in a strong uptrend before entering a long equity position.
Create New Bot (:14)
Create a new bot, give it a name, and set allocation and position limits in the global bot settings.
The bot will have no activity, positions, or automations. As a safeguard, the bot is turned off by default, and you must manually turn it on when you are ready.
Add a New Scanner Automation (:45)
Scanner automations tell the bot what market criteria to evaluate before entering a new position.
To add a new scanner automation, select the “+” icon in the Scanners section of the Automations tab.
When adding an automation, you have the option to reuse an automation, make a copy and modify an existing automation, or create a new automation.
Because there is already an automation that references a stock’s trend, you can create a copy.
Copied automations give you flexibility. You can instantly replicate an automation and modify its settings without affecting the original version or building a new automation.
You can rename the copy and edit, add, or delete decisions.
Add Decision Recipes (1:56)
You can add multiple recipes to a single decision block. Select the existing decision action and click the “+” button to add more recipes.
Choose the decision recipe to add.
In addition to referencing the ticker’s price relative to the 200-day SMA, this bot will also check if the ADX value is over 25. You can use a custom input to link a ticker symbol to both decisions.
You can use the “And/Or'' function to group decisions when additional recipes are added.
In this example, the bot must confirm that both criteria are true before moving through the automation.
Select “Save,” and the decisions are added to the automation.
The open position action from the original automation remains. A long equity position will be opened if all criteria is met.
Select “X” in the top right corner to exit the automation editor. Select “Save” to add the automation to the bot.
Add Additional Scanner Automations (4:31)
You can reuse an automation multiple times in a bot. This enables you to scan the same criteria and simply switch the ticker symbol referenced via the custom input.
Reusing an automation is more efficient than creating a copy if you don’t want to change actions inside the automation.
Select the “+” symbol and choose the same “Stock Trend + Momentum Scanner” from the list of automations. When prompted, assign a ticker to the custom input.
The automations are added to the bot to create a “mini” portfolio of different ticker symbols using the same strategy.
Add a Monitor Automation (5:02)
You can now add a monitor automation to manage open positions in the bot. This monitor will evaluate market conditions to determine if trend and momentum change and exit the position accordingly.
Remember, monitor automations only become active once a position is entered.
Select the “+” symbol in the Monitors section to create a new automation or select from a list of available automations in your library.
Because a “Stock Trend Manager” automation already exists, you can create a copy. You may not want to reuse and edit the monitor automation because it is being used in another bot, and any changes will flow through wherever the automation is used.
As with the scanner, copying the monitor allows you to rename and modify the existing automation.
Repeater actions are typically used at the beginning of the automation. Repeater actions repeat the automation’s actions for all positions of a specific type in the bot.
Because the original automation only checked if the underlying symbol’s price was above the 200-day SMA, you must also add a decision recipe to check the ADX value. The “Or” function can be used.
The automation will proceed down the “Yes” path and close the position if either criterion is met.
The bot uses a single scanner automation running on three different ticker symbols and one monitor automation to manage all open positions. The bot opens long equity positions in stocks with an uptrend and momentum, and closes the position when the trend or momentum changes.