Skip to content

Commit

Permalink
add support for breakout trades (zone_strategy)
Browse files Browse the repository at this point in the history
  • Loading branch information
jon4h committed May 16, 2021
1 parent af437f7 commit f797cb5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/services/webhook.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ func genEntry(price float64, direction string, strategy dal.Strategy) string {
}
} else if strategy.ZoneStrategy != nil {
if strategy.ZoneStrategy.IsBreakout {
// TODO add support for breakout
if strings.EqualFold(direction, "long") {
t1 := price + (price * (strategy.ZoneStrategy.EntryStart / 100))
t2 := price + (price * (strategy.ZoneStrategy.EntryStop / 100))
msg = fmt.Sprintf("\nEntry zone above %f-%f\n", t1, t2)
} else if strings.EqualFold(direction, "short") {
t1 := price - (price * (strategy.ZoneStrategy.EntryStart / 100))
t2 := price - (price * (strategy.ZoneStrategy.EntryStop / 100))
msg = fmt.Sprintf("\nEntry zone below %f-%f\n", t1, t2)
}
} else {
if strings.EqualFold(direction, "long") {
t1 := price + (price * (strategy.ZoneStrategy.EntryStart / 100))
Expand Down

0 comments on commit f797cb5

Please sign in to comment.