AlgoHive
Studio

AI Builder

Create and edit trading strategies using natural language with the AI-powered assistant.

The AI Builder lets you create and modify trading strategies using natural language. Simply describe what you want, and the AI assistant will build it for you.

Getting Started

Accessing the AI Builder

  1. Open any strategy in the Studio
  2. Click the Build tab in the right panel
  3. Select AI to open the chat interface
💡Tip

When you create a new strategy, prompt cards appear to help you get started quickly with common strategy types.

Your First AI-Built Strategy

Type a natural language description of your strategy:

Create a BTC strategy that buys when RSI drops below 30 
and sells when RSI rises above 70

The AI interprets your request and generates a complete, working strategy. It handles the details — adding data sources, creating indicators, setting up entry/exit conditions — so you can focus on the logic you want.

📝Note

The AI may structure the strategy differently each time (e.g., combining signals into one block vs. separate blocks), but the end result will match your intent. Always review the generated strategy in the workflow editor.

What You Can Do

Create Strategies from Scratch

Describe your strategy idea in plain English:

Build a trend-following strategy that uses EMA crossover.
Buy when the 9-period EMA crosses above the 21-period EMA,
with a 2% stop loss and 4% take profit.

Add Components

Ask the AI to add specific elements:

Add a MACD indicator to detect momentum
Add a stop loss at 3% below entry price
Add ETH as a secondary data source on the 4-hour timeframe

Modify Existing Strategy

Make changes to your current strategy:

Change the RSI period from 14 to 21
Update the position size to $1000
Remove the take profit rule

Run Backtests

Test your strategy with historical data:

Run a backtest for the last 6 months
Backtest from January 2024 to June 2024

Ask Questions

Get information about your strategy:

What indicators does this strategy use?
Explain how the entry conditions work

Example Prompts

Trend Following

Create a trend-following strategy for BTC that:
- Uses EMA(9) and EMA(21) crossover for entries
- Only trades in the direction of the daily trend
- Has a trailing stop loss of 2%

Mean Reversion

Build a mean reversion strategy that buys ETH when:
- RSI(14) is below 30 (oversold)
- Price is below the lower Bollinger Band
- Close position when RSI rises above 50

DCA (Dollar Cost Averaging)

Create a simple DCA strategy that buys $500 of Bitcoin
every Monday regardless of price

Multi-Indicator

Create a strategy combining multiple signals:
- MACD histogram positive
- RSI between 40 and 60
- Price above 200 SMA
Enter long when all conditions align

Custom Code

Add a custom code block that calculates the average
volume over the last 20 bars and generates a signal
when current volume is 2x higher than average

Expression Syntax Reference

The AI generates strategies using AlgoHive's expression syntax. Understanding these patterns helps you review and refine what gets generated.

Common Expression Patterns

Here are typical expressions the AI might use for common trading concepts:

Crossovers:

cross_above(fast_ma, slow_ma)   # Fast crosses above slow
cross_below(rsi, 70)            # RSI crosses below 70

Comparisons:

rsi < 30                        # RSI below threshold
btc.close > bb_upper            # Price above upper band
volume > SMA(volume, 20) * 1.5  # Volume spike

Trend Detection:

EMA(btc.close, 50) > EMA(btc.close, 200)  # Golden cross state
rising(btc.close, 5)                       # Price rising over 5 bars

Multi-Condition Logic:

trend_up AND momentum_ok AND high_volume   # All conditions must be true
oversold OR at_support                      # Either condition
💡Tip

You can view and edit any generated expressions in the workflow editor. Click on an analysis block to see its outputs and modify them if needed.

Key Expression Functions

These are the common functions the AI uses when building strategies:

FunctionWhat It DoesExample
cross_above(a, b)True when a crosses above bcross_above(fast_ma, slow_ma)
cross_below(a, b)True when a crosses below bcross_below(rsi, 70)
rising(x, n)True when x is higher than n bars agorising(btc.close, 5)
falling(x, n)True when x is lower than n bars agofalling(rsi, 3)

For the complete expression syntax reference, see Expression Syntax.

Best Practices

Be Specific

Good

"Add a stop loss at 2% below entry price with a trailing activation at 1% profit"

Less Clear

"Add some risk management"

Start Simple

Begin with basic strategies and add complexity incrementally:

  1. Start with a single indicator entry
  2. Add exit conditions
  3. Add risk management (stop loss, take profit)
  4. Add filters or additional confirmations

Review Changes

The AI shows you exactly what it's modifying. Review the changes in the workflow editor before running a backtest.

âš ī¸Warning

Always review the strategy logic before deploying to live trading. The AI is a tool to help you build faster, but you're responsible for the final strategy.

Use Backtesting

After making changes, ask the AI to run a backtest:

Run a backtest to see how this performs

This helps validate your strategy logic before deployment.

Understanding AI Actions

Activity Indicators

While the AI works, you'll see activity updates:

StatusMeaning
ThinkingAI is analyzing your request
ExploringReading current strategy state
ModifyingMaking changes to the strategy
ValidatingChecking for errors
TestingRunning a backtest

Tool Operations

The AI uses these operations internally:

  • Add Data Source — Adds market data (BTC, ETH, etc.)
  • Add Analysis — Creates indicator/signal blocks
  • Add Code — Creates custom JavaScript logic
  • Add Entry — Sets up entry conditions
  • Add Manage Rule — Configures stop loss, take profit, etc.
  • Update/Delete — Modifies or removes components

Conversation Management

Thread Persistence

Your conversations are saved automatically. You can:

  • Continue where you left off
  • Start a new conversation for a fresh context
  • Reference previous changes in the same thread

Resuming Conversations

If you return to a strategy after a while, the AI will offer to resume or start fresh:

â„šī¸Info

When resuming an old thread, the AI provides a summary of what was previously discussed.

Context Awareness

The AI always reads your current strategy state before making changes. This means:

  • It knows what components already exist
  • It won't duplicate existing elements
  • It can reference existing blocks by name

Model Selection

You can choose different AI models from the dropdown:

ModelBest For
AutoGeneral use (default)
FastQuick responses, simple tasks
CapableComplex strategies, detailed explanations
📝Note

Different models have different context limits and capabilities. "Auto" selects the best model for your request.

Limitations

What the AI Won't Do

  • Auto-iterate endlessly — It won't keep modifying without your input
  • Silent error correction — It stops and asks if something is wrong
  • Override safety settings — Leverage defaults to 1x for safety

Technical Limits

  • Maximum 15 back-and-forth exchanges per request
  • Context window limits vary by model
  • Complex operations may take 10-30 seconds

When to Use Manual Editing

Some scenarios are better handled in the visual editor:

  • Fine-tuning exact expression syntax
  • Reorganizing block connections
  • Copying components between strategies

Troubleshooting

"Strategy has validation errors"

The AI detected issues with your strategy. Ask:

What are the current validation errors?

Changes not appearing

Make sure to check the workflow editor — changes apply in real-time but you may need to scroll or zoom to see new blocks.

AI seems confused

Start a new conversation to reset context:

Let's start fresh. I want to build a simple RSI strategy.

Tips for Power Users

Batch Operations

You can request multiple changes at once:

Add RSI and MACD indicators, create entry conditions 
when both are bullish, and add a 2% stop loss

Referencing Blocks

Use descriptive names when you have multiple similar components:

Update the "trend_signals" analysis block to use EMA(50) instead of SMA(50)

Complex Logic

For advanced strategies, describe the logic step by step:

I want to build a strategy that:
1. Tracks whale wallet activity using a custom data source
2. Enters long when whales are accumulating
3. Uses ATR-based position sizing
4. Has a trailing stop based on recent swing lows

Let's start with step 1 - add the data source first.
💡Tip

Breaking complex strategies into steps helps the AI understand your intent and gives you checkpoints to verify each part works correctly.

On this page