Skip to content

Commit b92bf55

Browse files
imJayanthrhnvrm
authored andcommitted
feat: allow setting product type for GTT orders
1 parent 4874af5 commit b92bf55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gtt.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,17 @@ type GTTParams struct {
109109
Exchange string
110110
LastPrice float64
111111
TransactionType string
112+
Product string
112113
Trigger Trigger
113114
}
114115

115116
func newGTT(o GTTParams) GTT {
116117
var orders Orders
117118

119+
if o.Product == "" {
120+
o.Product = ProductCNC
121+
}
122+
118123
for i := range o.Trigger.TriggerValues() {
119124
orders = append(orders, Order{
120125
Exchange: o.Exchange,
@@ -123,7 +128,7 @@ func newGTT(o GTTParams) GTT {
123128
Quantity: o.Trigger.Quantities()[i],
124129
Price: o.Trigger.LimitPrices()[i],
125130
OrderType: OrderTypeLimit,
126-
Product: ProductCNC,
131+
Product: o.Product,
127132
})
128133
}
129134
return GTT{

0 commit comments

Comments
 (0)