The term “diversification” is thrown around a lot in the world of investing. It means different things to different people. When using a bot, you may not want to trade more than a certain number of positions for an underlying ticker symbol, thus ensuring that all your eggs are not in one basket.
This helpful decision recipe is different from the position limits you set in the global settings. Still, it can accomplish a similar goal if you want to avoid overallocation to a single ticker.
For example, you can use the recipe to reference if the bot has exactly zero positions open in SPY. If there are any open SPY positions, the automation will proceed down the “No” path. This is how you tell the bots exactly how to limit the number of positions for a specific ticker symbol.
This can be very useful if you want to open multiple positions with the same strategy type but spread the positions across different tickers. Custom inputs make the process even more efficient.
Suppose you have a scanner automation that looks to open iron condors, and you’ve reused the same automation twice inside a bot with different underlying symbols. This decision recipe can help ensure that you do not open two iron condors in the same ticker. Instead, you may want to open one position each in different tickers, such as SPY and GLD.
You can use this recipe to extend the functionality beyond the limits in the global settings. Trade confidently knowing that you have complete control over how many positions are allocated to a single ticker.
The text is the output of AI-based and/or outsourced transcribing from the audio and/or video recording. Although the transcription is largely accurate, in some cases, it is incomplete or inaccurate due to inaudible passages or transcription errors and should not be treated as an authoritative record. This transcript is provided for educational purposes only. Nothing that you read here constitutes investment advice or should be construed as a recommendation to make any specific investment decision. Any views expressed are solely those of the speaker and should not be relied upon to make decisions.
In this video, I want to show you how to limit the number of positions in the same ticker symbol using a very simple automation inside of your bots at Option Alpha.
This is a really useful decision recipe that you can use because often times you may not want to trade more than one or two or a handful positions in the same underlying ticker symbol.
To help with this example, I’ve already pre-built out a very simple demo scanner automation. This demo scanner is just using a couple decisions to get to an open position action. It’s checking to see if S&P’s IV rank is above 60 and if it is, then it’s going to look to open an iron condor position in SPY.
Obviously, these are just examples, you can replace these with whatever decisions and position actions you want, but this helps us with our discussion in video today.
Let’s assume now that we’ve added all the decisions and potential actions to get to this opening position and we’re good to go. We would simply just go out of this and save this automation right into our list of scanners. Now, inside of our bot here, we have not told it to limit the number of positions inside of that particular scanner and certainly we haven’t told it to limit the number of positions of a certain ticker.
Now the first line of defense is always your global settings for your bot. Here we can increase the position limits and the bots always adhere to this global position limits. Right now, we have position limits set at one position per day and one position in total. But if we want to enter more positions, we would increase these limits. Maybe two positions open in a day and two positions opened at one time. When we save this, we now have changed the global settings for this particular bot.
What this does is this allows the bot to enter two positions and if this automation starts running and all of the criteria are met it could actually open two positions in SPY. One position the first time that the automation runs and then another position later on in the day when the automation runs again. If all of the criteria still hold true, it could add two positions in SPY. They could be the same or similar strike prices as the original positions, but for the sake of this video, we’re going to assume that we don’t want to double up on positions.
We don’t want to enter more than one position in a particular ticker symbol. And certainly not if we’re trading an iron condor, which is more of a neutral strategy. We want to enter multiple symbols and give the bot the flexibility to enter one position per symbol. So, here’s how we go about changing this to limit the number of positions in a particular symbol.
The first thing that we’re going to do here is we’re going to make sure that we’re actually using custom inputs. Inside of these decisions and actions that you see here, notice that I’ve already typed in SPY. This means that I’ve basically hard typed in SPY as the symbol I will always trade. This means that this automation, although great, is not as flexible as it could be. So, we simply click on the list of decisions and then we go over to the actual decision recipe.
Notice again SPY is already pre-selected, but instead what I want to do is create a custom input. I want to create a custom input and we’ll call this custom input “Ticker Symbol” so that I can change the ticker symbol on the fly for this automation later. This will help at the end of the video as we kind of bring things all back together and we use multiple automations for different symbols allowing the bot to only enter one position for each. I can set a default symbol for these for sure, which in this case could be SPY and then I simply click save.
Now I’ve created a custom input field that I can reuse moving forward and I go through the prompts and save all of the rest of the fields. Down inside of the action to open the position, I’ve previously done the same thing I did up above which was I hard typed in SPY as the symbol. Well now that I’ve already created a custom input for the symbol field, I can link to that same custom input field and I can attach it here. This means that when I make the change to the symbol, the symbol input field will flow through to all of the different decisions and recipes that use that custom input. Once I’m good to go I simply hit save.
You can confirm this up here in the top left-hand corner where you can see that we do have one custom input called “Ticker Symbol” which is being used two times. So that’s the first thing that you want to make sure you have inside of your automation.
You want to make sure that inside of this automation, you have custom inputs being used so we can reference the ticker symbol inside of our new decision we’re going to add. Now we’re going to go to the very top of our automation and we’re going to click this gear icon and then we’re going to proceed all of these decisions with another decision.
This is where we’re going to add the workflow and logic to make sure that the bot doesn’t already have an existing position before it goes through the progression of entering positions. So here we’re going to go down to our list of recipes that include the bot having a position with an underlying symbol. It’s this one right here and it says “Bot has exactly one position open with symbol."
Notice those fields are all variables. We’re going to select that recipe and then we’re going to say that the bot has exactly zero positions open with a particular symbol. Now this is the way that I do it, you’re free to do it however you want to inside of your automation. But what I want the bot to do is affirmatively declare that the bot has zero positions with this symbol before even gets to the point of potentially entering another position.
So I will set it here as bot has exactly zero positions open with a particular symbol. What symbol do we want? Well, we want to double-check that ticker symbol that we already created, that custom input. Now you can see why using custom inputs is so powerful and so much more efficient.
So, we select that same ticker symbol, we’re going to set here in a little bit. Now we select save and we add this to our decision tree. Now inside of our automation editor you will notice that the first thing that the bot does when it goes through this scanner automation is it checks to see if the bot has exactly zero positions open with that ticker symbol.
If the bot has one position or two or three or four or five or six or seven or whatever it has, it will answer no. It will prevent the bot from going down the "Yes" path that would eventually get to a new position. So, when the bot runs the very first time, if all of these are true, the bot has no positions. The Ticker Symbol’s IV rank is above 60, then it would enter an iron condor order.
But if it runs the next time after that first order is placed, because the bot has the ability to enter two positions, it would stop at this first decision block. That’s because the bot already has, at that point, one position with that same ticker symbol and the answer to that question would be no.
And it will keep checking to make sure that it has one position and as soon as a new spot is opened up, then it would continue down the "Yes" path like normal. This is how you tell the bots exactly how to limit the number of positions of a certain ticker symbol.
And once we’re good with this we simply can exit out of the automation editor and we can go into our list of scanners here and you can choose the actual symbol you want it to run on. So, we’ll choose SPY for this particular one, but we can go in here and we can add multiple scanners to our list of automations.
Once we click the "+" icon, we just tell it what automation we want to add, we’ll add another one of these demo scanners that we just built out and this time we’ll change the ticker symbol to something else, like GLD. Once we change that ticker input again, which flows all the way through the automation, we simply hit save.
Now we’ve got two scanners running; one that’s checking SPY and another that’s checking GLD. And because our bot is setup with global settings that allow for two positions, it is going to allow the bot to enter two positions, but we have that check and balance right inside of the automation itself that prevents the bot from adding both of those positions in the same ticker symbol.
So, each of these symbols will receive one position, so long as all the decisions to get to the open position action are true when the automation start running.
So, this is exactly how you limit the number of positions available inside of your bot based on the ticker symbol that’s being traded.