Trend systems are often used to identify entry and exit points, but they can be difficult to track for a portfolio of securities because they are constantly changing. You can’t afford to miss an opportunity when it presents itself. So we created this simple but widely used decision recipe.
This decision recipe automatically checks if an asset is above or below a specified moving average length to determine if it is in an uptrend or downtrend before proceeding through the automation.
You can use the decision recipe in scanner, monitor, and event automations.
For example, you could add the recipe to a scanner to evaluate if a ticker symbol is above a 50-day SMA and enter a position accordingly. You could then use the same recipe in a monitor automation to close the position if and when the security drops below the 50-day SMA.
This is a perfect example of how bots can automate once difficult tasks with simple, but powerful, actions.
1. Create a new automation or open an existing automation.
You can add a trend decision to any type of automation. You can create a new automation or add a decision to an automation you are already using.
2. Add a decision action.
Select the + icon to add an action then select "Decision" to add a new decision block to your automation.
3. Select a decision recipe.
Select the "Comparing Symbol Price to an Indicator" decision.
4. Input a symbol or custom input to compare.
Add a ticker symbol by typing in the field or create a custom input.
5. Define your trend criteria.
Define your trend criteria by selecting above or below, the time period referenced, and the type of moving average indicator.
6. Save the decision action.
After you have entered all of your decision recipe criteria, select Save.
7. Your moving average trend decision is complete!
Your new moving average trend decision is ready. You can test the decision and use it to evaluate a ticker's trend.
In this video, I want to show you how to set up a moving average trend decision automatically right inside of your automations. You can use this decision recipe inside of any automations that you’re running on Option Alpha and you can use it in conjunction with scanners as well as monitors or event automations. It’s basically just using a trend decision and letting the bot check for that trend decision automatically.
To add this recipe in this decision, you simply go to the "+" icon anywhere inside of your automation editor then go to the decision action. After that, you’ll select the recipe from the list of available recipes. In this case we want to use this one here. The symbol price is above or below some moving average that we define.
Notice that when we select this, some of the fields here are variable fields that we’ll have to fill out. You can type in the symbol manually and you can always choose to check SPY, or if you want to you can create a custom input.
When you create a custom input like this and we name it something like “Ticker Symbol,” that field now becomes a variable field. We can set a default value for it, but we can also reuse this and swap out the ticker symbols on different automations in different bots that we’re running inside of the platform. Let’s just use the “Ticker Symbol” custom input for now and then we can keep moving forward.
You go to the next field and now you can check and see if that particular symbol that you’ll set when you create your bot and start running your automations is above or below some moving average. In this case we’ll check and see if the particular ticker symbol is above its 50-day moving average.
Notice that we just simply select any of these fields and make the appropriate change anywhere that we want inside of the decision recipe. We select what type of moving average we want. In this case we’ll stick with the symbol moving average, and then we click save. That now adds this to our decision block here for our actions and we click save one more time, and now we have this decision recipe added to our automation editor.
Now any time that this automation runs, it will first check and see if the ticker symbol’s price is above its 50-day moving average. If the answer to that question is yes, it will continue down the "Yes" path. Alternatively, if the answer to that question is no, then it will continue down the "No" path.
From here, you can layer and stack decisions and actions and whatever sequence or whatever process you use for trading and start to replicate your strategy automatically inside of your bots.
The transcript is not available yet. Please check back soon.