diff --git a/gtt.go b/gtt.go index c5f159e..524fefd 100644 --- a/gtt.go +++ b/gtt.go @@ -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, @@ -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{