candle close alert

This commit is contained in:
yash 2026-04-27 20:34:48 +03:00
parent 30a7f1b68c
commit dd03cae0f3
10 changed files with 328 additions and 60 deletions

View file

@ -7,8 +7,10 @@ type AlertID string
type AlertCondition string
const (
AlertConditionAbove AlertCondition = "above" // trigger when price rises to target
AlertConditionBelow AlertCondition = "below" // trigger when price drops to target
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
)
type Alert struct {
@ -17,4 +19,5 @@ type Alert struct {
Price decimal.Decimal
Condition AlertCondition
Instrument Instrument
Timeframe string // non-empty for close_above / close_below; provider.KlineInterval value
}

View file

@ -10,4 +10,5 @@ type Candle struct {
OpenTime time.Time
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
}