Bot Event Loops

Bot event loop errors may occur in positions that are triggered by an open position or close position event.

Bots have safeguards and limits that alert you when an automation encounters an error. These safeguards were created to protect traders and require you to think critically about your trade setup from entry to exit.

This tutorial is designed to help you avoid accidentally creating event automations that trigger a “loop” inside a bot.

Bot event loops typically occur in bots that run on event actions. The error can happen if you’re not careful when using open position or close position event actions inside an automation.

Bots have position and capital allocation limits for an important reason. The limits prevent the bot from entering a “looping” scenario where it opens and closes positions beyond the limits you’ve set in the bot’s global settings.

“Open new position” events tell the bot to run an automation only when another position is opened. “Close position” events tell the bot to run an automation when a position is closed.

Bot event actions

Event loops are a unique situation where positions are opened or closed because of related events and subsequently become stuck in a “loop.” 

For example, an event could automatically open a position when another is closed. Closing the position could trigger another event that immediately opens a new position, thereby causing the bot to enter and exit positions in an endless loop.

Open and close events

The event loop will cause the bot to reach its daily and/or total position limit immediately. 

The bot log displays the position limit error after opening the max number of five daily positions.

Event loop error

The limits worked and prevented the bot from opening and closing positions repeatedly.

Bot log error details

The bot event loop error is a specific, deliberate error you can encounter if you’re not careful setting up your event automation actions. 

Be sure to always think through the process when creating your bots, and don’t forget to test your automations and paper trade to avoid these situations!

No tags found.
Was this helpful?

FAQs

Related articles