Price Change from High

The price_change_from_high trigger fires when the current price has dropped by a specified percentage from the highest price within a lookback window. It is a global trigger — no open position is required.

Use it to detect dip-from-peak opportunities: "price is down 5% from its high over the last 24 hours."

Note

This trigger measures the drop from a recent high in the market, not from your position's peak. For position-relative peak tracking, see Trailing Stop instead.

TOML Syntax

[[actions.triggers]]
type = "price_change_from_high"
value = "-5%"           # Required: drop threshold (always negative)
timeframe = "1h"        # Optional: candle size (default: 1m)
lookback = 24           # Optional: number of candles to scan (default: 24)
max_value = "-15%"      # Optional: maximum allowed drop (range cap)
max_count = 1           # Optional: max fires per position

Parameters

ParameterTypeRequiredDefaultDescription
typestringYesMust be "price_change_from_high"
valuestringYesDrop threshold in "-N%" format (always negative)
timeframestringNo"1m"Candle size for the lookback window
lookbackintegerNo24Number of timeframe-sized candles to scan
max_valuestringNoMaximum drop in "-N%" format (range cap)
max_countintegerNounlimitedMaximum times this trigger can fire per position

How It Works

  1. Compute the lookback window: total_candles = lookback × timeframe_in_minutes
  2. Find the highest close in that window
  3. Calculate the drop: change_pct = (current_close - highest_close) / highest_close × 100
  4. Fire if change_pct <= threshold (and within max_value range if set)
graph TD
    A["Scan last N candles<br/>(lookback × timeframe)"] --> B["Find highest close"]
    B --> C["Calculate % drop<br/>from high to current"]
    C --> D{"Drop meets<br/>threshold?"}
    D -->|Yes| E{"Within max_value<br/>range?"}
    D -->|No| F["No action"]
    E -->|Yes or no max_value| G["Trigger fires"]
    E -->|No — too extreme| F

Example Calculation

With timeframe = "1h", lookback = 24, value = "-5%":

  • Window: last 24 × 60 = 1440 one-minute candles (24 hours)
  • Highest close in window: $50,000
  • Current close: $47,000
  • Change: ($47,000 - $50,000) / $50,000 × 100 = -6.0%
  • -6.0% ≤ -5.0% → trigger fires

The value Format

The value must be negative (you're measuring a drop from a high):

ValueMeaning
"-5%"Price dropped at least 5% from the window's high
"-2.5%"Price dropped at least 2.5% from the window's high
"-10%"Price dropped at least 10% from the window's high

Examples

Buy When Price Drops 5% from 24h High

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
type = "price_change_from_high"
value = "-5%"
timeframe = "1h"
lookback = 24

Buy the Dip — But Not the Crash

# Enter when price drops 5-15% from the 4h high window
# Skip if the drop exceeds 15% (falling knife protection)
[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
type = "price_change_from_high"
value = "-5%"
max_value = "-15%"
timeframe = "1h"
lookback = 4

Combine with RSI for Confirmation

[[actions]]
type = "open_long"
amount = "150 USDC"

# Price dropped 3% from 12h high
[[actions.triggers]]
type = "price_change_from_high"
value = "-3%"
timeframe = "1h"
lookback = 12

# AND RSI confirms oversold
[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "35"
timeframe = "1h"

Short-Window Scalping (5m candles, 12-candle window)

[[actions]]
type = "open_long"
amount = "50 USDC"

[[actions.triggers]]
type = "price_change_from_high"
value = "-2%"
timeframe = "5m"
lookback = 12
max_count = 1

Tips

Tip

The default lookback of 24 candles works well with timeframe = "1h" — giving you a 24-hour window. Adjust both parameters to fit your trading timeframe.

Tip

Use max_value for falling knife protection. If the price dropped 30% from the high, it might be a fundamental breakdown rather than a buying opportunity.

Note

This trigger fires based on candle closes, not intra-candle wicks. The "highest close" is the highest closing price in the window, not the highest wick.

TriggerWhat It Measures
Price Change from Low% rise from the lowest price in a lookback window
Price Change% change over a fixed lookback period
Trailing Stop% drop from position's peak (requires open position)
Position Price Change% change from your entry price