AI Strategy Builder
Describe your trading strategy in plain English and let AI generate production-ready TradeStaq code. The AI Strategy Builder (FORGE) provides a complete chat-to-code-to-test-to-deploy workflow, eliminating the need to write strategy code manually.
What is FORGE?
FORGE is TradeStaq's AI-powered strategy creation tool. It uses a conversational interface where you describe your trading idea, and the AI generates a fully functional TradeStaq strategy that you can test and deploy immediately.
Instead of learning the TradeStaq API and writing JavaScript by hand, you simply explain what you want:
- "Build a strategy that buys when RSI crosses below 30 and sells when it crosses above 70"
- "Create a scalping strategy using Bollinger Bands with a 2% trailing stop"
- "Convert my Pine Script EMA crossover strategy to TradeStaq"
The AI handles the code generation, and you refine it through follow-up messages until the strategy matches your intent.
How to Access
Navigate to the AI Builder from your dashboard:
Dashboard -> Strategies -> AI Builder
You can also access it from the strategy creation wizard by selecting the "AI Builder" method.
The FORGE Workflow
┌─────────────────────────────────────────────────────────────────┐
│ AI STRATEGY BUILDER (FORGE) │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Describe │───▶│ AI Generates │───▶│ Test Strategy │ │
│ │ Your Idea │ │ Code │ │ (Quick / Full) │ │
│ └──────────────┘ └──────┬───────┘ └────────┬─────────┘ │
│ ▲ │ │ │
│ │ │ ▼ │
│ │ ┌──────▼───────┐ ┌──────────────────┐ │
│ └────────────│ Review & │ │ Deploy Bot │ │
│ (Refine) │ Iterate │ │ (Live/Paper) │ │
│ └──────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Step by Step
- Describe Your Idea - Type your strategy concept in plain English in the chat panel
- AI Generates Code - FORGE produces TradeStaq-compatible JavaScript in the code editor
- Review and Iterate - Read the code, ask the AI to adjust parameters, add indicators, or change logic
- Test the Strategy - Run a Quick Test (instant 7-day backtest) or a Full Backtest with custom date ranges
- Deploy as a Bot - Save the strategy and deploy it to a live or paper trading bot
Key Capabilities
| Capability | Description |
|---|---|
| Natural Language to Code | Describe a strategy idea in plain English and receive working TradeStaq code |
| Strategy Conversion | Convert existing strategies from Pine Script, MQL5 (MetaTrader), or Gunbot format into TradeStaq |
| Quick Test | Run an instant 7-day backtest directly from the editor to validate strategy logic |
| Full Backtest | Save the strategy and run a comprehensive backtest with custom date ranges and timeframes |
| Image Upload | Upload chart screenshots for the AI to analyze patterns and incorporate them into strategy logic |
| Candle Data Attachment | Attach live candle data from your connected exchanges so the AI can identify patterns in real market conditions |
| Conversation Persistence | Conversations are saved automatically, allowing you to resume strategy development across sessions |
| Live Code Editor | Built-in Monaco editor with syntax highlighting, so you can manually edit AI-generated code at any time |
Strategy Conversion
Already have a strategy written for another platform? FORGE can convert it to TradeStaq format.
| Source Format | Description |
|---|---|
| Pine Script | TradingView strategies and indicators |
| MQL5 | MetaTrader 5 Expert Advisors and indicators |
| Gunbot | Gunbot custom strategy configurations |
To convert a strategy, paste the source code into the chat and ask FORGE to convert it. The AI will analyze the logic and produce an equivalent TradeStaq implementation.
Testing Modes
The AI Builder includes two testing approaches so you can validate strategies without leaving the editor.
Quick Test
Quick Test runs an instant 7-day backtest against recent market data. It is designed for rapid iteration: generate code, test it, adjust, and test again.
| Aspect | Detail |
|---|---|
| Duration | Last 7 days of candle data |
| Speed | Near-instant results |
| Metrics | Total return, win rate, trade count, max drawdown, profit factor |
| Chart | Equity curve with entry/exit markers |
| Use Case | Fast validation during strategy development |
Full Backtest
Full Backtest requires saving the strategy first. It runs a comprehensive simulation with configurable date ranges, timeframes, and trading pairs.
| Aspect | Detail |
|---|---|
| Duration | Custom date range (depends on your plan) |
| Configuration | Choose pair, timeframe, and parameters |
| Metrics | Complete performance report including Sharpe ratio, Sortino ratio, and equity curve |
| Use Case | Thorough validation before deploying live |
For more detail on backtesting, see the Backtesting documentation.
The Interface
The AI Builder interface is split into two resizable panels:
| Panel | Purpose |
|---|---|
| Chat Panel (left) | Conversational interface for describing strategies, asking questions, and iterating on code |
| Code Editor (right) | Monaco-based editor displaying the generated strategy code, with Quick Test controls and results |
You can resize the panels by dragging the divider, and the layout is remembered across sessions.
Conversation History
Previous conversations are saved automatically. Use the sidebar to:
- Resume a conversation - Continue refining a strategy from where you left off
- Start a new conversation - Begin a fresh strategy idea
- Review past strategies - Look at code generated in previous sessions
Subscription Requirements
The AI Strategy Builder is available on select subscription plans. Feature access, including prompt limits, image uploads, and candle data attachment, varies by tier. Check your plan's feature list for details on what is included.
Next Steps
- Getting Started - Create your first AI-generated strategy
- Testing - Learn about Quick Test and Full Backtest workflows
- Advanced Features - Image uploads, candle attachments, and strategy conversion
Related Guides
- Custom Strategies — write strategies manually in JavaScript
- Backtesting — test AI-generated strategies on historical data
- Trading Bots — deploy your AI-built strategy as a bot
- Strategy Examples — see what strategies look like