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

  1. Describe Your Idea - Type your strategy concept in plain English in the chat panel
  2. AI Generates Code - FORGE produces TradeStaq-compatible JavaScript in the code editor
  3. Review and Iterate - Read the code, ask the AI to adjust parameters, add indicators, or change logic
  4. Test the Strategy - Run a Quick Test (instant 7-day backtest) or a Full Backtest with custom date ranges
  5. Deploy as a Bot - Save the strategy and deploy it to a live or paper trading bot

Key Capabilities

CapabilityDescription
Natural Language to CodeDescribe a strategy idea in plain English and receive working TradeStaq code
Strategy ConversionConvert existing strategies from Pine Script, MQL5 (MetaTrader), or Gunbot format into TradeStaq
Quick TestRun an instant 7-day backtest directly from the editor to validate strategy logic
Full BacktestSave the strategy and run a comprehensive backtest with custom date ranges and timeframes
Image UploadUpload chart screenshots for the AI to analyze patterns and incorporate them into strategy logic
Candle Data AttachmentAttach live candle data from your connected exchanges so the AI can identify patterns in real market conditions
Conversation PersistenceConversations are saved automatically, allowing you to resume strategy development across sessions
Live Code EditorBuilt-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 FormatDescription
Pine ScriptTradingView strategies and indicators
MQL5MetaTrader 5 Expert Advisors and indicators
GunbotGunbot 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.

AspectDetail
DurationLast 7 days of candle data
SpeedNear-instant results
MetricsTotal return, win rate, trade count, max drawdown, profit factor
ChartEquity curve with entry/exit markers
Use CaseFast 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.

AspectDetail
DurationCustom date range (depends on your plan)
ConfigurationChoose pair, timeframe, and parameters
MetricsComplete performance report including Sharpe ratio, Sortino ratio, and equity curve
Use CaseThorough 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:

PanelPurpose
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