2026-02-25 22:48:23 +03:00
|
|
|
package entities
|
|
|
|
|
|
|
|
|
|
import "github.com/shopspring/decimal"
|
|
|
|
|
|
|
|
|
|
type AlertID string
|
|
|
|
|
|
2026-02-25 23:52:21 +03:00
|
|
|
type AlertCondition string
|
|
|
|
|
|
|
|
|
|
const (
|
2026-04-27 20:34:48 +03:00
|
|
|
AlertConditionAbove AlertCondition = "above" // trigger when candle High reaches target
|
|
|
|
|
AlertConditionBelow AlertCondition = "below" // trigger when candle Low reaches target
|
|
|
|
|
AlertConditionCloseAbove AlertCondition = "close_above" // trigger when candle Close exceeds target
|
|
|
|
|
AlertConditionCloseBelow AlertCondition = "close_below" // trigger when candle Close drops below target
|
2026-02-25 23:52:21 +03:00
|
|
|
)
|
|
|
|
|
|
2026-02-25 22:48:23 +03:00
|
|
|
type Alert struct {
|
|
|
|
|
ID AlertID
|
|
|
|
|
UserID UserID
|
|
|
|
|
Price decimal.Decimal
|
2026-02-25 23:52:21 +03:00
|
|
|
Condition AlertCondition
|
2026-02-25 22:48:23 +03:00
|
|
|
Instrument Instrument
|
2026-04-27 20:34:48 +03:00
|
|
|
Timeframe string // non-empty for close_above / close_below; provider.KlineInterval value
|
2026-02-25 22:48:23 +03:00
|
|
|
}
|