Use the Arena workflow builder to specify your trading conditions and execution steps. The visual configuration serves as the input specification for AI code generation.
📖
How It Works
1
Define Strategy Logic in the Builder
Use the Arena workflow builder to specify your trading conditions and execution steps. The visual configuration serves as the input specification for AI code generation.
2
Select AI Model for Generation
Choose which AI model provider will generate your strategy code. Different models may produce varying code styles and optimization approaches based on their training.
3
Submit for Code Generation
Click the Generate Code button to send your strategy parameters to the AI engine. The system translates your visual workflow into a structured prompt for the selected model.
4
Monitor Generation Progress
Watch the real-time progress indicator as the AI processes your strategy. Complex multi-condition strategies with multiple indicators may take longer to generate.
5
Review Generated Python Code
Examine the generated Python code in the syntax-highlighted code viewer. The code follows Backtrader framework conventions and includes comments explaining each strategy component.
6
Execute or Iterate on the Code
Run the generated code directly through the backtest engine to validate its performance, or modify the workflow conditions and regenerate to explore different strategy variations.
ℹ️
Note
Code Generation converts your visual strategy configurations into executable Python code using AI models for backtesting and analysis
💡
Tips & Best Practices
💡
Tip
Define clear and specific strategy conditions in the workflow builder before generating code — vague configurations lead to generic or overly broad trading logic
💡
Tip
Always review the generated code line by line to verify that entry signals, exit conditions, and position sizing match your intended strategy before running a backtest
💡
Tip
Try generating code with different AI models for the same strategy to compare approaches — each model may implement indicators or exit logic differently
❓
Frequently Asked Questions
What programming language and framework does the generated code use?
All generated code is Python using the Backtrader framework. This is the standard framework used by the platform's backtest engine, ensuring seamless execution without any additional setup or library installation.
Can I manually edit the generated code before execution?
Yes, the generated code is fully editable in the code viewer. You can modify indicator parameters, adjust entry/exit logic, add custom conditions, or refactor the structure. Any manual edits are preserved until you regenerate from the workflow builder.
How many credits does code generation consume?
Code generation credit cost depends on the AI model selected and the complexity of your strategy. GPT-4 and Claude models typically consume more credits than lighter models. Check your credits balance on the Billing page before generating.
⚠️
Important Notes
⚠️
Warning
AI-generated code should be thoroughly reviewed and backtested before any live trading application. The AI may produce code with logical errors or suboptimal implementations. Past backtest performance does not guarantee future results.
Was this page helpful? Your feedback helps us improve the documentation.