This guide explains the standard framework for writing prompts that convert trading strategies into algorithms. By clearly defining indicators, Price Action concepts, and entry and exit rules, you can execute your strategy in Algobuild without ambiguity.

01 Getting Started

When creating a new AlgoBuild, you will begin by configuring a few foundational parameters on the setup page:

  • Name — Give your AlgoBuild a unique name
  • Markets — Select the instruments you want your algorithm to trade.
  • Primary Time Frame — This is your strategy's default time frame. Any indicator or condition mentioned in your prompt without an explicit time frame reference will be interpreted against this setting. For multi-timeframe strategies, you will reference additional time frames directly in your prompt (covered below).
  • Max Simultaneous Positions — Define how many positions can be open at the same time. If your strategy has no limit, enter a large number.
  • Order Type — Specify whether your strategy uses Market orders, Limit orders, or a Mix of both.
  • Cancellation Window — If your strategy uses Limit or Mixed order types, set the time window after which an unfilled limit order will be automatically cancelled.

02 Describing Your Strategy

In the Signal-Based Execution Engine, your strategy description should focus exclusively on entry conditions and their corresponding exit conditions. Position sizing, capital allocation, and risk management parameters are all configured separately in AlgoRun when you go live.

Your strategy is built around two core concepts: Triggers and Entry/Exit Levels.

03 Triggers

A trigger is the set of conditions that must all be simultaneously true for an entry order to be placed. You define a long trigger for buy entries and a short trigger for sell entries.

Simple Example

prompt.txt — simple trigger

"A long trigger is formed whenever the Moving Average(50) crosses above the Moving Average(200)."

Complex Example

prompt.txt — complex trigger

"A long trigger is formed when all of the following conditions are met simultaneously:

  1. A bullish engulfing candlestick pattern has formed (defined precisely below)
  2. Price is within a support zone (defined precisely below)
  3. On the 4H time frame (higher time frame), the price is above the Moving Average(50)
  4. The most recent US interest rate announcement occurred within the last 15 days, and the announced rate was higher than the previous announcement."

The key principle is precision. The more exactly you define each condition — numerically and descriptively — the more accurately your algorithm will be built. Vague descriptions produce imprecise results.

What You Can Use in a Trigger

You can use any combination of the following in your trigger conditions:

1 · Technical Analysis

Any indicator or price-based concept is supported, including: indicators (RSI, MACD, Moving Averages, Bollinger Bands, ATR, Stochastic, CCI, ADX, Ichimoku, VWAP, and many others), price action patterns (engulfing candles, pin bars, inside bars, doji, hammer, shooting star, and others), Smart Money Concepts (Break of Structure, Change of Character, Fair Value Gap, Order Block, liquidity sweep, displacement), chart patterns (head and shoulders, double top/bottom, wedge, flag, pennant, triangle, and others), Elliott Wave theory (impulse and corrective waves, Fibonacci retracement and extension levels), support and resistance (horizontal levels, dynamic trendlines, supply and demand zones), and volume analysis (volume profile, OBV, accumulation/distribution).

Important: Always define every concept precisely. For example, if your trigger references a "support zone," specify it in full — for instance: "A zone no wider than 3×ATR(14), within which at least 2 Pivot Low(20) formations exist over the last 500 candles, and below whose lower boundary price has never closed in the last 500 candles." Similarly, always specify all indicator parameters explicitly — e.g., Moving Average(50), not just "Moving Average."

2 · Fundamental & Economic Calendar Data

You can reference any macroeconomic event or data release from the economic calendar — including interest rate decisions, inflation figures, employment reports, GDP releases, and more — for any country in the world. You can use the release date, and the actual, previous, and estimated values in your conditions.

3 · Intermarket Relationships

You can incorporate signals from other markets into your trigger. For example:

  • Long trigger for SOLUSDT: S&P 500 closes higher for 3 consecutive days as a risk-on confirmation
  • Long trigger for USDJPY: BTC dominance drops below 50% while the S&P 500 is in an uptrend
  • Short trigger for XRPUSDT: Gold breaks above its 30-day high, signaling risk-off conditions

Any combination of relationships across forex, crypto, equities, bonds, and commodities is supported.

4 · Quantitative & Statistical Concepts

You can use any statistical or quantitative logic, such as mean reversion to a rolling average, Z-score threshold crossings, cointegration-based entry conditions between two correlated symbols, spread normalization triggers, momentum factor signals, volatility regime filters (realized vs. implied volatility), or statistical breakout detection.

Important: Describe the logic as if you were explaining it to a developer who will translate it into code. Be explicit about every calculation, threshold, and condition. High-level descriptions will produce inaccurate results.

You can freely combine any of the four categories above to create complex, multi-layered trigger conditions.

04 Entry Levels

Once your trigger fires, you need to define exactly how your algorithm enters the trade. Entry orders can be Market orders (executed immediately at the current price) or Limit orders (executed at a better, predefined price).

Examples

prompt.txt — entry levels
  • "When the long trigger fires, immediately enter with a market order."
  • "When the long trigger fires, place a limit buy order 3×ATR(14) below the current price."
  • "When the short trigger fires, immediately open a short market order, and simultaneously place two short limit orders — one at 0.5% above the current price and one at 3% above the current price."

Note on position sizing: Do not specify capital allocation or position size here. That is configured in AlgoRun at the time of going live, using the leverage parameter. In AlgoRun, a single leverage value applies uniformly to all positions opened by the algorithm. If your strategy requires unequal allocation across multiple entry levels, you can simulate this by decomposing entries into multiple equal-sized positions (see the note on position splitting below).

05 Exit Levels

For every entry level defined, you must specify a corresponding exit. Exits can be defined (fixed take profit and stop loss levels known in advance) or conditional (exits triggered when a dynamic condition is met).

Examples of Defined Exits

prompt.txt — defined exits
  • "Stop loss at 0.3% below entry price; take profit at 0.6% above entry price."
  • "Stop loss at 1% below entry; take profit at 2% above entry. Once price moves 1.5% in our favor (i.e., 0.5% from take profit), move stop loss to breakeven."
  • "Apply a 0.7% trailing stop."

Examples of Conditional Exits

prompt.txt — conditional exits
  • "Exit when RSI crosses above 70."
  • "Exit when RSI crosses above 70 on the primary time frame, a bearish engulfing candle forms on the 4H time frame, and the latest Swiss unemployment rate is higher than the previous month's reading."

Each entry level must have one clearly defined exit. Once all entry and exit levels are specified, your algorithm is complete.

06 Backtesting & Validation

After building your AlgoBuild, your strategy is automatically backtested against historical data. Results are presented as a visual chart with all entry and exit points plotted, alongside an Excel file containing the full trade log. Review both carefully to confirm that your algorithm behaves exactly as intended. If the results match your expectations, you are ready to go live via AlgoRun.

07 Additional Notes

Multi-Timeframe Strategies

Your primary time frame is the default context for all conditions in your prompt. To use additional time frames, reference them explicitly and label them (e.g., "higher time frame" or "lower time frame").

Example (primary time frame: 15m)

prompt.txt — multi-timeframe

"Long trigger: whenever Moving Average(14) crosses above Moving Average(50), and simultaneously on the 4H time frame (higher time frame) price is above Moving Average(200)."

The Moving Average(14) and (50) apply to the 15m time frame; the Moving Average(200) applies to the 4H time frame.

Simulating Scaled Entries and Exits

The Signal-Based Execution Engine executes each position as a complete open-and-close cycle — partial entries and partial exits within a single position are not supported. However, both can be closely approximated by splitting into multiple equal-sized positions:

  • Scaled entries: Instead of entering with varying capital at different levels, split the intended allocation into multiple equal positions. For example, set leverage to 0.1 in AlgoRun and instruct the prompt to open 2 market orders immediately on trigger, 3 limit orders at 0.2% below current price, and 5 limit orders at 3% below current price.
  • Scaled exits: Instead of partially closing a single position, open multiple equal-sized positions at the same entry level and close them individually at different exit conditions over time.

08 Example Strategy Prompt

Disclaimer: This is a purely hypothetical strategy created for illustrative purposes only. The combination of conditions used here is intentionally complex, which means trade signals may be extremely infrequent — or may not occur at all during backtesting. Do not copy or use this strategy for live trading.

ParameterValue
NameBTC Momentum Reversal
MarketsBTCUSDT
Primary Time Frame1H
Max Simultaneous Positions2
Order TypeMixed
Cancellation Window14400 seconds
Long Trigger All conditions simultaneously true
  1. RSI(14) on the 1H time frame has crossed above 30 from below (oversold recovery)
  2. The last completed candle on the 1H time frame is a bullish engulfing candle, defined as: the body of the current candle fully engulfs the body of the previous candle, the current candle closes green, and the current candle's body is at least 1.5× the body of the previous candle
  3. Price is within a support zone, defined as: a price range no wider than 2×ATR(14), within which at least 2 Pivot Low(20) formations exist over the last 300 candles, and below whose lower boundary price has never closed in the last 300 candles
  4. On the 4H time frame (higher time frame), the price is above the Moving Average(200)
  5. The most recent US CPI release occurred within the last 10 days, and the actual value was equal to or lower than the estimated value
Short Trigger All conditions simultaneously true
  1. RSI(14) on the 1H time frame has crossed below 70 from above (overbought rejection)
  2. The last completed candle on the 1H time frame is a bearish engulfing candle, defined as: the body of the current candle fully engulfs the body of the previous candle, the current candle closes red, and the current candle's body is at least 1.5× the body of the previous candle
  3. Price is within a resistance zone, defined as: a price range no wider than 2×ATR(14), within which at least 2 Pivot High(20) formations exist over the last 300 candles, and above whose upper boundary price has never closed in the last 300 candles
  4. On the 4H time frame (higher time frame), the price is below the Moving Average(200)
  5. The S&P 500 has closed lower for 2 consecutive daily candles as a risk-off confirmation

Entry Levels — Long

Entry 1

Immediately open a long market order upon trigger confirmation

Entry 2

Place a long limit order at 1×ATR(14) below the current price at the moment of trigger confirmation

Entry Levels — Short

Entry 1

Immediately open a short market order upon trigger confirmation

Entry 2

Place a short limit order at 1×ATR(14) above the current price at the moment of trigger confirmation

Exit Levels — Long

Exit for Entry 1
  • Stop loss at 0.8% below entry price
  • Take profit at 1.6% above entry price
  • Once price moves 1.2% in our favor, move stop loss to breakeven
Exit for Entry 2
  • Stop loss at 1.2% below entry price
  • Take profit at 2.4% above entry price
  • Apply a 0.6% trailing stop once price moves 1.8% in our favor

Exit Levels — Short

Exit for Entry 1
  • Stop loss at 0.8% above entry price
  • Take profit at 1.6% below entry price
  • Once price moves 1.2% in our favor, move stop loss to breakeven
Exit for Entry 2
  • Stop loss at 1.2% above entry price
  • Take profit at 2.4% below entry price
  • Apply a 0.6% trailing stop once price moves 1.8% in our favor

This example demonstrates a multi-timeframe, multi-condition strategy combining technical analysis, candlestick pattern recognition, support/resistance zones, and a macroeconomic filter — all described with the precision required for accurate algorithm generation.

Trading involves risk. Past backtest performance does not guarantee future results. AlgoBuild provides tools for automated trading. Users are responsible for their own trading decisions.