AI Strategy Builder
The AI Strategy Builder is one of Stratifyre’s most powerful features. Instead of manually configuring every condition and parameter, you can describe your trading idea in everyday language and the AI will generate a fully structured strategy for you – complete with entry rules, exit rules, indicators, and position sizing.
How it works
Section titled “How it works”- You describe your idea. Type a plain-English description of the strategy you want to build into the AI prompt field.
- The AI interprets your intent. Stratifyre’s AI engine (powered by multiple large language models including Gemini, DeepSeek, and OpenAI) analyzes your description and identifies the indicators, conditions, thresholds, order types, and risk parameters that match your intent.
- Rules are generated. The AI creates a complete set of entry rules, exit rules, and risk-management settings in Stratifyre’s visual rule format.
- You review and refine. The generated rules appear in the standard visual rule builder, where you can adjust any detail – change an indicator period, swap an operator, tweak a threshold, or add additional conditions.
The AI does the heavy lifting of translating your idea into the right structure, and you stay in full control of the final result.
Accessing the AI builder
Section titled “Accessing the AI builder”From the strategy creation screen, click the AI Builder button (or look for the “Describe your strategy” prompt area at the top of the rule builder). Type or paste your description and click Generate.
Example prompts
Section titled “Example prompts”Here are examples of the kinds of descriptions the AI understands, ranging from simple to advanced:
Simple trend following
Section titled “Simple trend following”“Buy when the 20-day SMA crosses above the 50-day SMA. Sell when it crosses back below. Use a 2% stop loss.”
The AI will create:
- An entry rule using the SMA crossover condition with the “crossing up” operator
- An exit rule for the reverse crossover
- A stop-loss rule based on 2% of entry price
RSI mean reversion
Section titled “RSI mean reversion”“Buy when RSI drops below 30 and price is above the 200-day moving average. Sell when RSI rises above 70. Risk 1% of my account per trade.”
The AI will create:
- An entry rule with two conditions (RSI below 30 AND price above SMA 200)
- An exit rule for RSI above 70
- Position sizing based on 1% account risk
Multi-indicator approach
Section titled “Multi-indicator approach”“Go long when MACD histogram turns positive, RSI is between 40 and 60, and volume is above its 20-period average. Exit when MACD histogram turns negative or price drops 3% from entry. Set stop loss at 1.5 times ATR below entry.”
The AI will create:
- An entry rule with three conditions (MACD histogram, RSI range, volume filter)
- Two exit rules (MACD reversal, percentage-based stop)
- An ATR-based stop-loss calculation
Bollinger Band squeeze breakout
Section titled “Bollinger Band squeeze breakout”“Wait for Bollinger Band width to contract below 4%, then buy when price closes above the upper band. Take profit at 2 times ATR from entry. Stop loss at the middle band.”
Multi-timeframe strategy
Section titled “Multi-timeframe strategy”“Only trade in the direction of the daily trend (price above daily 200 SMA). On the 15-minute chart, buy when Stochastic K crosses above 20 from oversold. Exit when Stochastic K crosses below 80.”
Market structure approach
Section titled “Market structure approach”“Buy when price fills a bullish fair value gap and RSI is below 40. Exit at the nearest swing high. Stop loss below the fair value gap low.”
Tips for getting the best results
Section titled “Tips for getting the best results”Be specific about indicators and parameters
Section titled “Be specific about indicators and parameters”The more detail you provide, the closer the output will match your intent.
| Less specific | More specific |
|---|---|
| “Use a moving average crossover” | “Buy when the 20-period EMA crosses above the 50-period EMA” |
| “Add a stop loss” | “Set the stop loss at 1.5 times ATR(14) below the entry price” |
| “Exit when profitable” | “Exit when the position is up 3% or when RSI rises above 65” |
Include all four components
Section titled “Include all four components”The best prompts mention:
- Entry conditions – When to open a position
- Exit conditions – When to close (both profit-taking and stop-loss)
- Position sizing – How much to trade
- Instruments and timeframe (optional) – What to trade and on what chart
Use indicator names the AI recognizes
Section titled “Use indicator names the AI recognizes”The AI understands all 106 indicators available in Stratifyre. You can use common names or abbreviations:
- “RSI,” “Relative Strength Index,” or “RSI(14)” all work
- “Bollinger Bands,” “BBands,” or “BB” all work
- “MACD,” “Moving Average Convergence Divergence” – both work
- “SMA,” “Simple Moving Average,” “50-day moving average” – all understood
Describe the logic, not the implementation
Section titled “Describe the logic, not the implementation”Focus on what you want to happen, not how to build it:
- Good: “Buy when price breaks above the previous day’s high with strong volume”
- Less useful: “Set the left-hand side to daily high with offset 1 and use the less-than operator with price on the right side” (the AI works best with natural descriptions)
Why the AI decomposes your strategy into many small rules
Section titled “Why the AI decomposes your strategy into many small rules”If you describe a seemingly simple strategy and the AI produces eight small rules instead of two big ones, that is by design, not a limitation. Stratifyre’s rule model is built around small, composable rules connected by custom variables rather than deeply nested boolean logic, and the AI is trained to generate strategies that match this style.
For example, “enter when either RSI is oversold AND price is above the 200-day SMA, or price breaks resistance AND volume confirms” will typically produce:
- A helper rule that sets
vars.pullbackSignal = 1when the first pair of conditions is met - A helper rule that sets
vars.breakoutSignal = 1when the second pair is met - A single entry rule that fires when either flag is set
This looks like more rules than necessary, but it is actually the most debuggable, most readable, and most maintainable form. You can inspect each helper flag independently in the backtester to see exactly which branch triggered your entry — something a single nested expression cannot offer. See Expressing complex boolean logic in the Rules guide and Why variables exist in the Expressions guide for the full rationale.
The same pattern applies to:
- Sequential setups — “X happens, then Y” becomes a latch variable set by one rule and consumed by another.
- Multi-step confirmation — “Wait for 3 consecutive rising-volume bars” becomes a counter variable.
- Stateful stops — “Trail the stop behind the highest high since entry” becomes a high-water-mark variable updated each bar.
Browse the Strategy Cookbook to see the full catalog of patterns the AI draws on when decomposing your description.
Refining AI-generated rules
Section titled “Refining AI-generated rules”After the AI generates your strategy, you will see the rules in the standard visual builder. From here you can:
- Adjust indicator parameters – Change periods, sources, or multipliers by clicking on any indicator in a condition.
- Swap operators – Change “is greater than” to “crosses above” or any other operator.
- Add or remove conditions – Layer on extra filters or simplify rules that have too many conditions.
- Change order types – Switch from Market to Limit, add bracket orders, or adjust time-in-force. See Order Types.
- Modify position sizing – Fine-tune the quantity calculation or risk percentage.
- Add new rules – The AI gives you a starting point; you can add as many additional rules as you like.
Limitations
Section titled “Limitations”The AI Strategy Builder is powerful, but it is helpful to understand its boundaries:
- It generates rules, not guaranteed profits. The AI translates your description into Stratifyre rules faithfully, but whether the strategy is profitable depends on the underlying trading idea and market conditions. Always backtest before deploying.
- Complex multi-leg strategies may need manual editing. If your strategy involves intricate interactions between many rules, the AI may get the broad strokes right but miss some nuances. Review and adjust.
- It works best with well-known trading concepts. Standard technical analysis patterns, indicator-based strategies, and common risk-management approaches yield the best results. Highly novel or abstract ideas may need more manual refinement.
- Ambiguous descriptions produce ambiguous results. If your prompt is vague (“make me a profitable strategy”), the AI will make reasonable assumptions, but the output may not match what you had in mind. Be specific.
Frequently asked questions
Section titled “Frequently asked questions”Can I use the AI builder to modify an existing strategy? Yes. Open your existing strategy, click the AI Builder button, and describe the changes you want to make (for example, “Add a trailing stop loss based on 2x ATR” or “Change the entry to use EMA instead of SMA”). The AI will update your rules accordingly.
Does the AI pick the best indicator parameters for me? The AI uses commonly accepted default parameters (like RSI period 14, Bollinger Band period 20) unless you specify otherwise. For optimized parameters, use Stratifyre’s backtesting and optimization tools after generating your initial rules.
Can I describe a strategy in non-English languages? The underlying language models support multiple languages, but English descriptions currently produce the most accurate results. Support for additional languages is improving over time.
