Add re-armable CROSSING alarm trigger #37

Closed
opened 2026-07-21 02:30:03 +02:00 by minimons · 0 comments
Owner

Background

The current trigger types cover:

  • PERSISTENT: Repeatedly triggers while the condition is true.
  • ONETIME: Triggers once and never rearms.

Add CROSSING, which triggers every time a condition changes from false to true.

Examples

Upward crossing:

19  SOL  >={{SOL_LONG_ENTRY_PRICE}}  CROSSING

Triggers whenever the price moves from below the entry price to equal or above it.

Downward crossing:

20  SOL  <{{SOL_LONG_ENTRY_PRICE}}  CROSSING

Triggers whenever the price moves from equal/above the entry price to below it.

The condition operator determines the direction, so separate CROSSING_UP and CROSSING_DOWN types are unnecessary.

Behavior

  • The first observed price establishes the initial state and must not trigger CROSSING.
  • A false-to-true transition triggers the alarm.
  • Remaining true does not trigger again.
  • A true-to-false transition rearms the alarm without triggering.
  • The next false-to-true transition triggers again.
  • For ranges, CROSSING triggers whenever the price enters the range.
  • CROSSING does not use a grace period; CROSSING:<seconds> must be rejected.
  • Existing ONETIME and PERSISTENT behavior must remain unchanged.

Acceptance criteria

  • Add CROSSING to AlarmTrigger.
  • Support it in the configuration parser.
  • Implement the transition behavior using the existing previous-condition state.
  • Add examples and semantics to README_alarm.md.
## Background The current trigger types cover: * `PERSISTENT`: Repeatedly triggers while the condition is true. * `ONETIME`: Triggers once and never rearms. Add `CROSSING`, which triggers every time a condition changes from false to true. ## Examples Upward crossing: ```text 19 SOL >={{SOL_LONG_ENTRY_PRICE}} CROSSING ``` Triggers whenever the price moves from below the entry price to equal or above it. Downward crossing: ```text 20 SOL <{{SOL_LONG_ENTRY_PRICE}} CROSSING ``` Triggers whenever the price moves from equal/above the entry price to below it. The condition operator determines the direction, so separate `CROSSING_UP` and `CROSSING_DOWN` types are unnecessary. ## Behavior * The first observed price establishes the initial state and must not trigger `CROSSING`. * A false-to-true transition triggers the alarm. * Remaining true does not trigger again. * A true-to-false transition rearms the alarm without triggering. * The next false-to-true transition triggers again. * For ranges, `CROSSING` triggers whenever the price enters the range. * `CROSSING` does not use a grace period; `CROSSING:<seconds>` must be rejected. * Existing `ONETIME` and `PERSISTENT` behavior must remain unchanged. ## Acceptance criteria * Add `CROSSING` to `AlarmTrigger`. * Support it in the configuration parser. * Implement the transition behavior using the existing previous-condition state. * Add examples and semantics to `README_alarm.md`.
minimons added the enhancement label 2026-07-21 02:30:03 +02:00
minimons self-assigned this 2026-07-21 02:30:03 +02:00
minimons added this to the Evelyn project 2026-07-21 02:30:03 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#37