Troubleshoot Bots

Testing Your Bots

Testing your bots is an important part of the process when creating your portfolio. Here is what you need to know to test your bots quickly and efficiently.
Testing Your Bots
Steve Henry
Jul 27, 2021

Testing your bots inside the Option Alpha autotrading platform is a great way to understand how your bot works, diagnose potential issues, and ensure that automations function correctly and how you intended. It is a good idea to test your bots in a paper trading account before using live capital. We strongly recommend that you continuously test all facets of a bot so that you feel confident your trading strategies are executed properly.

Creating a test bot

To test the functionality of a bot and its automations, create a new bot in the platform. Make sure the bot is set to a paper trading account.

Screenshot of a new bot named Testing My Bot

As with any bot, you can customize the global settings for capital allocation and position limits by selecting the bot dashboard’s gear icon.

Screenshot highlighting the location of the gear icon for global settings

It may be proactive to set higher than normal limits to test different parameters inside your bot.

Screenshot highlighting the allocation and position limits of the bot

The bot will have no positions or log activity when created. The first thing you want to do is add scanner and monitor automations and begin to build out your test bot.

Screenshot displaying scanner and monitor automations added to the bot for testing

REMEMBER: Bots are turned off by default. To turn the bot on, toggle the “On/Off” switch to on. The automations will run on your selected schedule.

Screenshot highlighting the location of the bot's on / off switch

Events

Events are a great way to test bots. If you want to run automations immediately (which may be useful when testing bots, so you don’t have to wait for the next scheduled run time), you can use an Event automation. Bot events are automations that are triggered on a schedule or when something occurs inside the bot.

Screenshot highlighting the button location for adding an event automation

You can run an event immediately by selecting the “Now” button, which instantly triggers an automation.

Screenshot of the choose event display with now highlighted

Choose an automation from your list, assign a ticker, select “Start,” and the bot will run immediately and out of its typical sequence.

Screenshot of the automation display with a selected automation highlighted

The “Log” tab will display the bot’s automations, their last run time, and the number of actions completed.

Screenshot of the bot log display

Selecting an automation displays the action and decision details of the event. This is where you can test the individual decision criteria, make sure the bot is making the decisions you want, and check if the bot has encountered any errors.

Screenshot highlighting the bot log detailed display for an automation

You can select individual fields to view the variables and outcomes considered in the decision-making process.

Screenshot highlighting the decision log display

If an automation results in a new open position, you can select the automation in the log and view why the trade was executed and the entry details. Again, you want to check the logic and make sure the bot is behaving as you intended.

Screenshot displaying the position entry details displayed in the bot log

New positions are immediately listed in the Position statement.

Screenshot of the bot position statement

Once a position has been opened (either with an event or through a scanner automation), it is recommended that you test the bot monitor automations to ensure they manage positions appropriately and proceed through the decisions with the logic you intend.

Screenshot highlighting monitor automations

Monitors

You may want to deliberately open specific types of positions (i.e. a credit call spread) to test certain monitors. This is not recommended for a live account, but it is a good idea to test all of your monitor automations for different strategies.

To force open a position immediately, select “Open Position” from the Positions tab.


Screenshot highlighting the location of the open position button on the position statement

You can open a brand new position manually and choose a strategy type to monitor.

Screenshot displaying the various position types for a monitor automation

If you open a position manually with the button or through an event, the position will be active inside the bot, even if the bot is turned off. You can manually exit the position if the bot is off as well. However, you must turn the bot on to activate monitor automations for automated position management.

For example, if you have a credit call spread monitor, you could open a credit call spread and allow the monitor to manage the position. You can select the monitor automation to observe the decision criteria.


Screenshot of the monitor automation's automation editor

You may also deliberately open a different type of position to test if the monitor automaton is managing correct positions only. If the bot runs correctly, the monitor should only run on compatible positions. For example, the Call Spread Manager monitor automation only ran on the one credit call spread positions, despite the bot having four open positions.

Screenshot highlighting the ability to click through the positions monitored by the monitor automation

Buttons

You can also use Buttons inside the Events automations to open and close positions with the click of a button.

Screenshot highlighting the location of the button click event in the choose event display

Buttons run automations inside the bot. You can choose the ticker the automation will run on, name your button, and create a brief description.

Screenshot of the button click settings display

From the bot homepage, you can now run the assigned automation instantly when you select the button.

REMEMBER: The bot must be turned on for the button to work.

Screenshot highlighting the location if the on / off switch and new button

Check the Log to make sure that the Button worked.

Screenshot of the bot log displaying the button click timestamp and details

You can manually exit a position instantly if you need to create space in your portfolio to test more automations in the bot. Simply choose the position you want to close from the Position statement and select “Close Position” from the top right corner of the page.

Screenshot highlighting the location of the close position button on the position statement
No tags found.
Next article
Not Enough Capital Error
The “not enough capital” error occurs when there is not enough capital for a bot to enter a new position. Here is what you need to know about not enough capital errors.
Was this helpful?
FAQs

What is the best way to test a bot?

When building an automation, there is a "test" button toward the upper right of the automation page that allows you to run through your various automation steps and see the result from each step. In addition, you can go to the bot homepage, select Automations, select the lightning bolt icon in the upper left, and then manually select which automation you want to run. Then, you may look at the log to see the corresponding results of that run.

Do automations have to be turned on for me to run an automation with a button click?

Your bot does not have to be turned on for you to run an automation using a button click or the lightning bolt.

Can I test all of my bot variables and decisions or only certain ones?

You can test every aspect of an automation or bot manually using a button click or in paper trading mode to see how it reacts to the markets in real-time.

What is the difference between backtesting and forward-testing?

Backtesting is the process of testing a strategy’s performance with historical data. While backtesting can certainly be valuable, it can also be manipulated by putting in filters and removing bad trades or bad runs. These results then end up being "curve fit" and tend not to be as robust.

Forward-testing is where a person creates a set of specific rules at a given point in time and then implements them against all new data going forward to evaluate their effectiveness. Forward testing is less prone to being manipulated or curve fit.

How can I see if the logic in my bot flows as expected?

The automation editor uses a "decision tree" framework where each step generates a "yes" or "no" answer and you can add subsequent steps for the bot for each of the respective paths.

Should I always test my bots in paper trading first?

Yes, we believe that every bot should be run in paper trading mode first and ideally through a wide range of market conditions and cycles. The trader can be comfortable that the bot is performing as expected in a variety of conditions before live trading.

How can I force an automation to run to see how it will behave when it runs in the future?

There are two ways that you can test an automation. As you are building an automation there is a "test" button toward the top right corner of the automation editor. The other option is that you can test at the bot level by clicking the lightning bolt and selecting an automation to run.

Can I see the actual decisions, values, or properties of each action inside automations?

Yes. Whether you run your automation using the test button as you are building it or by using the lightning bolt to run it after you have built your bot, you will have an automation log where you can select each decision step and see the actual values on each respective condition.

How can I instantly or manually open or close a position for testing purposes?

To instantly open a position without waiting for an automation interval, go to the Positions tab and in the Active Positions section, select the "+" icon and define the position you wish to open. If you want to open a position using an automation, go to the Automations tab and select the lightning bolt. Then, identify the automation you wish to run, with the understanding that if the conditions of your automation recipe are not met, a position may not be opened.

Can I manually open or close a position even if the bot's automations are turned off?

Yes, even if your bot is turned off, you can manually open a position under the Positions tab by clicking the "+" and defining the position you wish to open. You can also select the Automations tab and click the lightning bolt icon and run your preferred automation.  Running an automation will only result in the opening of a new position if all of the criteria of your automation have been met.

What are "buttons," and how can I use them for testing my bots?

A button can be used to run any automation you have in your bot or create any order you might want. For example, users who trade complex options positions may set all of their entry conditions with buttons so that when they click the button, the complex order is sent.

How long should I paper trade a bot before live trading?

The answer to this question will vary by user and, of course, by how often your bot enters positions. We recommend that bots be traded in paper trading mode through a number of market cycles and trades, but the actual number of trades is a personal preference.

Related articles

Trade smarter with automation