No Code Strategy Builder

Create trading strategies with 0 code!

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. 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: # 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)      

# 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!


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

Last updated