candle close alert
This commit is contained in:
parent
30a7f1b68c
commit
dd03cae0f3
10 changed files with 328 additions and 60 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,5 @@ type Candle struct {
|
|||
OpenTime time.Time
|
||||
High decimal.Decimal
|
||||
Low decimal.Decimal
|
||||
Close decimal.Decimal
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue