Bot Actions


Decision actions allow bots to make decisions dynamically inside an automation. Here is how to use decision actions.
Steve Henry
Jul 29, 2021

The decision action inside the automation editor gives bots the ability to make decisions dynamically inside an automation.

Select the “+” symbol in the automation editor to add an action from the list.

Screenshot of automation editor with action selection highlighted

Select the “Decision” action to add criteria to the decision block. Decision actions can have multiple criteria, or recipes. Decision recipes are the criteria the bot evaluates as it moves through an automation. Select the “+” symbol to add criteria from the list of recipes.

Screenshot with button highlighted to add decision criteria

Decision recipes are added to an automation and grouped together based on type. There are four sections of decision recipes:

  • Stocks
  • Opportunities
  • Positions
  • Indicators

NOTE: The list of available recipes will continue to grow as the Option Alpha autotrading platform evolves and members offer improvement suggestions.

Stock recipes

Stock recipes are based on stock-specific data, such as the underlying symbol’s price or volume.

Screenshot with examples of stock decision criteria highlighted

Opportunity recipes

Opportunity recipes reference potential opportunities before sending an order to your broker, such as rate of return or the open interest of a specific leg in an options strategy.

Screenshot with opportunity decision criteria highlighted

Position recipes

Position recipes reference existing positions inside of the bot that are currently running. For example, you can base decisions on whether the premium has increased or decreased by a certain percentage. You can also use calendar data such as days until expiration with position recipes.

Screenshot with position decision criteria highlighted

Indicator recipes

Indicator recipes list stock indicator data such as moving averages, RSI, and VIX values. Indicators can reference multiple symbols at once.

Screenshot with indicator decision criteria highlighted

Decisions inside the automation editor use a structured approach, often with if-then statements following a yes/no path.  Decision recipes use natural language to help you structure your decision criteria.

Screenshot of automation editor decision tree

NOTE: The decision framework that you use must result in a yes or no answer.

To edit criteria, select the decision block inside the automation editor to add multiple recipes. Select “Save” to add the new decision criteria to the block.

Screenshot with button for editing decision criteria highlighted

Grouped decisions

When a decision action has two or more criteria, an “And/Or” block is introduced. The block can easily be toggled between “And/Or” to make the action contingent on both criteria happening or only one of the criteria happening.

Screenshot example using and/or decision criteria

You can also group, or nest, decision recipes to make multiple decisions within the same block. Simply hover over a criterion to access the gear icon and select “New Group.”

Screenshot with example of nested decision criteria highlighted

This will create a new group of decisions separated from the existing decision(s) inside the action and allow you to reference multiple recipes simultaneously.

Screenshot of nested decision criteria with multiple groupings highlighted

NOTE: You can create multiple groups of nests and easily delete them to simplify the framework from the gear icon.

No tags found.
Next article
Open Position
Opening actions allow bots to open positions automatically. Here is how to use opening actions to have complete control over how and when a position is opened.
Was this helpful?

Can I pull in custom data or indicators to make decisions?

At this point, we do not offer a connection to any third-party data sources. However, this may change in the future, and we will update the Community.

Should I lump various decision criteria together in one step or keep them separate?

It is up to you to determine how many criteria you want in a single decision action. We suggest keeping each decision separate initially so that you can see the precise place that the automation does or does not meet specific criteria, and you can adjust accordingly.

How can I see exactly what my bot is doing and understand where it stops in its process?

The Bot Log displays all actions taken by a bot, and you can select each time an automation ran. You can filter for errors to see where an automation encounters an issue.

Do decision actions always follow a "Yes/No" outcome logic?

Yes, every step a bot takes will result in a yes or no answer.

Can you nest or group decisions together inside one action block?

Yes, you can group multiple decisions into one action. Grouping decisions together forces the bot to evaluate multiple criteria simultaneously to produce an outcome.

Can you use "And/Or" decisions inside of an automation?

Yes, multiple and/or decisions can be built inside a single bot step and nested in almost any way you might imagine. 

Can you combine different types of decision recipes into one single decision action block?

Yes, you can combine multiple decision recipes into a single step.

What are the pros and cons of grouping decision recipes into a single action?

Grouping decisions together enables the bot to evaluate multiple indicators simultaneously. The functionality splits the decision-making process into two steps and forces the bot to evaluate market conditions in the order you define.

Grouping decisions is efficient when you want to ensure multiple criteria are true and you want them referenced in a single action. Combining recipes can be especially useful if many decisions are grouped together because it forces the bot to verify multiple market conditions before proceeding through the automation.

How do you edit or update one of the decision recipes inside an automation?

You can edit automations and decision recipes in the Automations tab. Simply select an automation to access the editor. 

Please note that anytime you make a change to an automation, that change will be reflected in every single use of that specific automation, so if you only want to change it in one bot, you should create a copy of the automation and rename it prior to making and saving your changes.

Can you precede any action inside an automation with a decision or set of decisions?

Yes. In the automation editor, hover over a decision and click the gear icon in the upper right-hand corner of the step you would like to precede and select “Precede with.“ This opens a new recipe area for you to populate. 

Do you have to end each branch of a decision action with another action, or can it just end and stop the automation?

Any specific branch of a recipe can simply end with no specific action.

Related articles

Trade smarter with automation