Skip to content

Commit

Permalink
feat: allow setting product type for GTT orders
Browse files Browse the repository at this point in the history
  • Loading branch information
imJayanth authored and rhnvrm committed May 29, 2024
1 parent 4874af5 commit b92bf55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ type GTTParams struct {
Exchange string
LastPrice float64
TransactionType string
Product string
Trigger Trigger
}

func newGTT(o GTTParams) GTT {
var orders Orders

if o.Product == "" {
o.Product = ProductCNC
}

for i := range o.Trigger.TriggerValues() {
orders = append(orders, Order{
Exchange: o.Exchange,
Expand All @@ -123,7 +128,7 @@ func newGTT(o GTTParams) GTT {
Quantity: o.Trigger.Quantities()[i],
Price: o.Trigger.LimitPrices()[i],
OrderType: OrderTypeLimit,
Product: ProductCNC,
Product: o.Product,
})
}
return GTT{
Expand Down

0 comments on commit b92bf55

Please sign in to comment.