# No Code Strategy Builder

<figure><img src="/files/jNEWyHbdRuxpER4dXR12" alt=""><figcaption></figcaption></figure>

**No-Code Strategy Builder** Allows Users to describe a strategy in plain & natural language (e.g., “create a trend following strategy”). The Large Language Model (**HyperX**) interprets users prompts and auto-generates underlying trading logic & code turning prompts into trading strategies.\
\
\&#xNAN;*Lets look at a simple example below:* \
\
\- **HyperX** was prompted to Create a trend following strategy & in response the following code was generated with underlying trading logic that can be easily modified, back tested & automated live onto Hyperliquid with just one click!\
\
**Trading Logic generated:**\
&#x20;\# Long entry: EMA20 crosses above EMA50, close > EMA50, ADX > 25

```python
        long_cond = (
            (dataframe['ema_20_prev'] <= dataframe['ema_50_prev']) &
            (dataframe['ema_20'] > dataframe['ema_50']) &
            (dataframe['close'] > dataframe['ema_50']) &
            (dataframe['adx'] > 25)      
```

&#x20; \# Long exit: EMA20 crosses below EMA50 OR ADX < 20

```

        long_exit_cond = (
            ((dataframe['ema_20_prev'] >= dataframe['ema_50_prev']) & (dataframe['ema_20'] < dataframe['ema_50'])) |
            (dataframe['adx'] < 20)
        )// Sample code
```

**See the full code below!**&#x20;

```python

from freqtrade.strategy import IStrategy
from pandas import DataFrame
import talib as ta
import numpy as np

class AwesomeStrategy(IStrategy):
    """
    EMA Trend-Following with ADX filter.

    - EMA20 / EMA50 crossover for entries and exits
    - ADX(14) threshold to confirm trend strength
    - ATR(14) calculated for optional use
    """

    can_short = True

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        # EMA indicators
        dataframe['ema_20'] = ta.EMA(dataframe['close'], timeperiod=20)
        dataframe['ema_50'] = ta.EMA(dataframe['close'], timeperiod=50)

        # ADX and ATR
        dataframe['adx'] = ta.ADX(dataframe['high'], dataframe['low'], dataframe['close'], timeperiod=14)
        dataframe['atr'] = ta.ATR(dataframe['high'], dataframe['low'], dataframe['close'], timeperiod=14)

        # Previous values for crossover detection
        dataframe['ema_20_prev'] = dataframe['ema_20'].shift(1)
        dataframe['ema_50_prev'] = dataframe['ema_50'].shift(1)

        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        # Initialize columns
        dataframe['enter_long'] = 0
        dataframe['enter_short'] = 0

        # Long entry: EMA20 crosses above EMA50, close > EMA50, ADX > 25
        long_cond = (
            (dataframe['ema_20_prev'] <= dataframe['ema_50_prev']) &
            (dataframe['ema_20'] > dataframe['ema_50']) &
            (dataframe['close'] > dataframe['ema_50']) &
            (dataframe['adx'] > 25)
        )

        # Short entry: EMA20 crosses below EMA50, close < EMA50, ADX > 25
        short_cond = (
            (dataframe['ema_20_prev'] >= dataframe['ema_50_prev']) &
            (dataframe['ema_20'] < dataframe['ema_50']) &
            (dataframe['close'] < dataframe['ema_50']) &
            (dataframe['adx'] > 25)
        )

        dataframe.loc[long_cond, 'enter_long'] = 1
        dataframe.loc[short_cond, 'enter_short'] = 1

        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        # Initialize columns
        dataframe['exit_long'] = 0
        dataframe['exit_short'] = 0

        # Long exit: EMA20 crosses below EMA50 OR ADX < 20
        long_exit_cond = (
            ((dataframe['ema_20_prev'] >= dataframe['ema_50_prev']) & (dataframe['ema_20'] < dataframe['ema_50'])) |
            (dataframe['adx'] < 20)
        )

        # Short exit: EMA20 crosses above EMA50 OR ADX < 20
        short_exit_cond = (
            ((dataframe['ema_20_prev'] <= dataframe['ema_50_prev']) & (dataframe['ema_20'] > dataframe['ema_50'])) |
            (dataframe['adx'] < 20)
        )

        dataframe.loc[long_exit_cond, 'exit_long'] = 1
        dataframe.loc[short_exit_cond, 'exit_short'] = 1

        return dataframe
```


---

# Agent Instructions: 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:

```
GET https://modern-stoic-ai.gitbook.io/hypertrade-ai/getting-started/platform-features/no-code-strategy-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
