Understanding Webpage Error Codes on TBOT on TradingBoat

Background

 The TradingBoat platform features a structured process designed to handle trading alerts and orders through the TBOT system. This process is divided into four key stages: Alert, Orders, TBOT, and Errors, with each stage represented by a dedicated webpage. The transition from Stage 1 (Alert) through to Stage 4 (Errors) follows a sequential order.

Stage 1: Alert

When an alert is received by TBOT on TradingBoat, it is initially scrutinized based on the ALERTSTAT column, which indicates the validity of the webhook message from two distinct perspectives. If the message meets the criteria for validity, TBOT will proceed to place an order using the ib_insync API, and the action is then reflected on the Orders page.

Validating Webhook Messages

Validation of the webhook messages involves two key checks:

  • Syntax Validation: The message must have a valid syntax.
  • Contextual Validation: The message must carry meaningful content in terms of order type.

Syntax Validation

If a webhook message fails to meet these criteria, error codes such as EBADMSG (Bad Message), ENOTSUP (Not Supported), and EBADORDTP (Bad Order Type) will be displayed. An example of such an error is EBADORDTP, indicating an "Error: Bad Order Type." Messages with this status will be disregarded and not progressed to the order stage. Users encountering this error should review their message format, especially if using PineScript.

Contextual Validation

The contextual validation involves further validation, particularly when updating bracket orders (e.g., Profit-Taker and Stop-Loss orders). Errors like ENOOPENDB indicate that updates to these orders are invalid, possibly because the orders have already been executed and then filled. In such cases, TBOT conducts a double-check by first verifying the open order in the local database and then using the ib_insync API to ensure the order's validity before any updates are made.

 

For additional information on status codes and their meanings, users can refer to the TBOT on TradingBoat GitHub repository:

Stage 2: Orders

The second stage of the TBOT on TradingBoat framework, Orders, is critical for transforming validated alerts into actionable trading orders. This stage is characterized by its integration with the IB Insync API, which plays a pivotal role in the management and monitoring of orders.

You can find the status codes of the second stage here:

API docs — ib_insync 0.9.86 documentation

 

Stage 3: TBOT

The TBOT stage involves an SQL join between the Alerts and Orders stages, allowing users to track orders that have successfully transitioned through the system. This integration provides a seamless tracking experience for the user, ensuring that only valid and successfully processed orders are displayed.

Stage 4: Errors

The final stage focuses on errors that occur during runtime, specifically those originating from the Interactive Brokers Servers. These errors reflect issues encountered during the order execution process. Users can consult the Interactive Broker API documentation to understand and resolve these errors.

This structured approach ensures that each step of the trading alert and order process is meticulously vetted, reducing the likelihood of errors and ensuring a smoother operation within the TBOT system on TradingBoat.

Further details and procedures, I highly recommend referring to the comprehensive Udemy course available here: Link to Udemy Course.

Subscribe to TBOT on TradingBoat

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe