trend_follower.md 3.8 KB

Trend Follower

Directional strategy for confirmed momentum.

Best Used When

  • trend is strong and persistent
  • structure supports continuation
  • liquidity is normal
  • Hermes wants to follow momentum instead of fading it

Avoid When

  • price is range-bound
  • trend strength is weak or noisy
  • event risk is high
  • the market is too chaotic for clean continuation

How It Works

  • The strategy acts on the configured side, not on an internal trend model.
  • trade_side controls whether it can buy, sell, or accept either side. both is symmetric and depends on Hermes or the operator for direction.
  • balance_target is a wallet-allocation target, not a position-size target.
  • For buy, sub-1.0 values stop the strategy once the base share of wallet value reaches the target.
  • For sell, sub-1.0 values stop the strategy once the quote share reaches the target.
  • When an order would overshoot a sub-1.0 target, the last order is clamped to the remaining gap.
  • entry_offset_pct sets the limit price offset for new entries.
  • cooldown_ticks pauses the next few ticks after a successful order.

Parameters

  • trade_side: Allowed side selection. buy and sell make it one-sided; both is symmetric and relies on Hermes for direction.
  • balance_target: Allocation target between 0.0 and 1.0. 1.0 means keep trading until the funding side is exhausted. Lower values stop once the wallet reaches the requested mix.
  • entry_offset_pct: Limit-price offset used for new entries. Buy orders are placed above the last price, sell orders below it.
  • exit_offset_pct: Reserved for exit or reversal pricing in policy and supervision output. It is part of the contract even though the current entry path only uses entry_offset_pct.
  • order_notional_quote: Target quote notional per order.
  • max_order_notional_quote: Optional hard cap on quote notional per order.
  • dust_collect: Lets the shared sizing helper consume leftover size more aggressively when a venue minimum would otherwise strand a small remainder.
  • cooldown_ticks: Number of ticks to wait after a successful order before the strategy can act again.
  • debug_orders: Enables order-placement debug logging.

Hermes Policy Mapping

  • Hermes controls whether the side is active.
  • Hermes may set balance_target to define how far the wallet should rotate.
  • Hermes may set the quote notional and offsets.
  • apply_policy() currently records the derived values but does not rewrite the config the way the grid and exposure strategies do.

Notes

  • Hermes decides when trend following is allowed.
  • Trader maps policy to concrete order behavior.
  • The strategy reports side, quote notional, and policy-derived settings.
  • trade_side lets Hermes or the operator run a long-only, short-only, or symmetric directional instance.
  • balance_target=1.0 means keep trading until no more usable size remains on the funding side.
  • In buy mode, values below 1.0 target the base share of wallet value. Example: 0.5 stops near a 50/50 base-quote split.
  • In sell mode, values below 1.0 target the quote share of wallet value. Example: 0.5 stops near a 50/50 quote-base split.
  • When an order would overshoot a sub-1.0 balance_target, the final order is clamped to the remaining target gap instead of sending the full configured notional.
  • live fee rates are used directly, so the strategy does not need a configured fee fallback.

Useful Example

{
  "trade_side": "buy",
  "balance_target": 0.8,
  "entry_offset_pct": 0.0035,
  "exit_offset_pct": 0.002,
  "order_notional_quote": 25,
  "max_order_notional_quote": 40,
  "dust_collect": true,
  "cooldown_ticks": 3,
  "debug_orders": false
}

This is a practical long-only accumulation setup. It keeps buying until the wallet is roughly 80 percent base by value, uses a modest entry offset, and avoids oversized last orders.