Tutorials > Debug A Strategy
AI-Powered Strategy Debugging
This tutorial will guide you through the essential steps to debug your strategy with AI Automation.
1. Sign In to Launch BotiTrader
- Open the software after installation.
- Enter your registered email and password, then click "Sign In".
- Once signed in, you will see the main interface.
2. Select an Existing Strategy in the Backtest Window
- In the Main window, at the top of the charting window, click "Create Trading Bot".
- The Backtest window will appear.
- On the left side of the Backtest window, click to select your desired strategy from the Strategy List.
3. Run a Backtest
- In the Backtest window, at the bottom of the left panel, click "Start Backtest" to run a backtest.
- If there is an error in the strategy code, the error will appear in the Running Logs section at the bottom.
- At the top of the Backtest window, click the "AI Automation Assistant" button, and the AI Automation Assistant window will appear.
4. Debug the Strategy (If Errors Occur)
- In the popped-up AI Automation Assistant window, select "Fix the Error" in the "AI Automation Mode" section at the top right.
- In the User Input section, you'll see error messages if they occur. These messages will only be imported if you run a backtest and errors are present in the strategy code.
- In the bottom left corner, input the following settings parameters:
- Timeout (seconds): Sets the timeout for the automation process in seconds.
- Max regenerate attempts: If the generated code doesn’t change after an attempt, ChatGPT will regenerate the code. This parameter defines the maximum number of regeneration attempts.
- Max debug attempts: If errors occur in the strategy code, ChatGPT will attempt to debug and fix them. This parameter defines the maximum number of debug attempts.
- In the bottom left corner, click "Start AI Automation", and ChatGPT will begin debugging the error. Wait for the final result, and track progress in the AI Automation Logs section in the bottom right corner.
- Success: A green message will appear in the AI Automation Logs.
- Failure: A red message will appear in the AI Automation Logs. If the process fails, repeat the steps to try again.