> For the complete documentation index, see [llms.txt](https://botlyz.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://botlyz.gitbook.io/docs/english/le-builder.md).

# The Builder

## Overview

The **Builder** is a visual, no-code strategy builder that lets you create your own automated trading strategies in just a few clicks. Rather than editing Python code, you assemble **logic blocks** to define entry and exit conditions, after which the system generates and tests your strategy before deploying it.

> **Important disclaimer**: trading involves a **significant risk of capital loss**. Past performance is not indicative of future performance. Botlyz provides neither investment advice nor any promise of returns. You remain solely responsible for your decisions and your capital. See [Risk Warning](/docs/english/avertissement-risques.md).

***

## How it works

### Structure of a strategy

A strategy built in the Builder consists of:

1. **Basic parameters**
   * Trading pair (e.g. BTC/USDC, HYPE/USDC)
   * Timeframe (duration of each candle: 1m, 5m, 15m, 1h, etc.)
   * Leverage (1 to 20x)
   * Allocation (1 to 100% of available capital)
2. **LONG entry conditions** (opening a buy position, which profits if the price rises and loses if it falls)
   * AND/OR blocks to combine several indicators
   * Buy signal at the **MARKET price at candle close**
3. **SHORT entry conditions** (short sale, a position betting on a decline, which loses if the price rises)
   * AND/OR blocks to combine several indicators
   * Sell signal at the **MARKET price at candle close**
4. **Risk management**
   * **Stop-loss (SL)**: percentage of the entry price at which the position is automatically closed in case of loss
   * **Take-profit (TP)**: percentage of the entry price at which the position is automatically closed at a profit
   * **SL/TP slippage**: tolerance for price variation during execution (1 to 50%, default 10%)

For details on indicators and risk parameters, see [Indicators](/docs/english/indicateurs.md) and [Risk Parameters](/docs/english/parametres-de-risque.md).

***

## Available indicator blocks

The Builder offers a library of recognized technical indicators to build your entry and exit conditions.

### Moving averages

**EMA (Exponential Moving Average)**

* A moving average that gives more weight to recent prices
* Parameter: period (number of candles, e.g. 10, 20, 50, 200)
* Common reading: price above the EMA = uptrend

**SMA (Simple Moving Average)**

* A simple arithmetic average over N candles
* Parameter: period
* Use: identify the overall trend and support/resistance zones

**Moving-average crossover**

* Signal when a fast EMA (e.g. 10) crosses a slow EMA (e.g. 50)
* Upward crossover = LONG signal
* Downward crossover = SHORT signal

### Oscillators and volatility

**RSI (Relative Strength Index)**

* Measures the strength of the movement, between 0 and 100
* RSI > 70 = overbought (possible downside signal)
* RSI < 30 = oversold (possible upside signal)
* Parameter: period (default 14)

**MACD (Moving Average Convergence Divergence)**

* Combines three EMAs to identify momentum and trend changes
* Signal when the MACD line crosses the signal line
* MACD histogram: measures the separation between the two lines

**ATR (Average True Range)**

* Measures volatility over a period
* High ATR = high volatility, low ATR = calm market
* Useful for adjusting order size or stops

**Bollinger Bands**

* An envelope around the moving average (upper band and lower band)
* Price > upper band = overbought
* Price < lower band = oversold
* Parameters: SMA period, number of standard deviations

### Patterns and price

**Price comparison**

* Close price > SMA / EMA
* Close price < SMA / EMA
* High price > fixed level
* Low price < fixed level

**Volume**

* Current volume > average volume over N candles
* Useful for confirming a price movement

**Change %**

* Percentage change of the close over N candles
* E.g. change > 2% = strong rise

***

## AND/OR logic for conditions

Each group of entry and exit conditions uses combinatorial logic:

### AND mode

All blocks must be true **simultaneously** to trigger the entry.

**LONG example**:

* EMA 10 > EMA 50 **AND**
* RSI < 70 **AND**
* Volume > average volume

The MARKET buy order is only triggered if these three conditions are true at the same time at the **candle close**.

### OR mode

At least one block must be true to trigger the entry.

**SHORT example**:

* EMA 10 < EMA 50 **OR**
* RSI > 70

The MARKET sell order is triggered if either (or both) of the conditions becomes true.

### Nesting

Complex conditions can combine several levels:

* (EMA 10 > EMA 50 AND RSI < 70) **OR** (Price > upper Bollinger Band)

***

## Detailed execution flow

### 1. Candle closed = entry signal computed

At each candle close, the Builder evaluates all LONG and SHORT entry conditions on the available data (close, high, low, volume, etc.).

**Important**: the order is **placed at the MARKET price** at the **candle close**. You therefore enter at the best price available at that precise moment, with no guarantee of a specific price.

### 2. Entry order executed

* **LONG**: buy at the MARKET price
* **SHORT**: short sale at the MARKET price
* Position size: (available capital × allocation % × leverage) / entry price

### 3. Exit orders placed automatically

Once in a position, the system immediately places:

* A **Take-Profit** order above (LONG) or below (SHORT) the entry price
* A **Stop-Loss** order below (LONG) or above (SHORT) the entry price

These two orders remain active until one of them is executed.

### 4. Position exit

If the price reaches the **TP** (Take-Profit): exit at a profit, position closed. If the price reaches the **SL** (Stop-Loss): exit at a loss, position closed and orders cancelled.

> Note: in the rare case where both the SL and the TP are reached on the same candle, the **SL takes priority** (a conservative risk-management principle).

### 5. No overlapping positions

The system **never opens two positions at the same time** on the same pair. If you are already LONG and a SHORT signal arrives, the signal is ignored (and vice versa).

***

## Risk parameters

### Leverage

**Range**: 1 to 20x

**Definition**: a multiplier of the position size. With 2x leverage and 1000 USD of capital, you open a 2000 USD position. Leverage amplifies the potential loss as much as the potential gain, and brings the liquidation threshold closer.

**Default**: 1x (no leverage)

**Worth knowing**: at 1-2x, the leverage effect is low or nil. High leverage (> 10x) sharply increases the risk of liquidation (forced closure if the loss approaches the margin amount).

### Capital allocation

**Range**: 1 to 100%

**Definition**: the percentage of available capital committed per trade. For example, 50% means each order will use 50% of your available balance.

**Default**: 100%

**Effect of the parameter**: at 100%, the entire available balance is committed; below that, a portion remains available. At 25%, up to 4 simultaneous positions are possible before the funds are exhausted. The choice is your decision.

### Stop-Loss (%)

**Range**: 1 to 50%

**Definition**: the maximum percentage loss accepted. A 5% SL automatically closes the position when the price falls by 5% relative to the entry price.

**Default**: 10%

**LONG example**:

* Entry: 50,000 USD (BTC)
* SL 5%: exit order at 47,500 USD
* Targeted maximum loss: 2,500 USD

**Worth knowing**: a wide SL lets losses grow larger; a tight SL causes more frequent exits on market noise. The backtest lets you observe the effect of each setting.

### Take-Profit (%)

**Range**: 1 to 50%

**Definition**: the targeted percentage profit. A 3% TP closes the position at +3% relative to the entry price.

**Default**: 5%

**SHORT example**:

* Entry: 100 USD (short)
* TP 2%: cover order at 98 USD
* Targeted gain: 2 USD

**Worth knowing**: the ratio between TP and SL defines the risk/reward ratio of the configuration. A TP lower than the SL in absolute terms increases the frequency of profit-taking but reduces the gain per trade; the opposite effect applies to a higher TP. The setting is your decision and depends on your entry logic.

### SL/TP slippage (%)

**Range**: 1 to 50%

**Default**: 10%

**Definition**: the tolerance for price variation during execution of the SL or TP. On Lighter (a DEX), the order is executed at the best price available in the order book. If the book is thinly liquid, you may get a less favorable price than expected.

**Example, SL/TP slippage 5%**:

* SL target: 5% loss
* SL accepted: up to about 5.25% (5% + 5% relative slippage)

**Effect of the parameter**: a wider slippage favors order execution on illiquid pairs or during volatile periods, at the cost of a potentially worse exit level; a tighter slippage protects the exit level but may prevent execution.

> The elements described in this section are general explanations of how the parameters behave, not personalized recommendations. If in doubt, consult an independent qualified professional before any trading decision.

***

## Creation and deployment flow

### Step 1: basic configuration

Define:

* Strategy name (e.g. "My EMA Cross RSI")
* Trading pair (e.g. HYPE/USDC)
* Timeframe (e.g. 5m)
* Leverage and allocation
* SL and TP in %

### Step 2: LONG entry conditions

Add the indicator blocks for the buy signal:

* Select an indicator (EMA, RSI, etc.)
* Configure the parameters (period, thresholds)
* Choose the operation (>, <, ==, crossover, etc.)
* Group with AND/OR

### Step 3: SHORT entry conditions

Define the symmetrical (or inverse) conditions for short sales.

### Step 4: advanced parameters (optional)

* Adjust the SL/TP slippage if needed
* Configure trading hours (e.g. trade only from 8:00 to 16:00 UTC)
* Set a fixed position size instead of a percentage, if you prefer

### Step 5: backtest

**Before going live**, run a backtest on historical data:

* Period: for example 3 to 12 months of data
* Statistics displayed:
  * Number of trades
  * Win rate (%)
  * Total profit/loss over the tested period
  * Sharpe ratio (risk-adjusted return)
  * Maximum drawdown (largest decline in capital)
  * Profit factor (total gains / total losses)

These statistics describe the **past behavior** of the configuration over the chosen period. They constitute neither a forecast nor a promise of results. A strategy that performed well in backtesting may underperform live. See [Backtest](/docs/english/backtest.md).

> **Important**: the backtest is a simulation and may misestimate real fees, slippage and available liquidity. Live, take fees into account (see the section below and [Fees](/docs/english/frais.md)). Actual performance may differ, sometimes significantly, from simulated results.

### Step 6: signature and deployment

After the backtest:

1. The system generates a document (EIP-712) summarizing the strategy, its parameters and its conditions
2. You **sign this document with your Ethereum wallet** (EIP-712 signature, off-chain, no gas fees)
3. The signature proves that **you have explicitly approved this configuration**
4. The strategy is deployed and starts trading live

**Important**: you remain the owner of your funds. The API keys connected to Botlyz are configured in "trade-only" mode (no withdrawal is possible). See [Signature and Transparency](/docs/english/signature-et-transparence.md) and [Non-Custodial Security](/docs/english/securite-non-custodial.md).

### Step 7: monitoring and modification

Once deployed, you can:

* **View real-time statistics**: recent trades, PnL, open positions
* **Stop the strategy**: no more new signals, but existing positions remain open
* **Modify the parameters**: adjust TP, SL, conditions
  * Any modification **requires a new signature** (proof that you have approved the changes)
* **Delete the strategy**: immediate deletion

***

## Fees

### Botlyz protocol fee

The **only** fee related to Botlyz is a **protocol fee of 10 bps (0.10%)**, charged automatically on each order through Lighter's "partner attribution" program, and capped at 10 bps.

This is a **protocol fee, charged and distributed by the platform, and not a Botlyz invoice or commission**. Botlyz charges **no commission on your gains**, applies no subscription and makes no deduction from your PnL.

* 1 entry (LONG or SHORT): 0.10%
* 1 exit (TP or SL): 0.10%
* Total cost per round trip: about 0.20% (0.10% on entry + 0.10% on exit)

### Lighter platform fees

Independently of Botlyz, the Lighter platform applies its own fees (trading, funding on leveraged positions, etc.). These fees are charged directly by Lighter to your trading balance.

For the full details, see [Fees](/docs/english/frais.md).

***

## Concrete example: EMA crossover strategy

### Configuration

| Parameter      | Value     |
| -------------- | --------- |
| Pair           | HYPE/USDC |
| Timeframe      | 5m        |
| Leverage       | 2x        |
| Allocation     | 50%       |
| Stop-Loss      | 5%        |
| Take-Profit    | 2%        |
| SL/TP slippage | 10%       |

### Entry conditions

**LONG**:

* EMA 10 crosses **above** EMA 50 **AND**
* RSI < 70

**SHORT**:

* EMA 10 crosses **below** EMA 50 **AND**
* RSI > 30

### Live scenario (LONG)

1. At 14:35 UTC, a 5m candle closes: EMA 10 moves above EMA 50, RSI = 45
2. LONG condition true: MARKET buy order placed at the close price (e.g. 4.25 USD per HYPE)
3. Position opened: (50% × 2x × capital) / 4.25 = N HYPE
4. Exit orders placed:
   * TP at 4.34 USD (4.25 × 1.02 = +2%)
   * SL at 4.04 USD (4.25 × 0.95 = -5%)
5. The price moves, then reaches 4.34 USD
6. The TP order is executed, the position is closed

This example illustrates the execution mechanics. It does not describe an expected result: the opposite scenario, where the price first reaches the SL, is equally possible.

***

## Best practices and common pitfalls

### Best practices

1. **Backtest** over several months before going live, while keeping in mind that the backtest does not guarantee the future
2. **Start small**: a low allocation in the first weeks to observe real behavior
3. **Use conservative leverage** (1-3x) while you get to grips with your strategy
4. **Combine indicators** to reduce false signals (for example 2 to 3 conditions)
5. **Define a risk/reward ratio** consistent with your entry logic
6. **Monitor regularly**: check the real-time statistics and adjust if necessary

### Common pitfalls

1. **Over-fitting**: a strategy whose parameters have been over-tuned to the past often behaves disappointingly live
2. **Leverage too high**: beyond 10x, the risk of sudden liquidation increases sharply
3. **Conditions too strict**: if you require 5 simultaneous AND conditions, signals become rare
4. **Ignoring slippage and fees**: always factor a trading cost into your reasoning
5. **No stop-loss**: exposes you to uncontrolled loss risk
6. **Exiting too quickly**: a 0.5% TP leaves little margin once fees are deducted

***

## Comparison: Builder vs exclusive strategies (SIGMA)

| Aspect         | Builder (no-code)             | SIGMA (exclusive)                                                  |
| -------------- | ----------------------------- | ------------------------------------------------------------------ |
| **Creation**   | Visual blocks, no code        | Proprietary algorithm                                              |
| **Conditions** | AND/OR on standard indicators | Mean-reversion on a moving-average envelope (+ RSI filter in v2.1) |
| **Entry**      | MARKET at candle close        | LIMIT orders (envelope logic)                                      |
| **Exit**       | TP in % and SL in %           | Reversion toward the moving average, fixed stop-loss in %          |
| **Leverage**   | 1 to 20x configurable         | According to the strategy configuration                            |
| **Backtest**   | Fast (a few seconds)          | Longer optimization                                                |
| **Access**     | Built into the Builder        | Exclusive strategies                                               |

This table compares the **operation** of the two approaches. It asserts no performance for either one. See [SIGMA Exclusive Strategies](/docs/english/strategies-exclusives-sigma.md) and [Strategies Overview](/docs/english/vue-d-ensemble.md).

***

## Limit orders (entries and exits)

By default, the Builder places orders at the **MARKET price** at candle close. You can also choose **limit orders**: an order placed at an **exact price**, which only executes if the market reaches that price.

### Entry at a precise price

For an entry condition, you can specify a **price level** (level selector) instead of market execution. The order is then placed in the order book and waits for the price to reach it.

* **LONG limit**: buy placed at a chosen price, usually below the current price (waiting for a pullback)
* **SHORT limit**: sell placed at a chosen price, usually above the current price (waiting for a bounce)

### Attached SL/TP exits

A limit entry order carries its **attached exits**: as soon as the entry is filled, the Stop-Loss and Take-Profit are placed automatically, just like a market entry.

### Execution setting per condition

The execution mode (market or limit, and the target price level) is set **per condition**. So you can, for example, enter LONG at market and SHORT with a limit.

### Backtest and live identical

The behavior of limit orders is **the same in backtest and live**: the backtest simulates the fill at the chosen price level, then places the attached exits the same way the live engine does.

> A limit order is **not guaranteed to be filled**: if the price never reaches the chosen level, the entry does not happen. In exchange, it targets a precise price rather than the current price.

***

## Re-entry after a stop-loss

After a **Stop-Loss** exit, you can gate the **re-entry** in the same direction, to avoid chaining several stop-losses in a row in a market moving against you ("stop-loss streak").

* The re-entry condition applies **per direction** (LONG and SHORT separately).
* Until it is met, no new entry in the same direction is taken after an SL.
* **Empty** (no condition): re-entry is **immediate**, as soon as an entry signal reappears.

Example: after an SL on a LONG, require the RSI to drop back below 30 before buying LONG again. The SHORT direction is not affected.

***

## Strategy comparator

After a backtest, you can **compare your strategy to another one** to put them head to head over the same period.

### What to compare against

* **Another of your strategies** (Builder)
* A strategy from the **catalog**

### What is displayed

* **Overlaid performance curves** on a single chart
* **Side-by-side metrics**: return, win rate, maximum drawdown, Sharpe ratio, profit factor
* The **winner highlighted** on each metric (purely descriptive, over the tested period)

### A fair head-to-head

The comparison uses the **same execution configuration** (same pair, timeframe, period, simulated fees and slippage) for both strategies, so that the observed gap comes from the logic and not from the settings.

> The figures describe the **past behavior** over the chosen period; they do not predict future results and are not a recommendation. See [Backtest](/docs/english/backtest.md).

***

## Reuse a setting from a Lab heatmap

The [Lab](/docs/english/vue-d-ensemble-1.md) can produce a **heatmap** that sweeps combinations of parameters and shows their behavior over the tested period. From a heatmap cell, a **"Reuse in the Builder"** button copies that setting into the Builder **in one click**.

You can then open, tweak, backtest and deploy it like any strategy.

> A setting spotted on a heatmap reflects the **past** of the tested period. It still has to be backtested and decided on by yourself; past performance does not guarantee future performance.

***

## Duplicate, share and import a strategy

You can **duplicate** one of your strategies, **share** it with another user, and **import** the ones shared with you, **without rebuilding everything by hand**.

### Duplicate

On a saved strategy, the **"Duplicate"** button creates a **copy in your account**, **auto-named** (with a `(2)`, `(3)`… suffix if the name already exists). Handy for testing a variant without touching the original. The copy is **independent**: backtesting, editing or deploying it does not affect the original strategy.

### Export (share)

On a saved strategy, click **"⤴ Share"**. Botlyz generates a short **share code** (e.g. `ABCD2345`) and a **link**. Send the code or link to whoever you like.

> The code is **opaque**: it contains no readable condition or indicator. It points to a copy of your configuration stored server-side. A code can only be created by exporting an existing strategy.

### Import

Click **"⇩ Import a code"** (top of the Builder), paste the code you received, then **Import**. The strategy is **copied into your account** (with a `(2)`, `(3)`… suffix if the name already exists). You can then open, tweak, backtest and deploy it like any strategy. A **share link** opens the Builder with the import pre-filled.

> **Important**: a shared strategy is **content generated by another user**. It is **neither vetted nor recommended by Botlyz** and does **not constitute investment advice**. **Backtest it and decide for yourself**; past performance does not guarantee future results. See the "Strategy sharing between users" annex of the [Terms of Use](https://botlyz.com/app/legal/CGU_Botlyz.pdf).

***

## Support and resources

For any question or issue related to the Builder:

* **Telegram**: @botlyz\_manager (<https://t.me/botlyz\\_manager>)
* **Help form**: the "Help" tab in the application (the request goes directly to the Botlyz team)
* **Failing backtest**: check the period, the pair's liquidity and that the indicator parameters are valid
* **Strategy not deployed**: make sure you have signed the EIP-712 document and that your wallet is connected

See also [Support](/docs/english/support.md) and the [FAQ](/docs/english/faq.md).

***

## Builder flow summary

```
1. Basic configuration (pair, leverage, SL/TP)
      |
2. Define LONG and SHORT entry conditions
      |
3. Adjust advanced parameters (slippage, hours)
      |
4. Run the backtest
      |
5. Analyze the statistics (win rate, Sharpe, drawdown)
      |
6. Sign the configuration document (EIP-712)
      |
7. Deploy live
      |
8. Monitor in real time and adjust as needed
```

***

## Disclaimers

**Botlyz is a software editor and a trading automation tool, not a financial adviser.**

* You are solely responsible for your investment decisions and your configuration, which you sign (EIP-712)
* Past performance, including in backtesting, is not indicative of future results
* Trading involves a risk of loss; margin trading (leverage) exposes you to a risk of liquidation
* Fees reduce net profits: a protocol fee of 10 bps per order applies through Lighter, in addition to the Lighter platform's own fees
* You retain full control of your funds (non-custodial): your keys stay with you and the API keys are in trade-only mode (no withdrawal possible)
* If in doubt, consult an independent qualified professional before any trading decision

See [Risk Warning](/docs/english/avertissement-risques.md) and [Legal Notice](/docs/english/mentions-legales.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://botlyz.gitbook.io/docs/english/le-builder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
