🧩Sample Trading Strategies

This section presents reference strategies demonstrating common trading patterns. These examples are intended as learning tools and starting points rather than ready-to-use trading systems.

The strategies below illustrate common trading patterns. Each example highlights a specific idea or combination of indicators and is intended to help you understand how strategies are structured and composed.

Some of the sample strategies below can be replicated seen and replicated in the default strategies section and feature some of the most popular trading strategies, including:

  1. Spot grid trading bot

  2. DCA (Dollar Cost Average)

  3. Spot Martingale

  4. Rebalancing BOT

  5. TWAP

  6. Infinity Grid

  7. Looping

  8. Trend follow

memejob LUA strategies, intro:

All strategies:

  • Are stateless

  • Script runs once per bar

  • Use only supported syntax and indicators

  • Express intent exclusively via return values

Return values:

Each example focuses on a specific concept such as trend detection, momentum confirmation, mean reversion, or volume filtering. You are encouraged to adapt parameters, combine patterns, and test variations rather than using examples verbatim.

1. SMA Trend Follower

Uses a Simple Moving Average as a trend baseline. Follows the dominant direction and exits on trend loss.

Visual intuition:

2. EMA Crossover

Classic fast/slow EMA crossover strategy. Enters on bullish momentum, exits on bearish crossover.

3. Triple EMA Trend Stack

Strong trend confirmation using three EMAs aligned in the same direction.

Visual:

4. Pullback to EMA (DCA-Friendly)

Buys pullbacks during an existing uptrend. Suitable for DCA-style accumulation.

5. EMA Momentum Runner (DCA friendly)

Adds exposure while price remains above a short-term EMA. Exits on momentum loss.

Visual:

6. Fast EMA Momentum Proxy

Momentum proxy using fast EMA positioning instead of bar-to-bar price changes (price history not supported).

7. SMA Direction Proxy

Approximates SMA slope using price position relative to SMA.

8. EMA Trend Confirmation

Requires both price and EMA to confirm trend direction.

9. Typical Price Trend

Uses the HLC3 (typical price) instead of close to reduce noise.

10. WMA Trend Follower

Trend-following strategy using a Weighted Moving Average for faster reaction.

11. EMA Compression Breakout

Enters when multiple EMAs align, indicating trend expansion.

12. Range Breakout

Trades breakouts beyond the previous bar’s range.

13. SMA Mean Reversion (Simple)

Buys below the SMA and exits above it. Simple counter-trend strategy.

14. EMA Acceleration

Trades based on the acceleration or deceleration of EMA movement.

15. Dual-Timeframe Proxy (Fast vs Slow SMA)

Simulates multi-timeframe logic using fast vs slow SMAs.

16. The "Golden Cross" & "Death Cross"

The "Hello World" of trading bots & classic strategy in trend following.

It captures massive moves by entering when short-term momentum overtakes long-term trends.

  • Logic:

    • Buy when the fast MA (e.g., 50) crosses above the slow MA (e.g., 200).

    • Sell when it crosses below.

17. The "MACD Zero-Cross" Momentum

A fast momentum strategy using the MACD line relative to zero.

  • Buy when MACD turns positive (bullish momentum)

  • Exit when MACD turns negative (bearish momentum)

Detect zero-cross via comparing current vs slightly longer window MACD values

18. Spot Martingale

Buys when the price dips below a reference (e.g., EMA) and Continues signaling buys while the dip persists → mimics averaging down. Exits when price recovers above the reference

Logic: Detect zero-cross via comparing current vs slightly longer window MACD values

19. WMA Trend Strength

Uses Weighted Moving Average (WMA) to capture strong trends by emphasizing recent bars.

  • Buys when trend strength is bullish (price above WMA)

  • Exits when trend weakens (price below WMA)

20. Mean Reversion with Bollinger-style Logic

Detects extreme price deviations from a moving average.

  • Buy when price drops below the lower band

  • Exit when price rises above the upper band

21. MACD Histogram Divergence

Looks for momentum divergence between price and MACD histogram.

  • Buy when price makes a lower low but MACD histogram shows higher low → bullish divergence

  • Exit when divergence fails or turns bearish

Note: Composability of supporting data can be queried in the documentation. As more indicators and data sources come live, strategies can evolve and public good repository will evolve.

Last updated